Skip to content

Commit

Permalink
Feat/control signal/add control arg (#2272)
Browse files Browse the repository at this point in the history
* • optimizationcontrolmechanism.py:
  added feature_input_ports attribute and num_feature_input_ports property

* • optimizationcontrolmechanism.py:
  added feature_input_ports attribute and num_feature_input_ports property

• parameterestimationcomposition.py: fixed misplacement of its Parameters() attribute

* • optimizationcontrolmechanism.py:
  added feature_input_ports attribute and num_feature_input_ports property

• parameterestimationcomposition.py: fixed misplacement of its Parameters() attribute

• optimizationfunctions.py: made num_estimates a Parameter

* - modified test_mode_based_num_estimates

* -

* -

* • optimizationcontrolmechanism.py:
  - _instantiate_control_signals: random_seeds -> random_seed_mod_values

* • composition.py
  - _add_controller:  modifying to instantiate feature_input_ports if none are specified

* • composition.py:
  - add_controller:  now adds feature_input_ports for Compostion INPUT nodes if not state_features not specified

* -

* • composition.py
  - _add_controller:  modifying to instantiate feature_input_ports if none are specified

* • composition.py:
  - add_controller:  assign simulation_input_ports

* -

* • optimizationcontrolmechanism.py:
  - feature_input_ports -> state_input_ports
  - _instantiate_input_ports():
      state_features only allowed to specifying state_input_ports if
      agent_rep is a CompositionFunctionApproximator (i.e., model-free optimization)

• composition.py:
  - add_controller: adds state_input_ports to shadow INPUT Nodes of Composition
    if controller.agent_rep is Composition (model-based optimziation)
    or state_features have not been specified (for model-free optimizaton)

* -

* • optimizationcontrolmechanism.py:
  _instantiate_input_ports:
     reinstate allowance of state_features specification if agent_rep is a Composition
     (i.e., model-based optimization) as long as they are all INPUT Nodes of agent_rep

* -

* -

* • optimizationcontrolmechanism.py
  - _gen_llvm_evaluate_function: num_estimates -> num_estimates_per_trial

* -

* • optimizationcontrolmechanism.py
  - _gen_llvm_evaluate_function: num_estimates -> num_trial_per_estimate

* • optimizationcontrolmechanism.py
  - _gen_llvm_evaluate_function: num_estimates -> num_trials_per_estimate

* -

* -

* -

* -

* • composition.py
  - __init__: moved controller instantiation until after nodes, projections and pathways

* • composition.py
  - __init__: restored add_controller position

* llvm/struct generation: Make sure num_estimats per trial is always integer

Signed-off-by: Jan Vesely <[email protected]>

* -

* • composition.py:
  - _update_controller: added
  - add_controller and _analyze_graph(): call _update_controller

* -

* • composition.py
  _update_controller:  fixed to loop through all input_ports of comp INPUT nodes

* • test_control.py
  - test_agent_rep_assignement_as_controller_and_replacement:
      updated to test that shadowing projections to state_input_ports
      are properly added and deleted

* • optimizationfunctions.py:
  - _function: refactored to put use aggregation_function at end
  - _grid_evaluate:  still needs to return all_samples

* -

* • composition.py
  - added call to _update_controller to add_node
  - moved test for projections to controller.state_input_ports to run()

* -

* • composition.py:
  moved calls to _update_controller to _complete_init_of_partially_initialized_nodes
  moved _update_controller to ocm._update_state_input_ports

• optimizationcontrolmechanism.py:
  added _update_state_input_ports [**still needed work**]

* • composition.py:
  moved calls to _update_controller to _complete_init_of_partially_initialized_nodes
  moved _update_controller to ocm._update_state_input_ports
  _instantiate_controller_shadow_projections [still needs to be implemented]

• optimizationcontrolmechanism.py:
  added _update_state_input_ports [**still needed work**]

* • composition.py
  added needs_update_controller

* -

* • composition.py:
  - implemented self.needs_update_controller
  - moved implementation of controlsignal projections
    from add_controller to _instantiate_control_projections
    that is called in _complete_init_of_partially_initialized_nodes

Note: still need to set  self.needs_update_controller to False
      after instantiating state_input_ports and projections to them

* -

* -

* -

* -

* -

* -

* -

* -

* • Passing all test_control tests except test_mode_based_num_estimates

* • Passing all test_control tests

* -

* • optimizationcontrolmechanism.py
  - _update_state_input_ports_for_controller: handle nested input nodes

* -

* • optimizationcontrolmechanism.py
  _update_state_input_ports_for_controller:  fixed bug with > 1 INPUT node in Composition

* • test_show_graph.py: passes all tests

* -

* • test_report.py:  passing all tests

* • Passes all tests!

* -

* -

* • composition.py: reorganize with #region and #enregions

* • composition.py: reorganize with #region and #enregions

* • controlmechanism.py, optimizationcontrolmechanism.py:
  - _instantiate_monitor_for_control_input_ports -> _parse_monitor_control_input_ports
  - refactored to support allow_probes option on ocm

* -

* -

* -

* • controlmechanism.py, optimizationcontrolmechanism.py:
  - _instantiate_monitor_for_control_input_ports -> _parse_monitor_control_input_ports
  - refactored to support allow_probes option on ocm

* • controlmechanism.py, optimizationcontrolmechanism.py:
  - _instantiate_monitor_for_control_input_ports -> _parse_monitor_control_input_ports
  - refactored to support allow_probes option on ocm

* -

* • composition.py:
  __init__: move controller to after add_nodes and add_linear_pathway

* -

* - test_control: only test_hanging_control_spec_outer_controller not passing

* -

* -

* -

* -

* -

* -

* • composition.py:
  _instantiate_control_projections:
     weird requirement for double-call to controller._instantiate_control_signal

* • test_paremtercomposition.py:
  restored parameter spec that causes crash ('threshold',Decision2)

* ª Attempt to fix problem with partially overlapping local and ocm control specs

- composition.py
  - _get_control_signals_for_composition:  (see 11/20/21)
      - added (but commented out change) to "if node.controller" to "if not node.controller"
      - changed append to extend
  - _instantiation_control_projection:
      - got rid of try and except double-call to controller._instantiate_control_signals
      -  outdented call to self.controller._activate_projections_for_composition at end

- controlmechanism.py:
    - _check_for_duplicates:  add warning and return duplicates

- optimizationcontrolmechanism._instantiate_control_signals:
    - add call to self.agent_rep._get_control_signals_for_composition() to get local control specs (on mechs in comp)
    - eliminate duplicates with control_signal specs on OCM
    - instantiate local + ocm control_signals

- parameterestimationcomposition.py
  - added context to various calls

* see later commit

* see later commit

* see later commit

* see later commit

* - This branch passes all tests except:
   - test_parameterestimationcomposition
   - test_composition/test_partially_overlapping_control_specs (ADDED IN THIS COMMINT)

- All relevant changes to this branch are marked as "11/21/21."
  However, most are commented out as they break other things.

- The tests above both involve local control specifications (on mechanism within a nested comp)
  and on the OCM for the outer composition, some of which are for the same nested mechs

- Both tests fail with:
   "AttributeError: 'NoneType' object has no attribute '_get_by_time_scale'" (in component.py LINE 3276)
   This may be due to a problem with context setting, since the error is because the modulation Parameter
   of the ControlProjection is returning "None" rather than "multiplicative_param" (when called with get(context)),
   whereas "multiplicative_param" is returned with a call to get() (i.e., with no context specified)

- Most of test_partially_overlapping_control_specs is passed if
   changes marked "11/21/21 NEW" in optimizationcontrolmechanism.py (LINE 1390) are implemented,
   but it does not properly route ControlProjections through parameter_CIMS (see last assert in test).
   Furthermore, test_parameterestimationcompsition fails with the mod param error, even though the
   model has similar structure (i.e., outer composition -- in this case a ParameterEstimationComposition)
   with an OCM that is given control specs that overlap with ones in a nested composition.

- There are also several other things in composition I found puzzling and tried modifying, but that cuased failures:
  - _get_control_signals_for_composition():
      - seems "if node.controller" should be "if **not** node.controller" (emphasis added just for comment)
      - "append" should be "extend"
  - _instantiate_control_projection():
      -  call to self.controller._activate_projections_for_composition (at end of method) should not be indented

* - small mods; don't impact anything relevant to prior commit message

* - small mods; don't impact anything relevant to prior commit message

* - small mods; don't impact anything relevant to prior commit message

* - finished adding formatting regions to composition.py

* -

* • composition.py:
  - rename _check_projection_initialization_status -> _check_controller_initialization_status
  - add _check_nodes_initialization_status(context=context)
    (and calls it with _check_controller_initialization_status)

* • show_graph.py:  addressed bug associated with ocm.allow_direct_probe

* • show_graph.py:  addressed bug associated with ocm.allow_direct_probe

* -

* Composition: add_controller: set METHOD as context source early

* -

* • composition.py
  retore append of control_signals in _instantiate_control_projections()

* • composition.py
  restore append of control_signals in _instantiate_control_projections()

• test_composition.py:
  add test_partially_overlapping_local_and_control_mech_control_specs_in_unnested_and_nested_comp

* • test_partially_overlapping_local_and_control_mech_control_specs_in_unnested_and_nested_comp():
  - added clear_registry() to allow names to be reused in both runs of test

* • composition.py
  docstring:  added projections entry to list of attributes
  - add_controller:  added call to _add_node_aux_components() for controller

* • composition.py
  _add_node_aux_components(): added deletion of item from aux_components if instantiated

* • composition.py
  - comment out _add_node_aux_components() (causing new failures)
  - move _instantiate_control_projections to be with _instantiate_control_projections,
       after self.add_node(self.controller.objective_mechanism (to be more orderly)

* -

* - confirm that it passes all tests exception test_composition/test_partially_overlapping...
  (with addition of _add_aux_components in add_controller commented out)

* • composition.py:  some more fixed to add_controller that now fail only one test:
    - test_agent_rep_assignement_as_controller_and_replacement

* • Passes *all* current tests

* • composition.py:
  - add_controller:  few more minor mods;
  still passes all tests

* -

* -

* -

* • controlmechanism.py:
  - __init__: resrict specification to only one of control, modulatory_signals, or control_signals (synonyms)

* -

* • composition.py:  in progress fix of bug in instantiating shadow projections for ocm.state_input_ports

* • composition.py:
  - _get_original_senders():  added support for nested composition
    needs to be checked for more than one level
    needs to be refactored to be recursive

* • optimizationcontrolmechanism.py
  - _update_state_input_ports_for_controller:  fix invalid_state_features to allow input_CIM of nested comp in agent_rep

* -

* • composition.py
 - _get_original_senders: made recursive

* • test_show_graph.py: update for fixes

* -

* • tests:  passes all in test_show_graph.py and test_report.py

* Passes all tests

* - comment clean-up

* • composition.py
 - add_controller and _get_nested_node_CIM_port:
   added support for forced assignment of NodeRole.OUTPUT for nodes specified in OCM.monitor_for_control,
   but referenced 'allow_probes' attribute still needs to be implemented

* • composition.py, optimizationcontrolmechanism.py:
  allow_probes fully implemented

* • show_graph.py:  fixed bug causing extra projections to OCM

* • composition.py:
  - _update_shadow_projections(): fix handling of deep nesting

* • optimizationcontrolmechanism.py: add agent_rep_type property

* • optimizationcontrolmechanism.py:
  - state_feature_function -> state_feature_functions

* • optimizationcontrolmechanism.py:
  - _validate_params:  validate state_feature_functions
  - _update_state_input_ports_for_controller: implement assignment of state_feature_functions

* -

* -

* • Passes all tests except test_json with 'model_with_control'

* -

* • composition.py
  - add_projection:  delete instantiation of shadow projections (handled by _update_shadow_projections)

* • composition.py
  - add_projection:  delete instantiation of shadow projections (handled by _update_shadow_projections)
  - remove calls to _update_shadows_dict

* • composition.py
  - add_projection:  delete instantiation of shadow projections (handled by _update_shadow_projections)
  - remove calls to _update_shadows_dict

* -

* • test_two_origins_two_input_ports:  crashes on failure of C->B to update

* -

* • composition.py
  - added property shadowing_dict that has shadowing ports as keys and the ports they shadow as values
  - refactored _update_shadowing_projections to use shadowing_dict

* • optimizationcontrolmechanism.py
  - _update_state_input_ports:  modified validations for nested nodes;  still failing some tests

* • optimizationcontrolmechanism.py
  - _update_state_input_ports:
     more careful and informative validation that state_input_ports are in comp or nested comp and are INPUT nodes thereof;
     passes all tests except test_two_origins_two_input_ports as before

* • composition.py
  _get_invalid_aux_components():  defer all shadow projections until _update_shadow_projections

* • composition.py
  _get_invalid_aux_components():  bug fix in test for shadow projections

* Port: _remove_projection_to_port: don't reduce variable below length 1

even ports with no incoming projections have variable at least length 1

* • composition.py
  add_node(): marked (but haven't removed) code block instantiating shadow_projections
   that seems now to be redundant with _update_shadow_projection

* • show_graph.py
  - _assign_cim_components: supress showing projections not in composition

* • composition.py:
  _analyze_graph():  add extra call to _determine_node_roles after _update_shadow_projections
  _run():  moved block of code at beginning initializing scheduler to after
           _complete_init_of_partially_initialized_nodes and _analyze_graph()

• show_graph.py
  - add test to all loops on projections:  "if proj in composition.projection"

* • show_graph.py
  - add show_projections_not_in_composition option for debugging

* • composition.py
  _update_shadow_projections(): delete unused shadow projections and corresponding ports

* • composition.py
  _update_shadow_projections(): fix bug in deletion of unused shadow projections and ports

• test_show_graph:  tests failing, need mods to accomodate changes

* • composition.py:
  _analyze_graph():  add extra call to _determine_node_roles after _update_shadow_projections
  _run():  moved block of code at beginning initializing scheduler to after
           _complete_init_of_partially_initialized_nodes and _analyze_graph()

• show_graph.py
  - add test to all loops on projections:  "if proj in composition.projection"

* • show_graph.py
  fixes; now passes all show_graph tests

* -

* • composition.py
  _update_shadow_projections:  raise error for attempt to shadow INTERNAL Node of nested comp

* -

* -

* • test_composition.py
  implemented test_shadow_nested_nodes that tests shadowing of nested nodes

* -

* -

* -

* -

* • optimizationcontrolmechanism.py: docstring mods

* • composition.py:
  - add allow_probes and exclude_probes_from_output

* • composition.py:
  - docstring mods re: allow_probes

• optimizationcontrolmechanism.py:
  - allow_probes:  eliminate DIRECT setting
  - remove _parse_monitor_for_control_input_ports (no longer needed without allow_probes=DIRECT)

* • composition.py:
  - change "exclude_probes_from_output" -> "include_probes_in_output"

* • composition.py:
  - docstring mods re: allow_probes and include_probes_in_output

* • composition.py:
  - docstring mods re: allow_probes and include_probes_in_output

* • controlmechanism.py:
  - add allow_probes handling (moved from OCM)

• optimizationcontrolmechanism.py:
  - move allow_probes to controlmechanism.py

• composition.py:
  - refactor handling of allow_probes to permit for any ControlMechanism

• objectivemechanism.py:
  - add modulatory_mechanism attribute

* • controlmechanism.py:
  - add allow_probes handling (moved from OCM)

• optimizationcontrolmechanism.py:
  - move allow_probes to controlmechanism.py

• composition.py:
  - refactor handling of allow_probes to permit for any ControlMechanism
  - add _handle_allow_probes_for_control() to reconcile setting on Composition and ControlMechanism

• objectivemechanism.py:
  - add modulatory_mechanism attribute

* • composition.py
  add assignment of learning_mechanism to objective_mechanism.modulatory_mechanism for add_learning methods

* • docstring mods

* -

* -

* • optimizationcontrolmechanism.py: docstring revs

* -

* -

* • test_composition.py:
  - add test_unnested_PROBE
  - add test_nested_PROBES
    TBD: test include_probes_in_output

* -

* • composition.py
  - add_node():  support tuple with required_role

* -

* • composition.py:
  - _determine_node_roles:
     fix bug in which nested comp was prevented from being an OUTPUT Node if,
     in addition to Nodes that qualifed as OUTPUT, it also had nodes that projected
     to Nodes in an outer comp (making it look like it was INTERNAL)

* -

* • composition.py:
  - add_node(): enforce include_probes_in_output = True for nested Compositions
  - execute():
    - replace return of output_value with get_output_value()

* -

* • CompositionInterfaceMechanism.rst:
  - correct path ref

• compositioninterfacemechanism.py:
  - docstring fixes

* • optimizationcontrolmechanism.py:
  - docstring edits

* -

* -

* • controlmechanism.py: allow CONTROL as alias for PROJECTIONS in ControlSignal spec

* • controlsignal.py: allow CONTROL as alias for PROJECTIONS in ControlSignal spec

* • controlsignal.py: replaces modulates with control as arg (though still allow modulates)

* • test_projection_specifications.py:
  - add test_control_signal_projections_arg

* -

* • gatingsignal.py:
  - __init__: replace modulates arg with gate

* -

* -

* -

* -

* • CONTROL and GATE in place of PROJECTIONS

Co-authored-by: jdcpni <pniintel55>
Co-authored-by: Jan Vesely <[email protected]>
Co-authored-by: Katherine Mantel <[email protected]>
  • Loading branch information
3 people authored Jan 3, 2022
1 parent 9e88ae4 commit 1fdb95d
Show file tree
Hide file tree
Showing 13 changed files with 375 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,9 @@ class Parameters(ModulatoryMechanism_Base.Parameters):
constructor_argument='control'
)

# MODIFIED 1/2/22 OLD: - MUCH OF THIS SEEMS TO BE COVERED ELSEWHERE; COMMENTING OUT ONLY CAUSES PROBLEMS WITH
# test_control_signal_and_control_projection_names AND
# test_json_results_equivalence (stroop_conflict_monitoring_py)
def _parse_output_ports(self, output_ports):
def is_2tuple(o):
return isinstance(o, tuple) and len(o) == 2
Expand All @@ -1231,19 +1234,28 @@ def is_2tuple(o):
MECHANISM: output_ports[i][1]
}
# handle dict of form {PROJECTIONS: <2 item tuple>, <param1>: <value1>, ...}
elif (
isinstance(output_ports[i], dict)
and PROJECTIONS in output_ports[i]
and is_2tuple(output_ports[i][PROJECTIONS])
):
full_spec_dict = {
NAME: output_ports[i][PROJECTIONS][0],
MECHANISM: output_ports[i][PROJECTIONS][1],
**{k: v for k, v in output_ports[i].items() if k != PROJECTIONS}
}
output_ports[i] = full_spec_dict
elif isinstance(output_ports[i], dict):
# Handle CONTROL as synonym of PROJECTIONS
if CONTROL in output_ports[i]:
# MODIFIED 1/3/22 NEW:
# CONTROL AND PROJECTIONS can't both be used
if PROJECTIONS in output_ports[i]:
raise ControlMechanismError(f"Both 'CONTROL' and 'PROJECTIONS' entries found in "
f"specification dict for {ControlSignal.__name__} of "
f"'{self.name}': ({output_ports[i]}).")
# MODIFIED 1/3/22 END
# Replace CONTROL with PROJECTIONS
output_ports[i][PROJECTIONS] = output_ports[i].pop(CONTROL)
if (PROJECTIONS in output_ports[i] and is_2tuple(output_ports[i][PROJECTIONS])):
full_spec_dict = {
NAME: output_ports[i][PROJECTIONS][0],
MECHANISM: output_ports[i][PROJECTIONS][1],
**{k: v for k, v in output_ports[i].items() if k != PROJECTIONS}
}
output_ports[i] = full_spec_dict

return output_ports
# MODIFIED 1/2/22 END

def _validate_input_ports(self, input_ports):
if input_ports is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
from psyneulink.core.components.ports.modulatorysignals.gatingsignal import GatingSignal
from psyneulink.core.globals.defaults import defaultGatingAllocation
from psyneulink.core.globals.keywords import \
GATING, GATING_PROJECTION, GATING_SIGNAL, GATING_SIGNALS, \
GATE, GATING, GATING_PROJECTION, GATING_SIGNAL, GATING_SIGNALS, \
INIT_EXECUTE_METHOD_ONLY, MONITOR_FOR_CONTROL, PROJECTION_TYPE
from psyneulink.core.globals.parameters import Parameter
from psyneulink.core.globals.preferences.basepreferenceset import is_pref_set
Expand Down Expand Up @@ -399,6 +399,13 @@ class Parameters(ControlMechanism.Parameters):
:default value: numpy.array([0.5])
:type: ``numpy.ndarray``
output_ports
see `output_ports <Mechanism_Base.output_ports>`
:default value: None
:type:
:read only: True
gating_allocation
see `gating_allocation <GatingMechanism.gating_allocation>`
Expand All @@ -413,6 +420,63 @@ class Parameters(ControlMechanism.Parameters):
pnl_internal=True
)

