MCPcopy Create free account

hub / github.com/rlcode/reinforcement-learning / functions

Functions200 in github.com/rlcode/reinforcement-learning

↓ 39 callersMethodappend
(self, prev_id, action, reward, done)
4-atari-hard/2-go-explore.py:119
↓ 14 callersMethodstep
(self, action)
1-grid-world/env.py:87
↓ 11 callersMethodstep
One timestep for acting. obs (B,4,105,80), hx (B,gru). Returns logits, value, new hx.
4-atari-hard/3-robustify.py:98
↓ 9 callersMethodrender
(self)
1-grid-world/env.py:106
↓ 9 callersMethodreset
(self)
1-grid-world/env.py:76
↓ 9 callersMethodreset
(self)
4-atari-hard/env_robustify.py:114
↓ 8 callersMethodclear
(self)
1-grid-world/env.py:300
↓ 7 callersFunction_ortho
(layer, gain)
4-atari-hard/1-ppo-rnd.py:63
↓ 7 callersMethodsample
(self, batch_size, device)
3-atari/1-dqn.py:93
↓ 7 callersMethodstep
(self, action)
3-atari/env.py:43
↓ 6 callersFunction_ortho
(layer, gain)
3-atari/2-ppo.py:34
↓ 6 callersFunction_ortho
(layer, gain)
4-atari-hard/3-robustify.py:67
↓ 6 callersMethodlog
Append one structured row (frames + sps + caller's scalars) to metrics.jsonl.
4-atari-hard/env.py:82
↓ 6 callersMethodreset
(self, **kwargs)
3-atari/env.py:25
↓ 5 callersMethodstate_after_action
(self, state, action)
1-grid-world/env.py:256
↓ 4 callersFunction_atomic_save
tmp -> rename so a crash mid-write never corrupts the checkpoint.
4-atari-hard/env_go_explore.py:30
↓ 4 callersFunction_atomic_save
tmp -> rename so a crash mid-write never corrupts the checkpoint.
4-atari-hard/env.py:59
↓ 4 callersFunction_center
(x, y, unit, y_off=0)
1-grid-world/env.py:37
↓ 4 callersFunction_ortho
Orthogonal init — a standard PPO stability trick (CleanRL-style).
2-cartpole/3-ppo.py:58
↓ 4 callersMethodclick_count
(self, label)
1-grid-world/env.py:295
↓ 4 callersMethodget_all_states
(self)
1-grid-world/env.py:253
↓ 4 callersMethodget_reward
(self, state, action)
1-grid-world/env.py:260
↓ 4 callersFunctionquit_if_window_closed
Exit cleanly when the user clicks the window's X. Gymnasium's classic_control renderer pumps pygame's internal event processing but doesn't a
2-cartpole/env.py:29
↓ 4 callersMethodupdate
(self, batch)
4-atari-hard/1-ppo-rnd.py:134
↓ 3 callersFunction_circle
(surf, x, y, unit, color, y_off=0)
1-grid-world/env.py:49
↓ 3 callersFunction_grid_lines
(surf, unit, y_off=0)
1-grid-world/env.py:30
↓ 3 callersMethod_new_chunk
(self)
4-atari-hard/2-go-explore.py:111
↓ 3 callersFunction_open
(title, size)
1-grid-world/env.py:24
↓ 3 callersMethod_render
(self)
1-grid-world/env.py:350
↓ 3 callersFunction_stack_init
(frame)
4-atari-hard/3-robustify.py:121
↓ 3 callersFunction_triangle
(surf, x, y, unit, color, y_off=0)
1-grid-world/env.py:53
↓ 3 callersMethodassign
Stagger envs across a window below max_starting_point.
4-atari-hard/env_robustify.py:198
↓ 3 callersMethodcheckpoint
Periodic 'latest', 5M-step milestone, and best-gate checkpoints. state_fn() builds the dict only when a save actually happens.
4-atari-hard/env.py:100
↓ 3 callersFunctionepsilon
Linear schedule from EPSILON_START to EPSILON_END over EPSILON_DECAY_FRAMES.
3-atari/1-dqn.py:116
↓ 3 callersMethodfinalize
Final 'latest' checkpoint + a final.json result summary.
4-atari-hard/env.py:115
↓ 3 callersFunctionmake_env
Create an Atari env with the standard preprocessing pipeline.
3-atari/env.py:86
↓ 3 callersFunctionmake_env
(args)
2-cartpole/env.py:24
↓ 3 callersFunctionparse_args
()
2-cartpole/env.py:15
↓ 3 callersMethodresolve_resume
auto' -> run_dir/ckpt/latest.pt, else a path, else None.
4-atari-hard/env.py:91
↓ 3 callersFunctionrun_test_loop
Replay episodes forever using the supplied action picker. `get_action(state: np.ndarray) -> int`.
2-cartpole/env.py:45
↓ 3 callersMethodsample
n cells with replacement, p ∝ 1/sqrt(seen+1); DONE excluded. Returns (key, CAPTURE) pairs that freeze the cell's snapshot/score/ traj
4-atari-hard/2-go-explore.py:217
↓ 2 callersMethod__init__
(self)
4-atari-hard/1-ppo-rnd.py:101
↓ 2 callersMethod_btn_enabled
(btn)
1-grid-world/env.py:340
↓ 2 callersMethod_btn_rects
(self)
1-grid-world/env.py:344
↓ 2 callersMethod_chunk_path
A flushed chunk lives in our own dir, or (after a cross-run-dir resume) in the ancestor run's explog dir.
4-atari-hard/2-go-explore.py:141
↓ 2 callersFunction_pump_events
()
1-grid-world/env.py:17
↓ 2 callersFunction_rnd_conv
()
4-atari-hard/1-ppo-rnd.py:91
↓ 2 callersFunction_square
(surf, x, y, unit, color, y_off=0, fill=True)
1-grid-world/env.py:41
↓ 2 callersMethod_stack
(self, idx)
3-atari/1-dqn.py:80
↓ 2 callersMethod_state
(self)
1-grid-world/env.py:203
↓ 2 callersMethod_step_raw
(self, action, *, bookkeep=True)
4-atari-hard/env_robustify.py:142
↓ 2 callersFunctioncell_key
(210, 160) uint8 grayscale frame -> 88-byte archive key.
4-atari-hard/2-go-explore.py:70
↓ 2 callersFunctioncompute_gae
Generic GAE. Pass nonterminals=1-dones for the extrinsic (episodic) stream, or all-ones for the intrinsic (non-episodic) stream.
4-atari-hard/1-ppo-rnd.py:158
↓ 2 callersMethodfeatures
(self, obs)
4-atari-hard/3-robustify.py:94
↓ 2 callersMethodget_action
(self, state)
1-grid-world/5-deep_sarsa.py:62
↓ 2 callersMethodget_action
(self, state)
1-grid-world/3-sarsa.py:27
↓ 2 callersMethodget_policy
(self, state)
1-grid-world/1-policy_iteration.py:90
↓ 2 callersMethodget_value
(self, state)
1-grid-world/1-policy_iteration.py:95
↓ 2 callersMethodget_value
(self, state)
1-grid-world/2-value_iteration.py:56
↓ 2 callersMethodload_state
(self, st)
4-atari-hard/2-go-explore.py:291
↓ 2 callersMethodmainloop
(self)
1-grid-world/env.py:318
↓ 2 callersFunctionmake_restore_env
Single raw ALE env with clone/restore access. Imports live here (not module top) so harness-side tests can stub this module without pulling i
4-atari-hard/env_go_explore.py:137
↓ 2 callersMethodmove_along_policy
(self, picker)
1-grid-world/env.py:302
↓ 2 callersFunctionnormalize_obs_for_rnd
frame: (..., 84, 84) uint8 or float. Return float32 (..., 1, 84, 84) centered/scaled by obs_rms and clipped to [-5, 5] per paper.
4-atari-hard/1-ppo-rnd.py:149
↓ 2 callersFunctionparse_args
()
3-atari/env.py:71
↓ 2 callersFunctionpick_device
(arg="auto")
3-atari/env.py:113
↓ 2 callersMethodprint_value_all
(self, q_table)
1-grid-world/env.py:103
↓ 2 callersFunctionquit_if_window_closed
Exit cleanly when the user clicks the window's X. No-op on headless runs (no pygame display initialized).
3-atari/env.py:123
↓ 2 callersMethodrender
(self)
1-grid-world/env.py:212
↓ 2 callersFunctionrun_test_loop
Replay episodes forever using the supplied action picker.
3-atari/env.py:136
↓ 2 callersMethodshow_arrows
(self, p)
1-grid-world/env.py:299
↓ 2 callersMethodshow_values
(self, v)
1-grid-world/env.py:298
↓ 2 callersMethodstate
(self)
4-atari-hard/2-go-explore.py:283
↓ 2 callersMethodupdate_target_model
(self)
2-cartpole/1-dqn.py:80
↓ 1 callersMethod__init__
(self, state_size, action_size)
2-cartpole/2-a2c.py:36
↓ 1 callersMethod__init__
(self, env)
1-grid-world/1-policy_iteration.py:7
↓ 1 callersMethod__init__
(self, env)
1-grid-world/2-value_iteration.py:5
↓ 1 callersMethod_arrow
(self, x0, y0, x1, y1)
1-grid-world/env.py:407
↓ 1 callersMethod_chunk
(self, chunk_idx)
4-atari-hard/2-go-explore.py:154
↓ 1 callersMethod_flush
(self)
4-atari-hard/2-go-explore.py:129
↓ 1 callersMethod_frame
(self)
4-atari-hard/env_robustify.py:95
↓ 1 callersFunction_load_ge
Import 2-go-explore.py (ExperienceLog/DONE_KEY) with env stubbed.
4-atari-hard/extract_demo.py:32
↓ 1 callersMethod_restore_to
Restore the latest checkpoint at or before nr, replay demo actions up to nr (no sticky — deterministic), return the post-restore frame
4-atari-hard/env_robustify.py:100
↓ 1 callersMethodappend_sample
(self, state, action, reward, next_state, done)
2-cartpole/1-dqn.py:92
↓ 1 callersMethodappend_sample
(self, state, action, reward)
1-grid-world/6-reinforce.py:76
↓ 1 callersMethodarg_max
(state_action)
1-grid-world/4-q_learning.py:36
↓ 1 callersMethodarg_max
(state_action)
1-grid-world/3-sarsa.py:38
↓ 1 callersFunctioncompute_gae
(rewards, values, dones, last_value)
3-atari/2-ppo.py:60
↓ 1 callersFunctioncompute_gae
(rewards, values, dones, last_value)
2-cartpole/3-ppo.py:88
↓ 1 callersMethoddiscount_rewards
(self, rewards)
1-grid-world/6-reinforce.py:68
↓ 1 callersFunctionevaluate
From-reset, sticky-action, eps-greedy 0.0 eval — the RL-policy number.
4-atari-hard/3-robustify.py:335
↓ 1 callersMethodfilter
(self, action, rng)
4-atari-hard/env_robustify.py:53
↓ 1 callersMethodget_action
(self, state)
2-cartpole/2-a2c.py:76
↓ 1 callersMethodget_action
(self, state)
2-cartpole/1-dqn.py:84
↓ 1 callersMethodget_action
(self, state)
1-grid-world/6-reinforce.py:61
↓ 1 callersMethodget_action
(self, state)
1-grid-world/2-value_iteration.py:31
↓ 1 callersMethodget_action
(self, state)
1-grid-world/4-q_learning.py:25
↓ 1 callersFunctiongreedy_action
Used by --test and during exploitation steps.
3-atari/1-dqn.py:134
↓ 1 callersMethodlearn
(self, state, action, reward, next_state)
1-grid-world/4-q_learning.py:17
↓ 1 callersMethodlearn
(self, state, action, reward, next_state, next_action)
1-grid-world/3-sarsa.py:18
next →1–100 of 200, ranked by callers