Comments (2)
I made attempts at this before and ran into the same complexity. I actually think the best way to do is to write some java code to make a more clojure friendly DataSetIterator
from jutsu.ai.
I did something like this in parts
The snippet below takes "features" as a vector of maps,
and "y" as a vector of targets
and it will create an NDArray
and then a DataSet and then a DataSetIterator
which could be used with the existing method "train-net!"
(def data (Nd4j/create (into-array (map double-array (map vals features))))
(def labels (.transpose (Nd4j/create y)))
(def data-set (DataSet. data labels))
.. split "data-set" into test and train
(def dataset-iterator (ViewIterator. train-data-set 1000) 10))
What makes it complex, is that the logic of
- epochs
- batches vs. mini-batches
- in-memory vs stream data from disk
- test-train split
- normalization
is all
encapsulated or uses the DataSetIterator interface, so it has lots of implementations, and the user needs to be able to choose and configure them.
To have this functionality fully on the Clojure site, a lot of implementations of DatasetIterator
logic needed to be ported to Clojure:
https://deeplearning4j.org/api/latest/org/nd4j/linalg/dataset/api/iterator/DataSetIterator.html
And this code is very much state-full OO style, so hard to make functional.
But maybe a single function , implementing "one scenario",
like
(defn iterate-data [features (vector of maps) labels (vector) test-train-split-percentage num-batches num-epochs)
-> returns 2 data-set iterators (for train and test)
could be useful. And it would not required any change in existing methods, as they can already handle any DataSetIterator
from jutsu.ai.
Related Issues (10)
- Upgrading to DL4J 0.9.0 Breaks boot HOT 1
- Setup Travis
- Update ND4J version on README
- How can you load data from a vector HOT 4
- Example code not picking one of the classes
- use spec for checking configs
- Add Leiningen support for development HOT 1
- "boot night" not working HOT 1
- DL4J version seems to be 0.8.0 (still)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jutsu.ai.