This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-03
Channels
- # announcements (2)
- # babashka (15)
- # beginners (40)
- # calva (11)
- # cherry (2)
- # cider (3)
- # cljsrn (2)
- # clojure (37)
- # clojure-austin (4)
- # clojure-europe (2)
- # clojurescript (16)
- # core-async (1)
- # datomic (25)
- # hyperfiddle (18)
- # jobs-discuss (9)
- # nbb (7)
- # off-topic (19)
- # pathom (6)
- # podcasts-discuss (4)
- # portal (37)
- # practicalli (1)
- # re-frame (11)
- # releases (1)
- # scittle (13)
- # shadow-cljs (6)
I used Scittle to embed this little digit recognition widget in https://matthewdowney.github.io/clojure-neural-networks-from-scratch-mnist I wrote up with some notes on getting started with neural nets. Very convenient to do this using Scittle instead of a whole cljs project because it was < 100 loc.
Wonderful!! It may be worth exploring in combination with @UDRJMEFSN's https://github.com/cnuernber/tmdjs (DataFrame and Numerics for ClojureScript). tmdjs does seem to work well with Scittle (currently this is supported by the https://github.com/scicloj/scittle, but should be also doable in the original Scittle itself using the new https://clojurians.slack.com/archives/C034FQN490E/p1683142333100929?thread_ts=1682156428.196199&cid=C034FQN490E). I'd be happy to help exploring that.
This is amazing @UP7RM6935!
Didn't realize mnist could be reduced down to:
(defn sigmoid [n] (/ 1.0 (+ 1.0 (Math/exp (- n)))))
(defn feedforward [inputs weights biases]
(for [[b ws :as _neuron] (map vector biases weights)]
(let [weighted-input (reduce + (map * inputs ws))]
(sigmoid (+ b weighted-input)))))
(defn argmax [numbers]
(let [idx+val (map-indexed vector numbers)]
(first (apply max-key second idx+val))))
(defn digit [pixels]
(-> pixels (feedforward w0 b0) (feedforward w1 b1) argmax))
That's what I love about clojure/lisp though. Implementing a solution in Clojure makes the whole problem easier for me to understand. Thanks for putting this together
> OpenAI: Hey there son, you gotta license for those there sufficiently powerful Clojure functions?
@U066L8B18 cool, tmdjs looks like a lifesaver for tackling "real" data tasks in JS
thanks @U050PJ2EU! i was also surprised by how concise the inference could be. a friend showed me his c# implementation and i was like, oh, this seems like something i could actually figure out, at least at a basic level, without reading a whole textbook haha
@U9G5NDV4Y haha yeah it's a bit of a hack, i gave up on mobile after a few attempts to make the https://github.com/matthewdowney/clojure-neural-networks-from-scratch/blob/main/mnist-scittle/canvas.js file handle the mobile touch / move events