newAgent = setActor(oldAgent,actor)
returns a new reinforcement learning agent, newAgent, that uses the
specified actor representation. Apart from the actor representation, the new agent has the
same configuration as the specified original agent, oldAgent.
actor = rlDeterministicActorRepresentation(newActorNetwork,...
getObservationInfo(agent),getActionInfo(agent),...'Observation',{'state'},...'Action',{'action'})
actor =
rlDeterministicActorRepresentation with properties:
ActionInfo: [1x1 rl.util.rlNumericSpec]
ObservationInfo: [1x1 rl.util.rlNumericSpec]
Options: [1x1 rl.option.rlRepresentationOptions]
Set the actor representation of the agent to the new augmented actor:
agent = setActor(agent,actor);
To check your agent, use getAction to return the action from a random observation.
getAction(agent,{rand(2,1)})
ans = single
1.4134
You can now test and train the agent against the environment.
Updated reinforcement learning agent, returned as an agent object that uses the
specified actor representation. Apart from the actor representation, the new agent has
the same configuration as oldAgent.