

def process_minibatch(minibatch, model):
    "This does the heavy lifting, aka, the training. It's super jacked."
    X_train = []
    y_train = []
    for memory in minibatch:
        (old_state_m, action_m, reward_m, new_state_m) = memory
        old_qval = model.predict(old_state_m, batch_size=1)
        newQ = model.predict(new_state_m, batch_size=1)
        maxQ = np.max(newQ)
        y = np.zeros((1, 3))
        maxQ[:] = old_qval[:]
        if (reward_m != (- 500)):
            update = (reward_m + (GAMMA * maxQ))
        else:
            update = reward_m
        y[0][action_m] = update
        X_train.append(old_state_m.reshape(NUM_INPUT))
        y_train.append(y.reshape(3))
    X_train = np.array(X_train)
    y_train = np.array(y_train)
    return (X_train, y_train)

dataset/ETHPy150Open harvitronix/reinforcement-learning-car/learning.py process_minibatch/VarMisuse@91/160 `y`->`maxQ`