Package transsys :: Module optim :: Class ParameterTransformer
[hide private]
[frames] | no frames]

Class ParameterTransformer

source code

object --+
         |
        ParameterTransformer

Base class for parameter transformers.

Parameter transformation maps values from the domain ]-Inf, +Inf[ to limited ranges of the real numbers, using TransformationFunctions.

Furthermore, parameter transformers can restrict the set of factors and genes for which optimisation is performed. Notionally, this is equivalent to mapping all values from ]-Inf, +Inf[ to the constant found in the original transsys program.

Notice that the factors and genes to be optimised must be specified by their names, not by references.

This base class implements an identity transformer, i.e. the transformed value of a parameter is just its actual value.

Technical note: Restriction of parameters that are subjected to optimisation is not implemented by clamping them to a constant value but by hiding the parameters of elements excluded from optimisation from the optimiser altogether. Effectively, this reduces the dimensionality of the search space and therefore, it is much preferable from the notionally equivalent clamping. From this perspective, the ParameterTransformer class currently combines the functions of transforming and selecting parameters, and the optimisation framework may in the future be changed to implement these separate function in separate classes.

This design change should not effect high level users of ParameterTransformer and its subclasses as the factor and gene lists are normally received through the optimise methods of AbstractOptimiser subclasses, and this interface will not be affected by the design change.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
str(x)
source code
 
check_savefile_magic(self, s) source code
 
parse_variables(self, f) source code
 
parse(self, f) source code
 
setTranssysProgram(self, transsys_program, factor_name_list, gene_name_list)
Set the transsys program on which the transformer is to operate.
source code
 
clipParameters(self)
Clip the parameters in transsys_program to the range required by the respective transformer.
source code
 
randomiseParametersUniform(self, parameterRange, rng)
Randomise the numeric values in transsys_program.
source code
 
getParameters(self)
Get numeric parameters from the transsys_program, converted to the unconstrained optimiser space.
source code
 
setParameters(self, parameter_list)
Set parameters in transsys_program according to the optimiser space values provided by parameter_list.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Class Variables [hide private]
  savefile_magic = 'ParameterTransformer'
Instance Variables [hide private]
list of strings factor_name_list
list of names of factors for which parameters are to be optimised
list of strings gene_name_list
list of names of genes for which parameters are to be optimised
list of ExpressionNodeValue target_node_list
list of expression nodes holding the values subject to optimisation
TranssysProgram transsys_program
the transsys program
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

setTranssysProgram(self, transsys_program, factor_name_list, gene_name_list)

source code 

Set the transsys program on which the transformer is to operate.

Passing None as factor name list selects all factor-related parameters for optimisation, and likewise, passing None as gene name list selects all gene-related parameters for optimisation.

Parameters:
  • transsys_program (TranssysProgram) - the transsys program
  • factor_name_list (list of strings, or None) - factors for which parameters are to be optimised
  • gene_name_list (list of strings, or None) - genes for which parameters are to be optimised

randomiseParametersUniform(self, parameterRange, rng)

source code 

Randomise the numeric values in transsys_program.

Random values are drawn from a uniform distribution over [-parameterRange, parameterRange[ and the numeric values are set to the corresponding transformed values.

setParameters(self, parameter_list)

source code 

Set parameters in transsys_program according to the optimiser space values provided by parameter_list.

This base class implementation does not do any transformation, so it should be overridden by subclasses.