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

Add docstrings to state and stats #657

Merged
merged 8 commits into from
Jan 6, 2024
Merged

Add docstrings to state and stats #657

merged 8 commits into from
Jan 6, 2024

Conversation

Vaibhavdixit02
Copy link
Member

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

Copy link

codecov bot commented Jan 5, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (31e2dbe) 8.93% compared to head (35b97e5) 8.93%.

Files Patch % Lines
lib/OptimizationFlux/src/OptimizationFlux.jl 0.00% 3 Missing ⚠️
lib/OptimizationBBO/src/OptimizationBBO.jl 0.00% 1 Missing ⚠️
...onStrategy/src/OptimizationCMAEvolutionStrategy.jl 0.00% 1 Missing ⚠️
lib/OptimizationMOI/src/nlp.jl 0.00% 1 Missing ⚠️
lib/OptimizationOptimJL/src/OptimizationOptimJL.jl 66.66% 1 Missing ⚠️
lib/OptimizationOptimisers/src/sophia.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #657   +/-   ##
======================================
  Coverage    8.93%   8.93%           
======================================
  Files          31      31           
  Lines        2506    2506           
======================================
  Hits          224     224           
  Misses       2282    2282           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- `objective`: current objective value
- `gradient`: current gradient
- `hessian`: current hessian
- `solver_state`: if the solver has its own state object then it is stored here
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `solver_state`: if the solver has its own state object then it is stored here
- `original`: if the solver has its own state object then it is stored here

for uniformity.

and is passed to the callback function as the first argument.

## Fields
- `iteration`: current iteration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `iteration`: current iteration
- `iter`: current iteration

Comment on lines +40 to +41
- `gradient`: current gradient
- `hessian`: current hessian
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `gradient`: current gradient
- `hessian`: current hessian
- `gradient`: current gradient
- `hessian`: current hessian

grad, hes

Make the naming match everything else, we can't just have one thing different.

@@ -117,7 +117,7 @@ function SciMLBase.__solve(cache::Optimization.OptimizationCache{
else
n_steps = BlackBoxOptim.num_steps(trace)
curr_u = decompose_trace(trace, cache.progress)
opt_state = Optimization.OptimizationState(iteration = n_steps, u = curr_u, objective = x[1], solver_state = trace)
opt_state = Optimization.OptimizationState(; iteration = n_steps, u = curr_u, objective = x[1], original = trace)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and iter?

@Vaibhavdixit02 Vaibhavdixit02 merged commit a2ea13c into master Jan 6, 2024
44 checks passed
@Vaibhavdixit02 Vaibhavdixit02 deleted the statsstatedocs branch January 6, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants