Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion LION/optimizers/EquivariantSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def rotation_group(cardinality: int):
assert 360 % cardinality == 0
angle_increment = 360 / cardinality

return [lambda x: TF.rotate(x, i * angle_increment) for i in range(cardinality)]
return [
lambda x, i=i: TF.rotate(x, i * angle_increment) for i in range(cardinality)
]

@staticmethod
def default_parameters() -> LIONParameter:
Expand Down
2 changes: 1 addition & 1 deletion LION/optimizers/GaussianDenoiserSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def validate(self):
outputs = self.model(y)
validation_loss = np.append(
validation_loss,
self.validation_fn(y.to(self.device), outputs.to(self.device))
self.validation_fn(outputs.to(self.device), data.to(self.device))
.cpu()
.numpy(),
)
Expand Down
5 changes: 3 additions & 2 deletions LION/optimizers/LIONsolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def __check_attribute(
warnings.warn(f"Attribute {attr} is not callable")
return 2
# just standrad type chekcking, error or warn, depends of settings
elif isinstance(getattr(self, attr), type):
elif not isinstance(getattr(self, attr), expected_type):
if error:
raise ValueError(
f"Attribute {attr} is not of type {expected_type}, its {type(getattr(self, attr))}"
Expand Down Expand Up @@ -599,7 +599,8 @@ def test(self):
data = fdk(data, self.op)
output = self.model(data.to(self.device))
test_loss = np.append(
test_loss, self.testing_fn(output, target.to(self.device))
test_loss,
self.testing_fn(output, target.to(self.device)).cpu().numpy(),
)

if self.verbose:
Expand Down
Loading