Working of an artificial neuron.

A program in Lisp to demonstrate working of an artificial neuron

tip853

 

What is artificial intelligence?

It is the science and engineering of making intelligent machines, especially intelligent computer programs. It is related to the similar task of using computers to understand human intelligence, but AI does not have to confine itself to methods that are biologically observable.

Intelligence is the computational part of the ability to achieve goals in the world. Varying kinds and degrees of intelligence occur in people, many animals and some machines.

[Source: http://www-formal.stanford.edu/jmc/whatisai/node1.html]

Assume:

Enter an input vector X and weight vector W. Calculate weighted sum XW. Transform this using signal or activation functions like logistic, threshold, hyperbolic-tangent, linear, exponential, sigmoid etc. and display the output.

Code:

(defun nnFunction (actSignlist wghtList c n)
(setq wghtSum 0)
(setq resFunc 0)
(loop
(when (equal (first actSignlist) nil) (return))
(setq wghtSum ( + wghtSum ( * (first actSignlist) (first
wghtList))))
(print wghtSum)
(setq actSignlist (rest actSignlist))
(print actSignlist)
(setq wghtList (rest wghtList))
(print wghtList)
)

(print “Hyperbolic Tangent Signal Function”)
(print ( tan ( * 10 wghtSum)))

(print “Threshold Linear Signal Function”)
(if  (<= 1 (* c wghtSum)) (print 1) (print 0))

(print “Linear Signal Function”)
(print (* c wghtSum))

(print “Logistical Signal Function”)
(print ( / 1 ( + 1 (exp( – 0 ( * c  wghtSum))))))

(print “Threshold Exponential Signal Function”)
(print ( min 1 (exp (* c wghtSum))))

)
Output:

1

2

 

Leave a Reply

Your email address will not be published.