Skip to content

MLP call invalid in Clojure API #822

@behrica

Description

@behrica

In here

https://github.com/haifengl/smile/blame/dc47673c97618fa9772a33a67a9f9ef3c2237650/clojure/src/smile/classification.clj#L213

the code fails with

Cannot invoke "clojure.lang.IFn.invoke(Object, Object, Object, Object)" because "null" is null

The following does work:

(let [net (smile.classification.MLP. builders)]
   (.setLearningRate net (smile.math.TimeFunction/linear 0.2 1000 0.1))
   (.setMomentum net (TimeFunction/constant 0.2))
   (.setWeightDecay net 0.1)
   (dotimes [i 10] (.update net x y))
   )

Very likely the

  ([x y builders] (mlp x y builders 10 0.1 0.0 0.0))

will not work any more neither, as it needs now TimeFunctions for the MLP params momentum and leariningRate

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions