File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -935,6 +935,7 @@ export default class NeuralNetwork {
935935 */
936936 toFunction ( ) {
937937 const activation = this . activation ;
938+ const leakyReluAlpha = this . leakyReluAlpha ;
938939 let needsVar = false ;
939940 function nodeHandle ( layers , layerNumber , nodeKey ) {
940941 if ( layerNumber === 0 ) {
@@ -964,7 +965,7 @@ export default class NeuralNetwork {
964965 }
965966 case 'leaky-relu' : {
966967 needsVar = true ;
967- return `((v=${ result . join ( '' ) } )<0?0:0.01 *v)` ;
968+ return `((v=${ result . join ( '' ) } )<0?0:${ leakyReluAlpha } *v)` ;
968969 }
969970 case 'tanh' :
970971 return `Math.tanh(${ result . join ( '' ) } )` ;
@@ -990,4 +991,4 @@ export default class NeuralNetwork {
990991
991992 return new Function ( 'input' , `${ needsVar ? 'var v;' : '' } return ${ result } ;` ) ;
992993 }
993- }
994+ }
You can’t perform that action at this time.
0 commit comments