Skip to content

Commit

Permalink
fix formatting with yapf version
Browse files Browse the repository at this point in the history
  • Loading branch information
thavlik committed Mar 7, 2024
1 parent 0e6341b commit 074a1c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 3 additions & 4 deletions src/base_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,9 @@ def on_validation_epoch_end(self):
self.log(f'val/{metric}', mean, on_epoch=True, on_step=False)
# Report the averages to ray/tune for hparam optimization.
if self.enable_tune:
train.report({
f'val/{metric}': mean
for metric, mean in avgs.items()
})
train.report(
{f'val/{metric}': mean
for metric, mean in avgs.items()})

def configure_optimizers(self) -> OptimizerLRScheduler:
optimizer = optim.Adam(self.trainable_parameters(),
Expand Down
4 changes: 2 additions & 2 deletions src/dataset/grasp_and_lift_eeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ def load_from_bin(self,

def download(self, root: str):
zip_path = os.path.join(root, 'grasp-and-lift-eeg-detection.zip')
if not os.path.exists(zip_path) or os.path.getsize(
zip_path) != self.ZIP_SIZE_BYTES:
if not os.path.exists(
zip_path) or os.path.getsize(zip_path) != self.ZIP_SIZE_BYTES:
print(f'\nDownloading from {self.ZIP_URL}')
start = time.time()
r = requests.get(self.ZIP_URL)
Expand Down
7 changes: 3 additions & 4 deletions src/neural_gbuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ def training_step(self, batch, batch_idx):
recons = self.model(*labels)
train_loss = self.model.loss_function(
recons, orig, **self.params.get('loss_params', {}))
self.logger.experiment.log({
key: val.item()
for key, val in train_loss.items()
})
self.logger.experiment.log(
{key: val.item()
for key, val in train_loss.items()})
if self.global_step > 0:
for plot, val_indices in zip(self.plots, self.val_indices):
if self.global_step % plot['sample_every_n_steps'] == 0:
Expand Down

0 comments on commit 074a1c9

Please sign in to comment.