Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/VinF/deer
/ functions
Functions
287 in github.com/VinF/deer
⨍
Functions
287
◇
Types & classes
49
↓ 106 callers
Method
append
(self, obj)
deer/agent.py:831
↓ 66 callers
Method
attach
(self, controller)
deer/agent.py:144
↓ 20 callers
Method
mode
(self)
deer/agent.py:153
↓ 12 callers
Method
run
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 callers
Method
getSlice
(self, start, end=sys.maxsize)
deer/agent.py:855
↓ 9 callers
Method
get_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 callers
Function
process_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 callers
Method
__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 callers
Method
update
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 callers
Method
_buildDQN
Build a network consistent with each type of inputs
deer/learning_algos/NN_keras.py:32
↓ 6 callers
Method
inputDimensions
(self)
examples/gym/pendulum_env.py:51
↓ 5 callers
Method
nActions
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 callers
Method
nActions
(self)
examples/test_CRAR/catcher_env.py:329
↓ 5 callers
Method
observations
Get all observations currently in the replay memory, ordered by time where they were observed.
deer/agent.py:510
↓ 4 callers
Method
_randomValidStateIndex
Returns the index corresponding to a timestep that is valid
deer/agent.py:729
↓ 4 callers
Method
create_map
(self)
examples/maze/maze_env.py:37
↓ 4 callers
Method
float_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 callers
Method
inputDimensions
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 callers
Method
inputDimensions
(self)
examples/test_CRAR/catcher_env.py:319
↓ 4 callers
Method
reset
(self, mode)
examples/maze/maze_env.py:87
↓ 3 callers
Method
_print
(self, agent)
deer/experiment/base_controllers.py:483
↓ 3 callers
Method
_reset
(self, agent)
deer/experiment/base_controllers.py:223
↓ 3 callers
Method
_resetQHat
Set the target Q-network weights equal to the main Q-network weights
deer/learning_algos/CRAR_keras.py:559
↓ 3 callers
Method
_update
(self, agent)
deer/experiment/base_controllers.py:228
↓ 3 callers
Method
_update
(self, agent)
deer/experiment/base_controllers.py:413
↓ 3 callers
Method
actions
Get all actions currently in the replay memory, ordered by time where they were taken.
deer/agent.py:491
↓ 3 callers
Method
clip_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 callers
Method
create_map
(self)
examples/test_CRAR/simple_maze_env.py:33
↓ 3 callers
Method
getSliceBySeq
(self, seq)
deer/agent.py:852
↓ 3 callers
Method
nActions
(self)
examples/gym/pendulum_env.py:54
↓ 3 callers
Method
observe
(self)
examples/gym/mountain_car_continuous_env.py:90
↓ 3 callers
Method
totalRewardOverLastTest
Returns the average sum of rewards per episode and the number of episode
deer/agent.py:139
↓ 2 callers
Method
Q_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 callers
Method
_addSample
(self, ponctualObs, action, reward, is_terminal)
deer/agent.py:401
↓ 2 callers
Method
_compile
Compile self.q_vals
deer/learning_algos/q_net_keras.py:192
↓ 2 callers
Method
_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 callers
Method
_randomPrioritizedBatch
(self, batch_size)
deer/agent.py:762
↓ 2 callers
Method
_resetQHat
Set the target Q-network weights equal to the main Q-network weights
deer/learning_algos/q_net_keras.py:206
↓ 2 callers
Method
_resetQHat
(self)
deer/learning_algos/AC_net_keras.py:254
↓ 2 callers
Method
_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 callers
Method
_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 callers
Method
act
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 callers
Method
action
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 callers
Method
addSample
Store the punctual observations, action, reward, is_terminal and priority in the dataset. Parameters ----------- obs : ndarra
deer/agent.py:771
↓ 2 callers
Method
bestAction
Returns the best Action for the given state. This is an additional encapsulation for q-network.
deer/base_classes/policy.py:27
↓ 2 callers
Method
encoder_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 callers
Method
encoder_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 callers
Method
end
Optional hook called at the end of all epochs
deer/base_classes/environment.py:130
↓ 2 callers
Method
full_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 callers
Method
full_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 callers
Method
getBatch
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 callers
Method
get_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 callers
Method
get_observation
(self,y,x_block,x)
examples/test_CRAR/catcher_env.py:336
↓ 2 callers
Method
inTerminalState
(self)
examples/ALE/ALE_env_gym.py:119
↓ 2 callers
Method
inputDimensions
(self)
examples/ALE/ALE_env.py:86
↓ 2 callers
Method
inputDimensions
(self)
examples/MG_two_storages/MG_two_storages_env.py:248
↓ 2 callers
Method
inputDimensions
(self)
examples/maze/maze_env.py:138
↓ 2 callers
Method
inputDimensions
(self)
examples/toy_env/Toy_env.py:138
↓ 2 callers
Method
nActions
(self)
examples/ALE/ALE_env.py:92
↓ 2 callers
Method
nActions
(self)
examples/maze/maze_env.py:147
↓ 2 callers
Method
nActions
(self)
examples/toy_env/Toy_env.py:144
↓ 2 callers
Method
observe
(self)
examples/maze/maze_env.py:150
↓ 2 callers
Method
onEnd
Called when the agent has finished processing all its epochs, just before returning from its run() method.
deer/experiment/base_controllers.py:103
↓ 2 callers
Method
onEpochEnd
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 callers
Method
onStart
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 callers
Method
randomAction
Returns a random action
deer/base_classes/policy.py:33
↓ 2 callers
Method
setDiscountFactor
Setting the discount factor Parameters ----------- df : float The discount factor that has to bet set
deer/base_classes/learning_algo.py:53
↓ 2 callers
Method
setEpsilon
Set the epsilon used for :math:`\epsilon`-greedy exploration
deer/policies/EpsilonGreedyPolicy.py:25
↓ 2 callers
Method
setLearningRate
Setting the learning rate Parameters ----------- lr : float The learning rate that has to be set
deer/learning_algos/CRAR_keras.py:565
↓ 2 callers
Method
transition_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 callers
Method
update_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 callers
Method
_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 callers
Method
_chooseAction
(self)
deer/agent.py:408
↓ 1 callers
Method
_compile
Compile all the optimizers for the different losses
deer/learning_algos/CRAR_keras.py:517
↓ 1 callers
Method
_find
(self, priority, node)
deer/helper/tree.py:217
↓ 1 callers
Method
_findIndex
(self, index, node)
deer/helper/tree.py:128
↓ 1 callers
Method
_printTree
(self, node)
deer/helper/tree.py:233
↓ 1 callers
Method
_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 callers
Method
_step
This method is called at each time step and performs one action in the environment. Returns ------- V : float
deer/agent.py:380
↓ 1 callers
Method
_updateValue
(self, node, diff)
deer/helper/tree.py:109
↓ 1 callers
Method
act
Applies the agent action [action] on the environment. Parameters ----------- action : int The action selected by
deer/base_classes/environment.py:43
↓ 1 callers
Method
act
(self, action)
examples/ALE/ALE_env.py:67
↓ 1 callers
Method
avgBellmanResidual
Returns the average training loss on the epoch
deer/agent.py:122
↓ 1 callers
Method
avgEpisodeVValue
Returns the average V value on the episode (on time steps where a non-random action has been taken)
deer/agent.py:129
↓ 1 callers
Method
chooseBestAction
Get the best action for a pseudo-state
deer/base_classes/learning_algo.py:31
↓ 1 callers
Method
diff_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 callers
Method
discountFactor
Getting the discount factor
deer/base_classes/learning_algo.py:71
↓ 1 callers
Method
dumpNetwork
Dump the network Parameters ----------- fname : string Name of the file where the network will be dumped
deer/agent.py:203
↓ 1 callers
Method
epsilon
Get the epsilon for :math:`\epsilon`-greedy exploration
deer/policies/EpsilonGreedyPolicy.py:30
↓ 1 callers
Method
find
Find a leaf based on the priority. Arguments: priority - the target priority generated randomly Return: nod
deer/helper/tree.py:204
↓ 1 callers
Method
findIndex
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 callers
Method
force_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 callers
Method
getAllParams
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 callers
Method
getIndex
(self)
deer/agent.py:867
↓ 1 callers
Method
getLowerBound
(self)
deer/agent.py:861
↓ 1 callers
Method
getTrueSize
(self)
deer/agent.py:870
↓ 1 callers
Method
getUpperBound
(self)
deer/agent.py:864
↓ 1 callers
Method
get_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 callers
Method
get_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 callers
Method
get_path
(self)
examples/maze/a_star_path_finding.py:119
next →
1–100 of 287, ranked by callers