Home | Trees | Indices | Help |
---|
|
object --+ | InformationAlgorithm
Algorithms that produce information about their run. Implementing classes should update the INFO_PROVIDED class variable with the information provided by the algorithm. Defauls to an empty list. ALL algorithms that inherit from InformationAlgorithm MUST add force_reset as a decorator to the run method. Fields ------ info_ret : Dictionary. The algorithm outputs are collected in this dictionary. info : List of utils.Info. The identifiers for the requested information outputs. The algorithms will store the requested outputs in self.info. INFO_PROVIDED : List of utils.Info. The allowed output identifiers. The implementing class should update this list with the provided/allowed outputs. Examples -------- >>> import parsimony.algorithms as algorithms >>> from parsimony.algorithms.utils import Info >>> from parsimony.functions.losses import LinearRegression >>> import numpy as np >>> np.random.seed(42) >>> gd = algorithms.gradient.GradientDescent(info=[Info.fvalue]) >>> gd.info_copy() ['fvalue'] >>> lr = LinearRegression(X=np.random.rand(10,15), y=np.random.rand(10,1)) >>> beta = gd.run(lr, np.random.rand(15, 1)) >>> fvalue = gd.info_get(Info.fvalue) >>> round(fvalue[0], 10) 0.068510926 >>> round(fvalue[-1], 15) 1.886e-12
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
INFO_PROVIDED =
|
|
|||
Inherited from |
|
Parameters ---------- info : List or tuple of utils.Info. The identifiers for the run information to return.
|
Returns the computed information about the algorithm run. Parameters ---------- nfo : utils.Info. The identifier to return information about. If nfo is None, all information is returned in a dictionary. |
Sets the computed information about the algorithm run identified by nfo. Parameters ---------- nfo : utils.Info. The identifier to for the computed information about. value : object. The value to associate with nfo. |
Resets the information saved in the previous run. The info_ret field, a dictionary, is cleared. |
Check if the requested information is provided. Parameters ---------- info : A list of utils.Info. The identifiers for information that should be computed. |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Apr 6 23:52:10 2015 | http://epydoc.sourceforge.net |