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

RL tutorial example error #2849

Closed
pogo85 opened this issue Feb 25, 2021 · 3 comments · Fixed by #2893
Closed

RL tutorial example error #2849

pogo85 opened this issue Feb 25, 2021 · 3 comments · Fixed by #2893

Comments

@pogo85
Copy link

pogo85 commented Feb 25, 2021

Problem location

https://www.mlpack.org/doc/stable/doxygen/rltutorial.html

Description of problem

When I try to run the example using the custom FFN network, it throws:
error: 'class mlpack::ann::FFN<mlpack::ann::MeanSquaredError<>, mlpack::ann::GaussianInitialization>' has no member named 'ResetNoise'
but works when using SimpleDQN class.

@zoq
Copy link
Member

zoq commented Feb 26, 2021

Thanks for the info, the FFN does not implement the ResetNoise method, I'll update the tutorial.

@heisenbuug
Copy link
Contributor

Heyy @zoq
What's the solution here? Do we implement the method?

@gunnxx
Copy link
Contributor

gunnxx commented Mar 28, 2021

@heisenbuug
QLearning expects an object which has ResetNoise method (e.g. SimpleDQN, DuelingDQN) because it calls the method during training. You are passing an FFN object (which has no ResetNoise method) to QLearning. The solution is to wrap your FFN object to a DQN object.

FFN<MeanSquaredError<>, GaussianInitialization> network(
        MeanSquaredError<>(), GaussianInitialization(0, 0.001));
network.Add<Linear<>>(4, 128);
network.Add<ReLULayer<>>();
network.Add<Linear<>>(128, 128);
network.Add<ReLULayer<>>();
network.Add<Linear<>>(128, 2);
SimpleDQN<> model(network);

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

Successfully merging a pull request may close this issue.

4 participants