Skip to content
This repository was archived by the owner on Jul 10, 2021. It is now read-only.
This repository was archived by the owner on Jul 10, 2021. It is now read-only.

1D Convolutions support? #96

@ddofer

Description

@ddofer

Hi,
I'm trying out your (lovely) package on non image data, and would like to try using convolutions - I see that currently only 2D convolutions are supported, any chance of adding in 1D support/for non image/square data?

(i.e As my first layer I tried:
Convolution("Rectifier", channels=32, kernel_shape=(1,1))
)

'AssertionError: Input array is not in image shape, and could not assume a square.'

Thanks!

Activity

alexjc

alexjc commented on Jun 28, 2015

@alexjc
Member

1D convolutions work already, there's a test for it. The problem here is that you want to apply the convolution over a 2D image but you're giving the NN a 1D array, and it can't figure out what size you mean. (It tries to guess square, but your data is not square.)

Try reshaping your inputs?

EDIT: In case you want to convolve over a 1D image, you still need to specify either (N, 1) or (1, N) as an array size—just like the kernel you have is 2D.

ddofer

ddofer commented on Jun 28, 2015

@ddofer
Author

I am using a 1d array of features.. ;
So, The solution is to reshape the features (X) into a square? Ok, thanks.
On Jun 28, 2015 2:33 PM, "Alex J. Champandard" notifications@github.com
wrote:

1D convolutions work already, there's a test for it. The problem here is
that you want to apply the convolution over a 2D image but you're giving
the NN a 1D array, and it can't figure out what size you mean.

Try reshaping your inputs?


Reply to this email directly or view it on GitHub
#96 (comment)
.

alexjc

alexjc commented on Jun 28, 2015

@alexjc
Member

If you have a (1,1) kernel you can use any input shape as long as it's 2D!

ddofer

ddofer commented on Jul 17, 2015

@ddofer
Author

By "N", do you mean a string input, or an integer with a preset size?

alexjc

alexjc commented on Jul 18, 2015

@alexjc
Member

I mean an integer with preset size that matches your data.

elenacuoco

elenacuoco commented on Aug 11, 2015

@elenacuoco

Hi,
I have the same request. Your package is really useful. I did not understand how to use conv1D in your package. I'm looking for something like Conv1D in Lasagne (http://lasagne.readthedocs.org/en/latest/modules/layers/conv.html),without reshaping the data...

alexjc

alexjc commented on Aug 12, 2015

@alexjc
Member

I will have to look at this and add a test or two. Thanks for the feedback!

alexjc

alexjc commented on Nov 20, 2015

@alexjc
Member

We use Lasagne now, I'd consider adding this if there's enough interest!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alexjc@elenacuoco@ddofer

        Issue actions

          1D Convolutions support? · Issue #96 · aigamedev/scikit-neuralnetwork