ds923y / nd4clj Goto Github PK
View Code? Open in Web Editor NEWA Fast Standard (core.matrix) Clojure Library Using Nd4j
License: Eclipse Public License 1.0
A Fast Standard (core.matrix) Clojure Library Using Nd4j
License: Eclipse Public License 1.0
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.
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
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?
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
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:
(int i)
for an argument to a Java methodRequiring 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.