This repository has been archived by the owner. It is now read-only.

Collection-like Ops are not working. #91

Closed
taisukeoe opened this Issue May 27, 2016 · 7 comments

Comments

Projects
None yet
5 participants
@taisukeoe
Contributor

taisukeoe commented May 27, 2016

testing with ND4J 0.4-rc3.9 in feature/0.4-rc3.9 branch

[info] NDArrayCollectionAPITest:
[info] CollectionLikeNDArray
[info] - should provides filter API *** FAILED ***
[info]   [[1.00, 2.00, 3.00],
[info]    [4.00, 5.00, 6.00],
[info]    [7.00, 8.00, 9.00]] did not equal [[0.00, 0.00, 0.00],
[info]    [4.00, 5.00, 6.00],
[info]    [7.00, 8.00, 9.00]] (NDArrayCollectionAPITest.scala:17)
[info] - should provides filter bitmask API *** FAILED ***
[info]   [[1.00, 2.00, 3.00],
[info]    [4.00, 5.00, 6.00],
[info]    [7.00, 8.00, 9.00]] did not equal [[0.00, 1.00, 0.00],
[info]    [1.00, 0.00, 1.00],
[info]    [0.00, 1.00, 0.00]] (NDArrayCollectionAPITest.scala:34)
[info] - should provides map API *** FAILED ***
[info]   [[1.00, 2.00, 3.00],
[info]    [4.00, 5.00, 6.00],
[info]    [7.00, 8.00, 9.00]] did not equal [[ 3.00,  5.00,  7.00],
[info]    [ 9.00, 11.00, 13.00],
[info]    [15.00, 17.00, 19.00]] (NDArrayCollectionAPITest.scala:51)

@taisukeoe taisukeoe referenced this issue May 27, 2016

Closed

0.4-rc3.9 release #90

3 of 5 tasks complete
@DaveDeCaprio

This comment has been minimized.

Show comment
Hide comment
@DaveDeCaprio

DaveDeCaprio Aug 16, 2016

I'm seeing this same issue with 5.0.0
println((1 to 9).toNDArray.map(_ + 0.5))
prints
[1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00, 9.00]

DaveDeCaprio commented Aug 16, 2016

I'm seeing this same issue with 5.0.0
println((1 to 9).toNDArray.map(_ + 0.5))
prints
[1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00, 9.00]

@agibsonccc

This comment has been minimized.

Show comment
Hide comment
@agibsonccc

agibsonccc Aug 17, 2016

Member

@DaveDeCaprio I don' have developers to put on this right now. You are welcome to send us a pull request.

Member

agibsonccc commented Aug 17, 2016

@DaveDeCaprio I don' have developers to put on this right now. You are welcome to send us a pull request.

@saudet

This comment has been minimized.

Show comment
Hide comment
@saudet

saudet Aug 17, 2016

Member

@DaveDeCaprio nd4j doesn't support custom ops written in Java (bytecode) anymore so it's unclear how we should support those operations for now.

Member

saudet commented Aug 17, 2016

@DaveDeCaprio nd4j doesn't support custom ops written in Java (bytecode) anymore so it's unclear how we should support those operations for now.

@DaveDeCaprio

This comment has been minimized.

Show comment
Hide comment
@DaveDeCaprio

DaveDeCaprio Aug 17, 2016

Thanks, yes I looked at fixing the issue but pretty quickly it became clear this was not a minor bug.

I have a library of primitives for doing very fast off heap computations in Scala. It uses specialization and a few other tricks to allow you to program functionally in Scala, but removing nearly all the overhead. I've used it with (your) JavaCV library. I may try to port it over to work with Nd4s.

DaveDeCaprio commented Aug 17, 2016

Thanks, yes I looked at fixing the issue but pretty quickly it became clear this was not a minor bug.

I have a library of primitives for doing very fast off heap computations in Scala. It uses specialization and a few other tricks to allow you to program functionally in Scala, but removing nearly all the overhead. I've used it with (your) JavaCV library. I may try to port it over to work with Nd4s.

@agibsonccc

This comment has been minimized.

Show comment
Hide comment
@agibsonccc

agibsonccc Aug 12, 2017

Member

Hey folks, we've largely decided not to support this for now. You can use boolean indexing and all of the masking operations. A large problem with the "map" operation is it's operating on 1: mutable objects. and 2: you're trying to change sizes. NDarrays aren't lists and shouldn't be treated as such.
You are welcome to propose something new maybe on top of the op executioner..but we should try to be a bit more specific about the apis.

Member

agibsonccc commented Aug 12, 2017

Hey folks, we've largely decided not to support this for now. You can use boolean indexing and all of the masking operations. A large problem with the "map" operation is it's operating on 1: mutable objects. and 2: you're trying to change sizes. NDarrays aren't lists and shouldn't be treated as such.
You are welcome to propose something new maybe on top of the op executioner..but we should try to be a bit more specific about the apis.

@javadba

This comment has been minimized.

Show comment
Hide comment
@javadba

javadba Mar 3, 2018

@agibsonccc I "get" that the shape can not change: that's reasonable. But .. disallowing one to one map operations? This is for my use cases (alternative to numpy/scikit learn) a showstopper flaw in usability of this library.

Can you point out where this could be fixed? Again just for 1-1 mapping.

In the interim I am at a loss of the usefulness of this project. Let's get at least this piece in. Again - I would be willling to help given some guidance.

javadba commented Mar 3, 2018

@agibsonccc I "get" that the shape can not change: that's reasonable. But .. disallowing one to one map operations? This is for my use cases (alternative to numpy/scikit learn) a showstopper flaw in usability of this library.

Can you point out where this could be fixed? Again just for 1-1 mapping.

In the interim I am at a loss of the usefulness of this project. Let's get at least this piece in. Again - I would be willling to help given some guidance.

@saudet

This comment has been minimized.

Show comment
Hide comment
@saudet

saudet Mar 4, 2018

Member

It needs to be fixed in libnd4j, by allowing callbacks from C++. It's something that is planned, but not started yet. If you feel comfortable with C++ and would like to give it a try, let us know and we'll provide guidance!

Member

saudet commented Mar 4, 2018

It needs to be fixed in libnd4j, by allowing callbacks from C++. It's something that is planned, but not started yet. If you feel comfortable with C++ and would like to give it a try, let us know and we'll provide guidance!

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