Group Abstract Group Abstract

Message Boards Message Boards

2
|
7.1K Views
|
6 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Change of hidden Layers in neural networks

Posted 5 years ago

Hello,

I am trying to do some machine learning with Mathematica. I loved the ease of use of variety of methods which allow me to test some models on my data. Unfortunately I also find it very limiting when it comes customizing the methods.

For NeuralNetwork, I couldn't find too much information about how to setup the number of hidden layers, number of nodes per layer, etc. The only information I found in the help file was NeuralDepth. I am not quite sure what it refers to.

Can you help me on how to customize the hidden layers of NN?

Thank you.

POSTED BY: Yeso Alde
6 Replies
Posted 5 years ago

Dear Rohit,

I think NetChain and relevant functions will work for me. I am really pleased to find that this didn't turn into a blackbox of blackmagic kind of thing:)

Your help is greatly appreciated.

POSTED BY: Yeso Alde
Posted 5 years ago

Hi Yesim,

That post from MSE is very old. The "HiddenLayers" sub-option for Predict has been removed. In that example "HiddenLayers" -> {4, 3, 3} means 3 fully connected linear layers with output vector sizes of 4, 3, 3.

If you want complete control over the NN then I suggest not using Predict with Method -> "NeuralNetwork". Instead build the network using specific layers in NetChain and NetGraph and then NetTrain. Each layer type has parameters that can be controlled and there are a lot of customization options for NetTrain. You will have to study the documentation.

NetChain[{4, 3, 3}] (* Equivalent to "HiddenLayers" -> {4, 3, 3} *)

You have not provided any details about the problem you are trying to solve so it is hard to provide more specific advice.

POSTED BY: Rohit Namjoshi
Posted 5 years ago

Dear Rohit,

Thank you for the link. they are truly wonderful net models which can easily be incorporated into many projects. It certainly motivated me for some other projects. However, the one at hand is a research project, so the details I am looking for are important to me.

I found something on the net regarding hidden layers https://mathematica.stackexchange.com/questions/64785/how-to-change-neuralnetwork-options Have these parameters been removed from Mathematica?

I bet MMA has some internal variables that keep this information.

POSTED BY: Updating Name
Posted 5 years ago
POSTED BY: Updating Name
Posted 5 years ago
POSTED BY: Rohit Namjoshi
Posted 5 years ago
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard