Keras LocallyConnected1D Level

I have a very specific problem that I am trying to solve. It seems very simple, but I can't seem to implement it in keras. For example, I have input_dim = 300. On which I have to apply a filter of size 100 with a step of 100. So basically use each of the 100 columns of the vector independently and then apply activation on each one. So, I have 3 outputs that will then be connected to a fully connected layer, which I know how to do. I've tried googling and referencing Keras documentation, but it's very unclear what the parameter values ​​would be. I'm sorry if the question is a little vague. it looks something like this

I would also like to add that this is one way I could think of to get the configuration shown in the picture. Something like 3 perceptrons connected to form a layer, and then connected to another dense layer. But there may be other ways as well.

+3


source to share


1 answer


Apparently I had the exit form all wrong. Once you make sure the filter is 100 and the pitch is 100, it is obvious, and it is also obvious that keras has an activation level of 3. The first parameter, on the other hand, maybe (I don't know, t tried this) is about depth filter if each input neuron is multivariate. Something like RGB values. Now why it's still called 1D, well I'm not sure. Possibly because the arrangement of neurons is still 1D. But this is how you do it.



model.add(LocallyConnected1D(1, 100, strides=100, input_shape=(300, 1)))

      

0


source







All Articles