Coder Social home page Coder Social logo

nd4clj's People

Contributors

ds923y avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mikera hswick whilo

nd4clj's Issues

mmul not working ?

Hello. I'm experiencing an issue with mmul.
When I do (mmul v1 v2) it throws me an java.lang.ArrayIndexOutOfBoundsException: 1

But doing things like (.mmul (.a v1) (.transpose (.a v2))) works fine.
I'm using ND4J 7.2. I do not know if the version of ND4J plays a role here.

Dependency Issue

Upon trying out this library I ran into this error when requiring nd4clj

Unhandled java.io.FileNotFoundException
Could not locate clojure/core/matrix/compliance_tester__init.class
or clojure/core/matrix/compliance_tester.clj on classpath. Please
check that namespaces with dashes use underscores in the Clojure
file name.

I was able to resolve this error by adding this line to project.clj

:profiles {:dev {:dependencies [[net.mikera/core.matrix "0.53.0" :classifier "tests"]]
}}

As I don't think this is intended I believe [clojure.core.matrix.compliance-tester :as ct] needs to be taken out of the require expression

Issue With Dependencies?

I was recently trying to utilize this library in conjunction with org.clojure.core.matrix for the deeplearning4j library but it seems that the clojar is possibly out of date? With a project.clj :dependencies of just:

[[org.clojure/clojure "1.8.0"]
  [org.deeplearning4j/deeplearning4j-core "0.9.1"]
  [org.nd4j/nd4j-native "0.9.1"]
  [org.clojars.ds923y/nd4clj "0.1.1-SNAPSHOT"]]

I was getting errors for missing matrix 0.51.1:

Caused by: org.sonatype.aether.resolution.DependencyResolutionException:
Could not find artifact net.mikera:core.matrix:jar:0.51.1-SNAPSHOT in clojars (https://clojars.org/repo/)

I was able to get around this by cloning this repo and running lein install. Possibly the clojars is still the 0.1.0 version?

Handling for arrays of dimesionality 0 (scalar) and 1 (vector)

Thanks for a great start on a ND4J librray for Clojure!

Having had a play with the code, I think this biggest immediate issue is how to handle arrays with diminsionality 0 and 1. ND4J seems to assume that everything has a rank of 2 or above. This seems to be a design flaw on the part of ND4J, to fix it we need to ensure that shape and dimensionality are correct in the Clojure side.

Example:

(.shape (array :nd4j [1 2]))
=> [1, 2]

In core.matrix terms, the shape should be simply [2], i.e. with a dimensionality of 1

I've fixed dimensionality and shape in my branch (https://github.com/mikera/nd4clj) however there are still a lot of other errors in the compliance tests after these changes - most probably because the other functions aren't handling shape correctly. Let me know if you want a PR

Reflection warnings

I'm getting a lot of reflection warnings with nd4clj

Reflection warning, nd4clj/kiw.clj:26:9 - call to method get can't be resolved (target class is unknown).
Reflection warning, nd4clj/kiw.clj:43:16 - reference to field minNumber can't be resolved.
Reflection warning, nd4clj/kiw.clj:43:33 - reference to field maxNumber can't be resolved.
Reflection warning, nd4clj/kiw.clj:59:16 - reference to field minNumber can't be resolved.
Reflection warning, nd4clj/kiw.clj:59:33 - reference to field maxNumber can't be resolved.
Reflection warning, nd4clj/kiw.clj:63:27 - call to method size can't be resolved (target class is unknown).
Reflection warning, nd4clj/kiw.clj:64:67 - call to method slice can't be resolved (target class is unknown).
Reflection warning, nd4clj/kiw.clj:69:46 - call to static method concat on org.nd4j.linalg.factory.Nd4j can't be resolved (argument types: int, unknown).
Reflection warning, nd4clj/kiw.clj:69:112 - reference to field shape can't be resolved.
Reflection warning, nd4clj/kiw.clj:69:98 - call to method reshape can't be resolved (target class is unknown).
Reflection warning, nd4clj/kiw.clj:71:38 - reference to field shape can't be resolved.

Reflection is very expensive in Clojure, so it would be good to fix these. They may also be masking other issues. Usually they can be fixed with either:

  • A primitive cast like (int i) for an argument to a Java method
  • Adding an appropriate type hint

File not found exception

Requiring nd4clj into my project results in this error:
Error compiling: nd4clj/matrix.clj:1:1 Could not locate
clojure/core/matrix/compliance_tester__init.class or
clojure/core/matrix/compliance_tester.clj on classpath. Please
check that namespaces with dashes use underscores in the Clojure
file name.

core.matrix is installed on my machine, and it is version 0.56.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.