From 2431b9cf06746e111df07e040cf24203cd645c5f Mon Sep 17 00:00:00 2001 From: jdcpni Date: Wed, 8 Dec 2021 20:32:50 -0500 Subject: [PATCH] - --- docs/source/OptimizationControlMechanism.rst | 2 +- .../control/optimizationcontrolmechanism.py | 26 +++++++++---------- psyneulink/core/compositions/composition.py | 5 ++-- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/source/OptimizationControlMechanism.rst b/docs/source/OptimizationControlMechanism.rst index cb9f824d175..371812fb1a6 100644 --- a/docs/source/OptimizationControlMechanism.rst +++ b/docs/source/OptimizationControlMechanism.rst @@ -4,4 +4,4 @@ OptimizationControlMechanism .. automodule:: psyneulink.core.components.mechanisms.modulatory.control.optimizationcontrolmechanism :members: :private-members: - :exclude-members: Linear, random, Parameters + :exclude-members: Linear, random, Parameters, OptimizationControlMechanismError diff --git a/psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py b/psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py index b6e7bc670ff..7b3827613e4 100644 --- a/psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py +++ b/psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py @@ -9,7 +9,7 @@ # ************************************** OptimizationControlMechanism ************************************************* # FIX: REWORK WITH REFERENCES TO `outcome ` -# INTRODUCE SIMULATION INTO DISCUSSION OF COMPOSITOIN-BASED +# INTRODUCE SIMULATION INTO DISCUSSION OF COMPOSITION-BASED """ @@ -446,7 +446,7 @@ *State* ~~~~~~~ -The current state of the OptimizationControlMechanism -- or, more properly, its ` +The current state of the OptimizationControlMechanism -- or, more properly, its `agent_rep ` -- is determined by the OptimizationControlMechanism's current `state_feature_values ` (see `below `) and `control_allocation `. @@ -460,7 +460,7 @@ *Input* ^^^^^^^ -An OptimizationControlMechanism has two types of `input_ports < `, corresponding to the two +An OptimizationControlMechanism has two types of `input_ports `, corresponding to the two forms of input it requires: `state_input_ports ` that provide the values of the Components specified as its `state_features `, and that are used as inputs to the `agent_rep ` when its `evaluate ` method @@ -697,7 +697,7 @@ ^^^^^^^^ The output of OptimizationControlMechanism are its `control_signals ` that implement -the `control_allocations ` it evaluates and optimizes. These their effects are +the `control_allocations ` it evaluates and optimizes. These their effects are estimated over variation in the values of Components with random variables, then the OptimizationControlMechanism's `control_signals ` include an additional *RANDOMIZATION_CONTROL_SIGNAL* that implements that variablity for the relevant Components, as described below. @@ -985,9 +985,9 @@ class OptimizationControlMechanism(ControlMechanism): (see `agent_rep ` for additional details). It can also be a `CompositionFunctionApproximator`, or subclass of one, used for `model-free ` optimization. If **agent_rep** is not specified, the - OptimizationControlMechanism is placed in `deferred_init` status until it is assigned as the `controller - ` of a Composition, at which time that Composition is assigned as the `agent_rep - `. + OptimizationControlMechanism is placed in `deferred_init ` status until it is assigned + as the `controller ` of a Composition, at which time that Composition is assigned as + the `agent_rep `. num_estimates : int : 1 specifies the number independent runs of `agent_rep ` used @@ -997,11 +997,11 @@ class OptimizationControlMechanism(ControlMechanism): random_variables : Parameter or list[Parameter] : default ALL specifies the Components with random variables to be randomized over different estimates - of each `control_allocation `; these - must be in the `agent_rep ` and have a `seed` `Parameter`. - but all Parameters. By default, all such Components in the `agent_rep ` - are included (listed in its `random_variables ` attribute); see - `random_variables ` for additional details. + of each `control_allocation `; these must be in the `agent_rep + ` and have a `seed` `Parameter`. By default, all such Components in + the `agent_rep ` (listed in its `random_variables + ` attribute) are included (see `random_variables + ` for additional information). initial_seed : int : default None specifies the seed used to initialize the random number generator at construction. @@ -1066,7 +1066,7 @@ class OptimizationControlMechanism(ControlMechanism): state_feature_values : 2d array the current value of each item of the OptimizationControlMechanism's - `OptimizationControlMechanism_State_Features>` (each of which is a 1d array). + `OptimizationControlMechanism_State_Features` (each of which is a 1d array). state_input_ports : ContentAddressableList lists the OptimizationControlMechanism's `InputPorts ` that receive `Projections ` diff --git a/psyneulink/core/compositions/composition.py b/psyneulink/core/compositions/composition.py index 7e14d2191ad..3d564252b0e 100644 --- a/psyneulink/core/compositions/composition.py +++ b/psyneulink/core/compositions/composition.py @@ -3052,7 +3052,8 @@ class Composition(Composition_Base, metaclass=ComponentsMeta): list of Mechanisms in Composition, that provides access to some of they key attributes. random_variables : list[Component] - list of Components in Composition with variables that call a randomization function + list of Components in Composition with variables that call a randomization function. + .. technical_note:: These are Components with a seed `Parameter`. @@ -10374,7 +10375,7 @@ def stateful_parameters(self): @property def random_variables(self): - """Return Components with seed Parameters (that is, ones that that call a randomization function.""" + """Return list of Components with seed Parameters (i.e., ones that that call a random function).""" return [param._owner._owner for param in self.all_dependent_parameters('seed').keys()] @property