diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2019-03-14 11:48:31 +0000 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2019-03-14 11:48:31 +0000 |
commit | 9080a553104e466da8d38024df141a298408677a (patch) | |
tree | ca792c6218a72ae4a81497d31a647d06078f5bef /README.md | |
parent | 2101861fa2075fa12abb0f0d4dcccd64e15c1853 (diff) | |
parent | b6c6f1187a6c337698401f348c938d6b6dfb29fd (diff) | |
download | framework-9080a553104e466da8d38024df141a298408677a.tar.gz framework-9080a553104e466da8d38024df141a298408677a.tar.bz2 framework-9080a553104e466da8d38024df141a298408677a.tar.xz framework-9080a553104e466da8d38024df141a298408677a.zip |
Merge branch 'composite_operator_datacontainer' of https://github.com/vais-ral/CCPi-Framework into composite_operator_datacontainer
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 26 |
1 files changed, 22 insertions, 4 deletions
@@ -63,7 +63,7 @@ In `ccpi.framework` we define a number of common classes normally used in tomogr * `Operator`: A class specifying a (currently linear) operator * `Function`: A class specifying mathematical functions such as a least squares data fidelity. - * `Algorithm`: Implementation of an optimisation algorithm to solve a particular generic optimisation problem. These are currently python functions by may be changed to operators in another release. + * `Algorithm`: Implementation of an iterative optimisation algorithm to solve a particular generic optimisation problem. Algorithms are iterable Python object which can be run in a for loop. Can be stopped and warm restarted. #### `Operator` @@ -87,9 +87,27 @@ In `ccpi.framework` we define a number of common classes normally used in tomogr #### `Algorithm` - A number of generic algorithm implementations are provided including CGLS and FISTA. An algorithm - is designed for a particular generic optimisation problem accepts and number of `function`s and/or - `operator`s as input to define a specific instance of the generic optimisation problem to be solved. + A number of generic algorithm implementations are provided including Gradient Descent CGLS and FISTA. An algorithm + is designed for a particular generic optimisation problem accepts and number of `Function`s and/or + `Operator`s as input to define a specific instance of the generic optimisation problem to be solved. + + They are iterable objects which can be run in a `for` loop. The user can provide a stopping cryterion different than the default max_iteration. + + New algorithms can be easily created by extending the `Algorithm` class. The user is required to implement only 4 methods: `set_up`, `__init__`, `update` and `update_objective`. + + * `set_up` and `__init__` are used to configure the algorithm + * `update` is the actual iteration updating the solution + * `update_objective` defines how the objective is calculated. + + For example, the implementation of the `update` of the Gradient Descent algorithm to minimise a `Function` will only be: + ```python + def update(self): + self.x += -self.rate * self.objective_function.gradient(self.x) + def update_objective(self): + self.loss.append(self.objective_function(self.x)) + ``` + + The `Algorithm` provides the infrastructure to continue iteration, to access the values of the objective function in subsequent iterations, the time for each iteration. #### Examples |