Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated StateLogger #61

Closed
juan43ramirez opened this issue Nov 5, 2022 · 1 comment
Closed

Deprecated StateLogger #61

juan43ramirez opened this issue Nov 5, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@juan43ramirez
Copy link
Collaborator

juan43ramirez commented Nov 5, 2022

Bug

The StateLogger in cooper.utils.state_logger.py is not compatible with the latest version of Cooper's dev branch.

It assumes that a Formulation will have a ConstrainedMinimizationProblem as an attribute:

for metric in self.save_metrics:
if metric == "loss":
aux_dict[metric] = formulation.cmp.state.loss.item()
elif metric == "ineq_defect":
aux_dict[metric] = deepcopy(formulation.cmp.state.ineq_defect.data)
elif metric == "eq_defect":
aux_dict[metric] = deepcopy(formulation.cmp.state.eq_defect.data)

This is not the case since merging #56.

Steps

Update the interface of StateLogger. store_metrics should receive a CMPState or the unpacked metrics.

@juan43ramirez juan43ramirez added the bug Something isn't working label Nov 5, 2022
@gallego-posada
Copy link
Collaborator

Closed by #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants