Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSTM support #28

Closed
deveshjawla opened this issue Nov 30, 2020 · 2 comments
Closed

LSTM support #28

deveshjawla opened this issue Nov 30, 2020 · 2 comments

Comments

@deveshjawla
Copy link

Hi Jonathan,
As I try to understand the core of Alphazero.jl, I had a question about the input to the neural network. Looking at src/learning.jl, I believe the neural net receives a batch of input, but the problem is I couldn't figure out what is exact input to the neural network, specifically the part data=(W, X, A, P, V) as training input, maybe you could tell me?

@jonathan-laurent
Copy link
Owner

You can look at the following comment in src/learning.jl:

# A samples collection is represented on the learning side as a (W, X, A, P, V)
# tuple. Each component is a `Float32` tensor whose last dimension corresponds
# to the sample index. Writing `n` the number of samples and `a` the total
# number of actions:
# - W (size 1×n) contains the samples weights
# - X (size …×n) contains the board representations
# - A (size a×n) contains the action masks (values are either 0 or 1)
# - P (size a×n) contains the recorded MCTS policies
# - V (size 1×n) contains the recorded values
# Note that the weight of a sample is computed as an increasing
# function of its `n` field.

Also, regarding samples weights, you can read more here: https://jonathan-laurent.github.io/AlphaZero.jl/dev/reference/params/#AlphaZero.SamplesWeighingPolicy.

@deveshjawla
Copy link
Author

Hey Man, thanks for the input. I had read this already. But somehow I forgot that Flux can take a tuple consisting of input and output data for the neural network. But definitely, your answer helped me to take a more closer look. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants