76b6bcace9245a57f439d39deac653e2384a645b,PyPi/utils/dataset.py,,max_QA,#Any#Any#Any#Any#,113
Before Change
// store Q-value and action for each state
r_q, r_a = np.zeros(n_states), np.zeros((n_states, action_dim), dtype=int)
for idx in xrange(n_states):
r_q[idx] = Q[idx, amax[idx]]
r_a[idx] = discrete_actions[amax[idx]]
return r_q, r_a
def state_action(state, action):
After Change
predictions = approximator.predict(samples)
Q[:, action] = predictions * (1 - absorbing)
max_q = np.max(Q, axis=1)
if Q.shape[0] > 1:
max_a = np.argmax(Q, axis=1)
else:
max_a = [np.random.choice(np.argwhere(Q[0] == max_q).ravel())]
return max_q, discrete_actions[max_a]
def state_action(state, action):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: AIRLab-POLIMI/mushroom
Commit Name: 76b6bcace9245a57f439d39deac653e2384a645b
Time: 2017-07-20
Author: carlo.deramo@gmail.com
File Name: PyPi/utils/dataset.py
Class Name:
Method Name: max_QA
Project Name: aleju/imgaug
Commit Name: 6411c9079a834fd7549ab4593261a3619519eb02
Time: 2019-09-04
Author: kontakt@ajung.name
File Name: imgaug/augmenters/size.py
Class Name: CropAndPad
Method Name: _augment_images
Project Name: AIRLab-POLIMI/mushroom
Commit Name: 76b6bcace9245a57f439d39deac653e2384a645b
Time: 2017-07-20
Author: carlo.deramo@gmail.com
File Name: PyPi/utils/dataset.py
Class Name:
Method Name: max_QA
Project Name: tf-coreml/tf-coreml
Commit Name: 4afae5fc3a9f7022608a21703ba95c0d14d9bef6
Time: 2017-11-08
Author: awadhwa@apple.com
File Name: tests/test_pretrained_models.py
Class Name: CorrectnessTest
Method Name: _test_tf_model