output_ports = Parameter(
None,
stateful=False,
loggable=False,
read_only=True,
structural=True,
parse_spec=True,
aliases=['control', 'control_signals', 'gate', 'gating_signal'],
constructor_argument='gate'
)

def _parse_output_ports(self, output_ports):
from psyneulink.core.globals.keywords import NAME, MECHANISM, PROJECTIONS
# # FIX: 1/2/22 - ANY WAY TO CALL SUPER TO CALL ControlMechanism.parameters.output_ports._parse_output_ports
# super().output_ports._parse_output_ports(output_ports)

def is_2tuple(o):
return isinstance(o, tuple) and len(o) == 2

if not isinstance(output_ports, list):
output_ports = [output_ports]

for i in range(len(output_ports)):
# handle 2-item tuple
if is_2tuple(output_ports[i]):

# this is an odd case that uses two names in the name entry
# unsure what it means
if isinstance(output_ports[i][0], list):
continue

output_ports[i] = {
NAME: output_ports[i][0],
MECHANISM: output_ports[i][1]
}
# handle dict of form {PROJECTIONS: <2 item tuple>, <param1>: <value1>, ...}
elif isinstance(output_ports[i], dict):
# Handle GATE as synonym of PROJECTIONS
if GATE in output_ports[i]:
# GATE AND PROJECTIONS can't both be used
if PROJECTIONS in output_ports[i]:
raise GatingMechanismError(f"Both 'PROJECTIONS' and 'GATE' entries found in "
f"specification dict for {GatingSignal.__name__} of "
f"'{self.name}': ({output_ports[i]}).")
# Replace GATE with PROJECTIONS
output_ports[i][PROJECTIONS] = output_ports[i].pop(GATE)
if (PROJECTIONS in output_ports[i] and is_2tuple(output_ports[i][PROJECTIONS])):
full_spec_dict = {
NAME: output_ports[i][PROJECTIONS][0],
MECHANISM: output_ports[i][PROJECTIONS][1],
**{k: v for k, v in output_ports[i].items() if k != PROJECTIONS}
}
output_ports[i] = full_spec_dict

