Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
jdcpni committed Dec 9, 2021
1 parent b8d32a2 commit 2431b9c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/source/OptimizationControlMechanism.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# ************************************** OptimizationControlMechanism *************************************************

# FIX: REWORK WITH REFERENCES TO `outcome <OptimizationControlMechanism.outcome>`
# INTRODUCE SIMULATION INTO DISCUSSION OF COMPOSITOIN-BASED
# INTRODUCE SIMULATION INTO DISCUSSION OF COMPOSITION-BASED


"""
Expand Down Expand Up @@ -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
<OptimizationControlMechanism.agent_rep>` -- is determined by the OptimizationControlMechanism's current
`state_feature_values <OptimizationControlMechanism.state_feature_values>` (see `below
<OptimizationControlMechanism_State_Features>`) and `control_allocation <ControlMechanism.control_allocation>`.
Expand All @@ -460,7 +460,7 @@
*Input*
^^^^^^^
An OptimizationControlMechanism has two types of `input_ports < <Mechanism_Base.input_ports>`, corresponding to the two
An OptimizationControlMechanism has two types of `input_ports <Mechanism_Base.input_ports>`, corresponding to the two
forms of input it requires: `state_input_ports <OptimizationControlMechanism.state_input_ports>` that provide the values
of the Components specified as its `state_features <OptimizationControlMechanism_State_Features_Arg>`, and that are used
as inputs to the `agent_rep <OptimizationControlMechanism.agent_rep>` when its `evaluate <Composition.evaluate>` method
Expand Down Expand Up @@ -697,7 +697,7 @@
^^^^^^^^
The output of OptimizationControlMechanism are its `control_signals <ControlMechanism.control_signals>` that implement
the `control_allocations <ControlMechanism.control_allocations>` it evaluates and optimizes. These their effects are
the `control_allocations <ControlMechanism.control_allocation>` 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 <ControlMechanism.control_signals>` include an additional *RANDOMIZATION_CONTROL_SIGNAL* that
implements that variablity for the relevant Components, as described below.
Expand Down Expand Up @@ -985,9 +985,9 @@ class OptimizationControlMechanism(ControlMechanism):
(see `agent_rep <OptimizationControlMechanism_Agent_Rep_Arg>` for additional details). It can also be a
`CompositionFunctionApproximator`, or subclass of one, used for `model-free
<OptimizationControlMechanism_Model_Free>` optimization. If **agent_rep** is not specified, the
OptimizationControlMechanism is placed in `deferred_init` status until it is assigned as the `controller
<Composition.controller>` of a Composition, at which time that Composition is assigned as the `agent_rep
<agent_rep <OptimizationControlMechanism.agent_rep>`.
OptimizationControlMechanism is placed in `deferred_init <Component_Deferred_Init>` status until it is assigned
as the `controller <Composition.controller>` of a Composition, at which time that Composition is assigned as
the `agent_rep <OptimizationControlMechanism.agent_rep>`.
num_estimates : int : 1
specifies the number independent runs of `agent_rep <OptimizationControlMechanism.agent_rep>` used
Expand All @@ -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 <OptimizationControlMechanism.control_allocation>`; these
must be in the `agent_rep <OptimizationControlMechanism.agent_rep>` and have a `seed` `Parameter`.
but all Parameters. By default, all such Components in the `agent_rep <OptimizationControlMechanism.agent_rep>`
are included (listed in its `random_variables <Composition.random_variables>` attribute); see
`random_variables <OptimizationControlMechanism.random_variables>` for additional details.
of each `control_allocation <ControlMechanism.control_allocation>`; these must be in the `agent_rep
<OptimizationControlMechanism.agent_rep>` and have a `seed` `Parameter`. By default, all such Components in
the `agent_rep <OptimizationControlMechanism.agent_rep>` (listed in its `random_variables
<Composition.random_variables>` attribute) are included (see `random_variables
<OptimizationControlMechanism.random_variables>` for additional information).
initial_seed : int : default None
specifies the seed used to initialize the random number generator at construction.
Expand Down Expand Up @@ -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 <InputPort>` that receive `Projections <Projection>`
Expand Down
5 changes: 3 additions & 2 deletions psyneulink/core/compositions/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2431b9c

Please sign in to comment.