Skip to content

Commit

Permalink
add view
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeBouton committed Oct 31, 2018
1 parent 00c776d commit b7a404c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function batch_train!(solver::DeepQLearningSolver,
qp_values = active_q(sp_batch)
# best_a = argmax(qp_values, dims=1) # fails with TrackedArrays.
# q_sp_max = target_q_values[best_a]
q_sp_max = vec([target_q_values[argmax(qp_values[:,i]), i] for i=1:solver.batch_size])
q_sp_max = vec([target_q_values[argmax(view(qp_values,:,i)), i] for i=1:solver.batch_size])
else
q_sp_max = @view maximum(target_q(sp_batch), dims=1)[:]
end
Expand Down

0 comments on commit b7a404c

Please sign in to comment.