return output_ports


@tc.typecheck
def __init__(self,
default_gating_allocation=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,20 +582,16 @@
which is used to compute the `net_outcome <ControlMechanism.net_outcome>` of executing its `agent_rep
<OptimizationControlMechanism.agent_rep>`.
COMMENT:
FIX: 1/1/22
.. note::
, and the `allow_probes
<Composition.allow_probes>` attribute of the Composition for which the OptimizationControlMechanism is the
`controller <Composition.controller>`. The latter allows the values of the items listed in `monitor_for_control
<ControlMechanism.monitor_for_control>` to be `INPUT <NodeRole.INTERNAL>` or `INTERNAL <NodeRole.INTERNAL>` `Nodes
<Composition_Nodes>` of a `nested Composition <Composition_Nested>` to be monitored and included in the computation
of `outcome <ControlMechanism.outcome>` (ordinarily, those must be `OUTPUT <NodeRole.OUTPUT>` Nodes of a nested
Composition). This can be thought of as providing access to "latent variables" of the Composition being evaluated;
that is, ones that do not contribute directly to the Composition's `results <Composition_Execution_Results>`. This
applies both to items that are monitored directly by the OptimizationControlMechanism or via its ObjectiveMechanism.
COMMENT
If a `Node <Composition_Nodes>` other than an `OUTPUT <NodeRole.OUTPUT>` of a `nested <Composition_Nested>`
Composition is `specified to be monitored <ControlMechanism_Monitor_for_Control>`, it is assigned as a `PROBE
<NodeRole.PROBE>` of that nested Composition. Although `PROBE <NodeRole.PROBE>` Nodes are generally treated
like `OUTPUT <NodeRole.OUTPUT>` Nodes (since they project out of the Composition to which they belong), their
`value <Mechanism_Base.value>` is not included in the `output_values <Composition.output_values>` or `results
<Composition.results>` attributes of the Composition for which the OptimizationControlMechanism is the
`controller <Composition.controller>`, unless that Composition's `include_probes_in_output
<Composition.include_probes_in_output>` attribute is set to True (see `Composition_Probes` for additional
information).
.. _OptimizationControlMechanism_Function:
Expand Down Expand Up @@ -2322,14 +2318,6 @@ def _gen_llvm_output_port_parse_variable(self, ctx, builder, params, context, va
builder.store(builder.load(val_ptr), dest_ptr)
return oport_input

# Deprecated - this is now a Parameter
# @property
# def state_feature_values(self):
# if hasattr(self.agent_rep, 'model_based_optimizer') and self.agent_rep.model_based_optimizer is self:
# return self.agent_rep._get_predicted_input()
# else:
# return np.array(np.array(self.variable[1:]).tolist())

@property
def agent_rep_type(self):
from psyneulink.core.compositions.compositionfunctionapproximator import CompositionFunctionApproximator
Expand Down
Loading

0 comments on commit 1fdb95d

Please sign in to comment.