MATLAB Answers

Import patternnet into deep Q network

1 view (last 30 days)
Is it possible to import the trained patternnet in the neural network of deep reinforcement learning. I have already obtained the Pattern Recognition Neural Network using 'patternnet'. And I want to import the neural network as the neural network of DQN. Could you please drop me with some examples or exlain how to realize the above idea. Thank you very much.


Sign in to comment.

Accepted Answer

Emmanouil Tzorakoleftherakis
By 'patternnet' are you referring to this function? If yes, then this does not use the deep learning layer objects that work with Reinforcement Learning Toolbox. You would need to recreate this network with deep learning layers (it's a different API).
In general, if you have a trained network, you can use it as an RL policy assuming it is compatible with the algorithm you want to work with. See this example for instance, where imitation learning is used first to get an initial policy before training further with RL.


Kacjer Frank
Kacjer Frank on 17 Nov 2020
Thank you for your answer. I wondered if I can extract the weight and biases of the pattern recognition network and use it to build the neural network for deep reinforcement learning (specifically, deep Q network). As the pattern recognition network is a shallow neural with only one hidden layer, and it is similar to the structure of the neural network in DQN. So the API is applicable between each other (DQN and pattern recognition network), where the inputs are the same.
Thank you again for your time and help.
Emmanouil Tzorakoleftherakis
It should be possible. 'patternet' creates a network object, and all the weights and biased are accessible (see here). You can take these values, and then specify the layer weights when recreating the neural net as shown here.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!