import numpy as np from scipy.special import softmax import matplotlib.pyplot as plt from source.utils import TD_lambda_update, theor_trajectory #%% nr_states = 21 epochs = ['pre', 'post'] neg_reward = -2 replay_prob=1 tot_steps = 4000 gamma = .9 alpha = .1 #%% def transition(M, elig_trace, reward, tot_steps, curr_state, prev_state, gamma, alpha, traj, replays=False, neg_reward = 0): n_states = np.shape(M)[0] ## REPLAYS if replays and curr_state == 10 and prev_state==11 and reward[0]<0: if np.random.rand()0 else [] if curr_state