Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.
/ tfjs-cljs Public archive

A ClojureScript wrapper library for TensorFlow.js

License

Notifications You must be signed in to change notification settings

namenu/tfjs-cljs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tfjs-cljs

A ClojureScript wrapper library for TensorFlow.js.

Usage

Add a dependency to your project.clj.

Clojars Project

Example

Clojure idiomatic rewrite of linear regression example from #getting-started.

(def model
  (-> (models/sequential)
      (models/add (layers/dense {:units 1 :inputShape [1]}))
      (models/compile {:loss "meanSquaredError" :optimizer "sgd"})))

(let [xs     (tf/tensor2d [1 2 3 4] [4 1])
      ys     (tf/tensor2d [1 3 5 7] [4 1])]
  (.then (models/fit model xs ys config {:epochs 10})
         #(tf/print (models/predict model (tf/tensor2d [5] [1 1])))))

Should I use it?

No. This library only contains a subset of TensorFlow.js to the extent of my knowledge.

About

A ClojureScript wrapper library for TensorFlow.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published