-
Notifications
You must be signed in to change notification settings - Fork 15
Description
System setup
OS: [e.g] macOS v10.14.1
Python version: [e.g.] v3.6.7
Python environment (if any): [e.g.] conda v4.5.11
Describe the bug
Currently, FISTA and POGM algorithms seem to converge in a single iteration.
The reason being that we have added a comma for python style guide:
ModOpt/modopt/opt/algorithms.py
Lines 1548 to 1552 in 616c9e7
| if self._cost_func: | |
| self.converge = ( | |
| self.any_convergence_flag() | |
| or self._cost_func.get_cost(self._x_new), | |
| ) |
ModOpt/modopt/opt/algorithms.py
Lines 789 to 793 in 616c9e7
| if self._cost_func: | |
| self.converge = ( | |
| self.any_convergence_flag() | |
| or self._cost_func.get_cost(self._x_new), | |
| ) |
These make self.converge into a tuple, i.e. (False,)!
Due to this, the check for convergence later here :
ModOpt/modopt/opt/algorithms.py
Lines 317 to 320 in 616c9e7
| if self.converge: | |
| if self.verbose: | |
| print(' - Converged!') | |
| break |
Becomes true and the code ends.
We need to remove the commas from the above lines.
Also @sfarrens can we keep this issue to add tests for this? It seems like a very important bug that we should have not missed.
Are you planning to submit a Pull Request?
- Yes
- No