b3972d8247961127b4e71d0af0cff5f6bf19ab5f,slm_lab/agent/algorithm/algorithm_util.py,,act_with_epsilon_greedy,#Any#Any#Any#Any#,37
Before Change
if epsilon > np.random.rand():
action = np.random.randint(body.action_dim)
else:
torch_state = Variable(torch.from_numpy(state).float())
out = net.wrap_eval(torch_state)
action = int(torch.max(out, dim=0)[1][0])
return action
After Change
if epsilon > np.random.rand():
action = np.random.randint(body.action_dim)
else:
recurrent = body.agent.len_state_buffer > 0
logger.debug2(f"Length state buffer: {body.agent.len_state_buffer}")
torch_state = create_torch_state(state, body.state_buffer, recurrent, body.agent.len_state_buffer)
out = net.wrap_eval(torch_state).squeeze_(dim=0)
action = int(torch.max(out, dim=0)[1][0])
logger.debug2(f"Outs {out} Action {action}")
return action
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: kengz/SLM-Lab
Commit Name: b3972d8247961127b4e71d0af0cff5f6bf19ab5f
Time: 2018-03-06
Author: lgraesser@users.noreply.github.com
File Name: slm_lab/agent/algorithm/algorithm_util.py
Class Name:
Method Name: act_with_epsilon_greedy
Project Name: kengz/SLM-Lab
Commit Name: b3972d8247961127b4e71d0af0cff5f6bf19ab5f
Time: 2018-03-06
Author: lgraesser@users.noreply.github.com
File Name: slm_lab/agent/algorithm/algorithm_util.py
Class Name:
Method Name: act_with_boltzmann
Project Name: kengz/SLM-Lab
Commit Name: ec849adaf4ceb42ed52ca142c839f627c34b9434
Time: 2018-05-21
Author: kengzwl@gmail.com
File Name: slm_lab/agent/algorithm/algorithm_util.py
Class Name:
Method Name: act_with_gaussian