/[marvin]/marvin/src/libnn/errorMlpnnVisitor.ml
ViewVC logotype

Diff of /marvin/src/libnn/errorMlpnnVisitor.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by matthieu, Sun Jul 27 22:06:33 2003 UTC revision 1.3 by srv89, Mon Jul 28 19:59:36 2003 UTC
# Line 37  Line 37 
37    
38  (**  (**
39    The errorCommonVisitor class    The errorCommonVisitor class
40      Computes each neurone's output error.
41    
42    @author Matthieu Lagacherie    @author Matthieu Lagacherie
43    @author Olivier Ricordeau    @author Olivier Ricordeau
# Line 51  open MlpNN Line 52  open MlpNN
52  class errorMlpnnVisitor =  class errorMlpnnVisitor =
53  object  object
54    inherit [mlpNN] errorVisitor    inherit [mlpNN] errorVisitor
55    
56    val mutable _transfertFunction = function x    val mutable _transfertFunction = function x
57        -> (1. /. (1. +. exp (-.x)))        -> (1. /. (1. +. exp (-.x)))
58    
59    val mutable _derivateFunction = function x    val mutable _derivateFunction = function x
60        -> (((1. /. (1. +. exp (-.x)))) *. (1. -. (1. /. (1. +. exp (-.x)))))        -> (((1. /. (1. +. exp (-.x)))) *. (1. -. (1. /. (1. +. exp (-.x)))))
61    
62    method visitMlpnn (network : mlpNN) =    method visitMlpnn (network : mlpNN) =
63      let error = network#getError and      let error = network#getError and
64        gradients = network#getGradients and        gradients = network#getGradients and
# Line 82  object Line 86  object
86                !error.(l).(i)                !error.(l).(i)
87                <- !error.(l).(i)                <- !error.(l).(i)
88                +. !error.(l + 1).(j) *. !weights.(l).(i).(j);                +. !error.(l + 1).(j) *. !weights.(l).(i).(j);
   
89                !gradients.(l).(i).(j)                !gradients.(l).(i).(j)
90                <- !error.(l + 1).(j) *. !outputActivation.(l).(i)                <- !error.(l + 1).(j) *. !outputActivation.(l).(i)
91              done;              done;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26