ScalarMult¶
-
class
pycalib.gp_classes.
ScalarMult
(alpha=1)[source]¶ Bases:
gpflow.mean_functions.MeanFunction
Scalar multiplication mean function.
\(y_i = \alpha x_i\)
Attributes Summary
TensorFlow feed dictionary for passing to tf.Session.run()
TensorFlow graph property.
Feed dictionary which will be used along with initializables list at initialize function.
List of TensorFlow tensors which must be initialized.
The name assigned to node at creation time.
Parent for this node.
Path name is a recursive representation parent path name plus the name which was assigned to this object by its parent.
Top of the parentable tree.
Auxilary method for composing gpflow’s tree name scopes.
Method used for defining full path name for particular tensor at build time.
Methods Summary
__call__
(X)Call self as a function.
anchor
(session)The anchor method is intended to bind TensorFlow session values with pythonic values saved by node’s objects.
assign
(values[, session, force])build
()Implementation for ICompilable interface build method.
childname
(child)clear
()Calls _clear abstract method which must be implemented by descendants.
compile
([session])Compile is two phase operation: at first it calls build method and then intializes the node for passed session.
enquire_graph
([graph])Verifies and returns relevant TensorFlow graph.
enquire_session
([session])Verifies and returns relevant TensorFlow session.
fix_shape
([parameters, data_holders])initialize
([session, force])Initializes TensorFlow variables, which are returned by initializables property and uses feed dictionary returned by initializable_feeds property defined at ICompilable interface and implemented by descendants.
is_built
(graph)Checks if tensors belonging to this ICompilable object were built for the graph argument.
is_built_coherence
([graph])Checks that node was build using input graph.
read_trainables
([session])read_values
([session])reset_name
([name])set_trainable
(value)Attributes Documentation
-
data_holders
¶
-
empty
¶
-
feeds
¶ TensorFlow feed dictionary for passing to tf.Session.run()
- Returns
TensorFlow feed dictionary or None.
-
graph
¶ TensorFlow graph property.
- Returns
tf.Graph which was used during building.
-
index
¶
-
initializable_feeds
¶ Feed dictionary which will be used along with initializables list at initialize function.
- Returns
Standard TensorFlow feed dictionary which must be used at at initialization.
-
initializables
¶ List of TensorFlow tensors which must be initialized. This list is necessary for successfull _initialize_ call.
- Returns
List of TensorFlow variables, data iterators or both, which are capable to be initialized.
-
name
¶ The name assigned to node at creation time. It can be referred also as original name.
- Returns
Given name.
-
parameters
¶
-
params
¶
-
parent
¶ Parent for this node. :return: Reference to parent object.
-
pathname
¶ Path name is a recursive representation parent path name plus the name which was assigned to this object by its parent. In other words, it is stack of parent name where top is always parent’s original name: parent.pathname + parent.childname and stop condition is root’s name.
For example, the pathname of an instance with the two parents may look like parent0/parent1/childname_at_parent1. Top parent’s name equals its original name parent0.name == parent0.pathname.
-
prior_tensor
¶
-
root
¶ Top of the parentable tree. :return: Reference to top parentable object.
-
tf_name_scope
¶ Auxilary method for composing gpflow’s tree name scopes. The Parentable pathname can be considered as a set of name scopes. This method grabs pathname and returns only name of the node in that path. Leading node name is always replaced with two parts: the name and the index for uniquiness in TensorFlow.
-
tf_pathname
¶ Method used for defining full path name for particular tensor at build time. For example, tf.get_variable creates variable w/o taking into account name scopes and tf_pathname consists of all parts of scope names which were used up to that point - tf.get_variable call.
-
trainable
¶
-
trainable_parameters
¶
-
trainable_tensors
¶
Methods Documentation
-
anchor
(session)¶ The anchor method is intended to bind TensorFlow session values with pythonic values saved by node’s objects.
-
as_pandas_table
()¶
-
assign
(values, session=None, force=True)¶
-
build
()¶ Implementation for ICompilable interface build method. Builds tensors within TensorFlow name scope using parentable node’s name. Hidden name is used when no parent exists for current node.
- Raises
GPflowError – Node’s parts were built with different graph and differ from default TensorFlow graph.
-
childname
(child)¶
-
clear
()¶ Calls _clear abstract method which must be implemented by descendants.
- Raises
GPflowError exception when parent of the node is built.
-
compile
(session=None)¶ Compile is two phase operation: at first it calls build method and then intializes the node for passed session. The policy around session is defined inside the initialize method.
- Parameters
session – TensorFlow session used for initializing. If the node is built the session’s graph value must be equal to the node tensor’s graph.
- Raises
GPflowError exception if session’s graph is different from the graph used by node tensors.
-
enquire_graph
(graph=None)¶ Verifies and returns relevant TensorFlow graph. If non-None graph were passed, the same graph is returned. Otherwise, nodes’s graph is exposed and it is undefined the default TensorFlow graph is used.
- Parameters
graph – TensorFlow graph or None. Default is None.
- Returns
TensorFlow graph.
-
enquire_session
(session=None)¶ Verifies and returns relevant TensorFlow session. If non-None session were passed, session is checked for graph compliance and returned back. Otherwise, default TensorFlow session is returned. When TensorFlow default session is not set up, GPflow session’s manager creates or uses existing one for returning.
- Parameters
session – TensorFlow session or None. Default value is None.
- Returns
TensorFlow session.
- Raises
GPflowError – Session’s graph is not compilable with node’s graph.
-
fix_shape
(parameters=True, data_holders=True)¶
-
initialize
(session=None, force=False)¶ Initializes TensorFlow variables, which are returned by initializables property and uses feed dictionary returned by initializable_feeds property defined at ICompilable interface and implemented by descendants.
- Parameters
session – TensorFlow session used for initializing. In case when session is None, default TensorFlow session will be checked first, if session is still None, then default GPflowFlow session will used, but there is no garuantee that GPflow session’s graph is compliant with node’s tensors graph.
force – inidicates either the initialized TensorFlow variables must be re-initialized or not.
- Raises
GPflowError exception if session’s graph is different from the graph used by node tensors.
-
is_built
(graph)¶ Checks if tensors belonging to this ICompilable object were built for the graph argument.
- Parameters
graph – TensorFlow graph.
- Returns
Build status.
-
is_built_coherence
(graph=None)¶ Checks that node was build using input graph.
- Returns
Build status.
- Raises
GPflowError – Valid passed TensorFlow graph is different from used graph in node.
-
read_trainables
(session=None)¶
-
read_values
(session=None)¶
-
reset_name
(name=None)¶
-
set_trainable
(value)¶
-