I am working on creating a NN with the following architecture:

Input layer (180 neurons)
Hidden Layer 1 (18 neurons)
Hidden Layer 2 (4 neurons)
Output Layer (1 neuron)

I am trying to figure out the best tool for assembling this NN such that it is not fully connected.

I would like to have the input layer NOT fully connected to Hidden Layer 1, and Hidden Layer 1 NOT fully connected to Hidden Layer 2. I believe these would be considered convolutional layers, but I am having trouble finding a python tool that allows me to specify connections.

Does anyone know of a python tool appropriate for this?


Example of selective connections structure I'm looking to achieve

enter image description here

  • $\begingroup$ If you want to create a neural network with convolutional layers (i.e. a convolutional neural network) you can use any of the popular machine learning/neural network libraries (e.g. tensorflow, keras, or pytorch). However, you do specify the number of neurons in the hidden layers, which you later mention would likely be convolutional layers, so I am not exactly sure if that's what you're looking for. $\endgroup$
    – Oxbowerce
    Jan 6, 2023 at 14:51
  • $\begingroup$ I've been mostly in Sklearn and starting to look at keras right now, but I've added an example to my question of the architecture I'm looking to achieve. I think this might help clarify what I'm after $\endgroup$
    – jros
    Jan 6, 2023 at 15:00
  • 1
    $\begingroup$ Based on the image you added this would not be a convolutional layer, but a non-fully connected linear layer. You should be able to achieve something like this in the pytorch framework, a quick search provided me the following answer on stackoverflow. $\endgroup$
    – Oxbowerce
    Jan 6, 2023 at 18:55


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.