Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (def n3 (create-net [1 20 1] :bias true)) ; Создание сети
- (def x (range -2.0 2.0 0.01))
- (defn f [x]
- (if (neg? x)
- (* x (Math/sin (* 2 Math/PI x)))
- (+ (* (- x) (Math/sin (* Math/PI x)))
- (Math/exp (/ x 2))
- (- (Math/exp 0)))))
- (def train-set-approx (create-train-set f x))
- (def n3t (training 0.1 0.3 :sigmoid train-set-approx 200 n3))
- (view (xy-plot x (map f x)))
- (def results-approx (vec (apply concat (test-results x (:current-s n3t)))))
- (doto (scatter-plot x (map f x)
- :x-label "x"
- :y-label "y")
- (add-points x results-approx)
- view)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement