MCPcopy Create free account

hub / github.com/VinF/deer / functions

Functions287 in github.com/VinF/deer

↓ 106 callersMethodappend
(self, obj)
deer/agent.py:831
↓ 66 callersMethodattach
(self, controller)
deer/agent.py:144
↓ 20 callersMethodmode
(self)
deer/agent.py:153
↓ 12 callersMethodrun
This function encapsulates the inference and the learning. If the agent is in train mode (mode = -1): It starts by callin
deer/agent.py:251
↓ 10 callersMethodgetSlice
(self, start, end=sys.maxsize)
deer/agent.py:855
↓ 9 callersMethodget_cell
Returns a cell from the cells list. @param x cell x coordinate @param y cell y coordinate @returns cell
examples/maze/a_star_path_finding.py:94
↓ 9 callersFunctionprocess_args
Handle the command line and return an object containing all the parameters. Arguments: args - list of command line arguments (not inc
deer/default_parser.py:8
↓ 7 callersMethod__init__
Activate this controller. All controllers inheriting this class should call this method in their own __init()__ using super(self.__c
deer/experiment/base_controllers.py:21
↓ 7 callersMethodupdate
Update a leaf and the tree priorities. When the replay memory is updated with a new transition, it is also updated in the tree. The
deer/helper/tree.py:81
↓ 6 callersMethod_buildDQN
Build a network consistent with each type of inputs
deer/learning_algos/NN_keras.py:32
↓ 6 callersMethodinputDimensions
(self)
examples/gym/pendulum_env.py:51
↓ 5 callersMethodnActions
Gets the number of different actions that can be taken on this environment. It can be either an integer in the case of a finite discrete numbe
deer/base_classes/environment.py:71
↓ 5 callersMethodnActions
(self)
examples/test_CRAR/catcher_env.py:329
↓ 5 callersMethodobservations
Get all observations currently in the replay memory, ordered by time where they were observed.
deer/agent.py:510
↓ 4 callersMethod_randomValidStateIndex
Returns the index corresponding to a timestep that is valid
deer/agent.py:729
↓ 4 callersMethodcreate_map
(self)
examples/maze/maze_env.py:37
↓ 4 callersMethodfloat_model
Instantiate a Keras model for fitting a float from x. The model takes the following inputs: x : internal state
deer/learning_algos/NN_CRAR_keras.py:365
↓ 4 callersMethodinputDimensions
Gets the shape of the input space for this environment. This returns a list whose length is the number of observations in the environ
deer/base_classes/environment.py:55
↓ 4 callersMethodinputDimensions
(self)
examples/test_CRAR/catcher_env.py:319
↓ 4 callersMethodreset
(self, mode)
examples/maze/maze_env.py:87
↓ 3 callersMethod_print
(self, agent)
deer/experiment/base_controllers.py:483
↓ 3 callersMethod_reset
(self, agent)
deer/experiment/base_controllers.py:223
↓ 3 callersMethod_resetQHat
Set the target Q-network weights equal to the main Q-network weights
deer/learning_algos/CRAR_keras.py:559
↓ 3 callersMethod_update
(self, agent)
deer/experiment/base_controllers.py:228
↓ 3 callersMethod_update
(self, agent)
deer/experiment/base_controllers.py:413
↓ 3 callersMethodactions
Get all actions currently in the replay memory, ordered by time where they were taken.
deer/agent.py:491
↓ 3 callersMethodclip_action
Clip the possible actions if it is outside the action space defined by self._nActions self._nActions is given as [[low_action1,high
deer/learning_algos/AC_net_keras.py:203
↓ 3 callersMethodcreate_map
(self)
examples/test_CRAR/simple_maze_env.py:33
↓ 3 callersMethodgetSliceBySeq
(self, seq)
deer/agent.py:852
↓ 3 callersMethodnActions
(self)
examples/gym/pendulum_env.py:54
↓ 3 callersMethodobserve
(self)
examples/gym/mountain_car_continuous_env.py:90
↓ 3 callersMethodtotalRewardOverLastTest
Returns the average sum of rewards per episode and the number of episode
deer/agent.py:139
↓ 2 callersMethodQ_model
Instantiate a a Keras model for the Q-network from x. The model takes the following inputs: x : internal state Parameters
deer/learning_algos/NN_CRAR_keras.py:471
↓ 2 callersMethod_addSample
(self, ponctualObs, action, reward, is_terminal)
deer/agent.py:401
↓ 2 callersMethod_compile
Compile self.q_vals
deer/learning_algos/q_net_keras.py:192
↓ 2 callersMethod_createSubtree
Build balanced subtrees. The leaf nodes have their "priority" initialized to 0 and "position" from 0 to n-1, with n being the size
deer/helper/tree.py:51
↓ 2 callersMethod_randomPrioritizedBatch
(self, batch_size)
deer/agent.py:762
↓ 2 callersMethod_resetQHat
Set the target Q-network weights equal to the main Q-network weights
deer/learning_algos/q_net_keras.py:206
↓ 2 callersMethod_resetQHat
(self)
deer/learning_algos/AC_net_keras.py:254
↓ 2 callersMethod_runEpisode
This function runs an episode of learning. An episode ends up when the environment method "inTerminalState" returns True (or when th
deer/agent.py:327
↓ 2 callersMethod_run_non_train
This function runs a number of epochs in non train mode (id > -1). Parameters ----------- n_epochs : int
deer/agent.py:302
↓ 2 callersMethodact
Simulate one time step in the environment and returns the reward for the time step Parameters ----------- action : l
examples/gym/mountain_car_continuous_env.py:26
↓ 2 callersMethodaction
Main method of the Policy class. It can be called by agent.py, given a state, and should return a valid action w.r.t. the environment given to
deer/base_classes/policy.py:50
↓ 2 callersMethodaddSample
Store the punctual observations, action, reward, is_terminal and priority in the dataset. Parameters ----------- obs : ndarra
deer/agent.py:771
↓ 2 callersMethodbestAction
Returns the best Action for the given state. This is an additional encapsulation for q-network.
deer/base_classes/policy.py:27
↓ 2 callersMethodencoder_diff_model
Instantiate a Keras model that provides the difference between two encoded pseudo-states The model takes the two following inputs:
deer/learning_algos/NN_CRAR_keras.py:150
↓ 2 callersMethodencoder_model
Instantiate a Keras model for the encoder of the CRAR learning algorithm. The model takes the following as input s : list o
deer/learning_algos/NN_CRAR_keras.py:40
↓ 2 callersMethodend
Optional hook called at the end of all epochs
deer/base_classes/environment.py:130
↓ 2 callersMethodfull_Q_model
Instantiate a a Keras model for the Q-network from s. The model takes the following inputs: s : list of objects Each ob
deer/learning_algos/NN_CRAR_keras.py:528
↓ 2 callersMethodfull_float_model
Instantiate a Keras model for fitting a float from s. The model takes the four following inputs: s : list of objects
deer/learning_algos/NN_CRAR_keras.py:415
↓ 2 callersMethodgetBatch
Generate the indices of a random batch of size n. The samples within the random batch are selected following the priorities (probabil
deer/helper/tree.py:137
↓ 2 callersMethodget_higher_dim_obs
Obtain the high-dimensional observation from indices of the agent position and the indices of the reward positions.
examples/test_CRAR/simple_maze_env.py:360
↓ 2 callersMethodget_observation
(self,y,x_block,x)
examples/test_CRAR/catcher_env.py:336
↓ 2 callersMethodinTerminalState
(self)
examples/ALE/ALE_env_gym.py:119
↓ 2 callersMethodinputDimensions
(self)
examples/ALE/ALE_env.py:86
↓ 2 callersMethodinputDimensions
(self)
examples/MG_two_storages/MG_two_storages_env.py:248
↓ 2 callersMethodinputDimensions
(self)
examples/maze/maze_env.py:138
↓ 2 callersMethodinputDimensions
(self)
examples/toy_env/Toy_env.py:138
↓ 2 callersMethodnActions
(self)
examples/ALE/ALE_env.py:92
↓ 2 callersMethodnActions
(self)
examples/maze/maze_env.py:147
↓ 2 callersMethodnActions
(self)
examples/toy_env/Toy_env.py:144
↓ 2 callersMethodobserve
(self)
examples/maze/maze_env.py:150
↓ 2 callersMethodonEnd
Called when the agent has finished processing all its epochs, just before returning from its run() method.
deer/experiment/base_controllers.py:103
↓ 2 callersMethodonEpochEnd
Called whenever the agent ends an epoch, just after the last episode of this epoch was ended and after any onEpisodeEnd() signal was processe
deer/experiment/base_controllers.py:72
↓ 2 callersMethodonStart
Called when the agent is going to start working (before anything else). This corresponds to the moment where the agent's run() method
deer/experiment/base_controllers.py:41
↓ 2 callersMethodrandomAction
Returns a random action
deer/base_classes/policy.py:33
↓ 2 callersMethodsetDiscountFactor
Setting the discount factor Parameters ----------- df : float The discount factor that has to bet set
deer/base_classes/learning_algo.py:53
↓ 2 callersMethodsetEpsilon
Set the epsilon used for :math:`\epsilon`-greedy exploration
deer/policies/EpsilonGreedyPolicy.py:25
↓ 2 callersMethodsetLearningRate
Setting the learning rate Parameters ----------- lr : float The learning rate that has to be set
deer/learning_algos/CRAR_keras.py:565
↓ 2 callersMethodtransition_model
Instantiate a Keras model for the transition between two encoded pseudo-states. The model takes as inputs: x : internal state
deer/learning_algos/NN_CRAR_keras.py:200
↓ 2 callersMethodupdate_cell
Update adjacent cell. @param adj adjacent cell to current cell @param cell current cell being processed
examples/maze/a_star_path_finding.py:130
↓ 1 callersMethod_checkTerminal
Avoid terminal states in the x samples preceding the chosen index. Argument: index - chosen index based on prio
deer/helper/tree.py:163
↓ 1 callersMethod_chooseAction
(self)
deer/agent.py:408
↓ 1 callersMethod_compile
Compile all the optimizers for the different losses
deer/learning_algos/CRAR_keras.py:517
↓ 1 callersMethod_find
(self, priority, node)
deer/helper/tree.py:217
↓ 1 callersMethod_findIndex
(self, index, node)
deer/helper/tree.py:128
↓ 1 callersMethod_printTree
(self, node)
deer/helper/tree.py:233
↓ 1 callersMethod_run_train
This function encapsulates the whole process of the learning. It starts by calling the controllers method "onStart", Then it
deer/agent.py:274
↓ 1 callersMethod_step
This method is called at each time step and performs one action in the environment. Returns ------- V : float
deer/agent.py:380
↓ 1 callersMethod_updateValue
(self, node, diff)
deer/helper/tree.py:109
↓ 1 callersMethodact
Applies the agent action [action] on the environment. Parameters ----------- action : int The action selected by
deer/base_classes/environment.py:43
↓ 1 callersMethodact
(self, action)
examples/ALE/ALE_env.py:67
↓ 1 callersMethodavgBellmanResidual
Returns the average training loss on the epoch
deer/agent.py:122
↓ 1 callersMethodavgEpisodeVValue
Returns the average V value on the episode (on time steps where a non-random action has been taken)
deer/agent.py:129
↓ 1 callersMethodchooseBestAction
Get the best action for a pseudo-state
deer/base_classes/learning_algo.py:31
↓ 1 callersMethoddiff_Tx_x_
For plan_depth=0, instantiate a Keras model that provides the difference between T(E(s1),a) and E(s2). Note that it gives 0 if the transition
deer/learning_algos/NN_CRAR_keras.py:248
↓ 1 callersMethoddiscountFactor
Getting the discount factor
deer/base_classes/learning_algo.py:71
↓ 1 callersMethoddumpNetwork
Dump the network Parameters ----------- fname : string Name of the file where the network will be dumped
deer/agent.py:203
↓ 1 callersMethodepsilon
Get the epsilon for :math:`\epsilon`-greedy exploration
deer/policies/EpsilonGreedyPolicy.py:30
↓ 1 callersMethodfind
Find a leaf based on the priority. Arguments: priority - the target priority generated randomly Return: nod
deer/helper/tree.py:204
↓ 1 callersMethodfindIndex
Find a leaf based on the index. Arguments: index - integer between 0 and n-1, n being the size of the repl
deer/helper/tree.py:114
↓ 1 callersMethodforce_features
Instantiate a Keras model that provides the vector of the transition at E(s1). It is calculated as the different between E(s1) and E(T(s1)).
deer/learning_algos/NN_CRAR_keras.py:313
↓ 1 callersMethodgetAllParams
Provides all parameters used by the learning algorithm Returns ------- Values of the parameters: list of numpy arrays
deer/learning_algos/CRAR_keras.py:157
↓ 1 callersMethodgetIndex
(self)
deer/agent.py:867
↓ 1 callersMethodgetLowerBound
(self)
deer/agent.py:861
↓ 1 callersMethodgetTrueSize
(self)
deer/agent.py:870
↓ 1 callersMethodgetUpperBound
(self)
deer/agent.py:864
↓ 1 callersMethodget_adjacent_cells
Returns adjacent cells to a cell. Clockwise starting from the one on the right. @param cell get adjacent cells for this cell @
examples/maze/a_star_path_finding.py:102
↓ 1 callersMethodget_heuristic
Compute the heuristic value H for a cell. Distance between this cell and the ending cell multiply by 10. @returns heuristic value H
examples/maze/a_star_path_finding.py:87
↓ 1 callersMethodget_path
(self)
examples/maze/a_star_path_finding.py:119
next →1–100 of 287, ranked by callers