Skip to content

Instantly share code, notes, and snippets.

@hexgnu
Last active December 1, 2016 15:06
Show Gist options
  • Save hexgnu/3f5c7672c59ce5c3661909dcd007c589 to your computer and use it in GitHub Desktop.
Save hexgnu/3f5c7672c59ce5c3661909dcd007c589 to your computer and use it in GitHub Desktop.
(require plot)
(plot-font-size 24)
(plot-width 800)
(plot-height 800)
(plot
(list
(function (lambda (x) (- (/ 2 (+ 1 (exp (* -2 x)))) 1)) -5 5 #:color 'black #:style 1 #:label "Sigmoid")
(function (lambda (x) (- (/ 2 (exp (sqr x))) 1)) -5 5 #:style 2 #:color 'black #:label "Gaussian")
(function (lambda (x) (/ x (+ 1 (abs x)))) -5 5 #:label "Elliott" #:style 3 #:color 'black)
(function (lambda (x) -1) -5 0 #:label "Threshold" #:style 5 #:color 'black)
(function (lambda (x) 1) 0 5 #:style 5 #:color 'black)
(function (lambda (x) x) -1 1 #:label "Linear" #:style 4 #:color 'black)
) #:y-min -1.1 #:y-max 1.1 #:x-label "Weighted Sum" #:y-label "Output to Next Layer"
)
(plot
(list
(function cos -5 5 #:label "Cosine" #:style 1 #:color 'black)
(function sin -5 5 #:label "Sine" #:style 2 #:color 'black)
) #:x-label "Weighted Sum" #:y-label "Output to Next Layer"
)
(plot
(list
(function (lambda (x) (/ 1 (+ 1 (exp (* -2 x))))) -5 5 #:color 'black #:style 1 #:label "Sigmoid")
(function (lambda (x) (/ 1 (exp (sqr x)))) -5 5 #:style 2 #:color 'black #:label "Exponential")
(function (lambda (x) (+ 0.5 (/ (* 0.5 x) (+ 1 (abs x))))) -5 5 #:label "Elliott" #:style 3 #:color 'black)
(function (lambda (x) 0) -5 0 #:label "Threshold" #:style 5 #:color 'black)
(function (lambda (x) 1) 0 5 #:style 5 #:color 'black)
(function (lambda (x) x) 0 1 #:label "Linear" #:style 4 #:color 'black)
) #:y-min -0.1 #:y-max 1.1 #:x-label "Weighted Sum" #:y-label "Output to Next Layer"
)
(plot
(list
(function (lambda (x) (+ 0.5 (/ (cos x) 2))) -5 5 #:label "Cosine" #:style 1 #:color 'black)
(function (lambda (x) (+ 0.5 (/ (sin x) 2))) -5 5 #:label "Sine" #:style 2 #:color 'black)
) #:x-label "Weighted Sum" #:y-label "Output to Next Layer"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment