1- var r = Object . defineProperty ; var p = ( l , t ) => r ( l , "name" , { value :t , configurable :! 0 } ) ; import * as o from "../../lib/model/nns/optimizer.js" ; const i = { abs :{ } , clip :{ min :0 , max :1 } , conv :{ kernel :5 , channel :16 } , dropout :{ drop_rate :.5 } , exp :{ } , flatten :{ } , full :{ size :10 , a :"sigmoid" } , gaussian :{ } , leaky_relu :{ a :.1 } , identity :{ } , log :{ } , mean :{ axis :0 } , negative :{ } , relu :{ } , reshape :{ size :[ 1 , 1 ] } , sigmoid :{ } , softmax :{ } , softplus :{ } , softsign :{ } , sparsity :{ rho :.02 } , square :{ } , sqrt :{ } , sum :{ axis :0 } , tanh :{ } , transpose :{ axis :[ 1 , 0 ] } , variance :{ axis :0 } } , m = { props :[ "modelValue" ] , template :`
1+ var r = Object . defineProperty ; var n = ( l , t ) => r ( l , "name" , { value :t , configurable :! 0 } ) ; import * as m from "../../lib/model/nns/optimizer.js" ; const p = { abs :{ } , clip :{ min :0 , max :1 } , conv :{ kernel :5 , channel :16 } , dropout :{ drop_rate :.5 } , exp :{ } , flatten :{ } , full :{ size :10 , a :"sigmoid" } , gaussian :{ } , leaky_relu :{ a :.1 } , identity :{ } , log :{ } , mean :{ axis :0 } , negative :{ } , relu :{ } , reshape :{ size :[ 1 , 1 ] } , sigmoid :{ } , softmax :{ } , softplus :{ } , softsign :{ } , sparsity :{ rho :.02 } , square :{ } , sqrt :{ } , sum :{ axis :0 } , tanh :{ } , transpose :{ axis :[ 1 , 0 ] } , variance :{ axis :0 } } , s = { props :[ "modelValue" ] , template :`
22 <div style="display: inline-flex; align-items: flex-end;">
33 <input v-if="modelValue?.length < 10" type="button" value="+" v-on:click="modelValue.push(0)">
44 <div>
@@ -8,7 +8,7 @@ var r=Object.defineProperty;var p=(l,t)=>r(l,"name",{value:t,configurable:!0});i
88 </div>
99 </div>
1010 </div>
11- ` } , s = { setup ( ) { const l = Vue . ref ( [ { type :"full" , size :10 , a :"sigmoid" , poly_pow :2 } ] ) ; return { layers :l , changeType :p ( function ( e ) { const n = { type :l . value [ e ] . type , ...i [ l . value [ e ] . type ] } ; l . value . splice ( e , 1 , n ) } , "changeType" ) , addLayer :p ( function ( ) { l . value . push ( { type :"full" , size :10 , a :"sigmoid" , poly_pow :2 } ) } , "addLayer" ) } } , data :p ( function ( ) { return { layerTypeNames :Object . keys ( i ) , activations :[ "sigmoid" , "tanh" , "relu" , "leaky_relu" , "softsign" , "softplus" , "identity" , "polynomial" , "abs" , "gaussian" , "softmax" ] } } , "data" ) , template :`
11+ ` } , o = { setup ( ) { const l = Vue . ref ( [ { type :"full" , size :10 , a :"sigmoid" , poly_pow :2 } ] ) ; return { layers :l , changeType :n ( function ( e ) { const i = { type :l . value [ e ] . type , ...p [ l . value [ e ] . type ] } ; l . value . splice ( e , 1 , i ) } , "changeType" ) , addLayer :n ( function ( ) { l . value . push ( { type :"full" , size :10 , a :"sigmoid" , poly_pow :2 } ) } , "addLayer" ) } } , data :n ( function ( ) { return { layerTypeNames :Object . keys ( p ) , activations :[ "sigmoid" , "tanh" , "relu" , "leaky_relu" , "softsign" , "softplus" , "identity" , "polynomial" , "abs" , "gaussian" , "softmax" ] } } , "data" ) , template :`
1212 <div style="display: inline-flex; align-items: flex-end;">
1313 <input type="button" value="+" v-on:click="addLayer">
1414 <div>
@@ -63,4 +63,4 @@ var r=Object.defineProperty;var p=(l,t)=>r(l,"name",{value:t,configurable:!0});i
6363 </div>
6464 </div>
6565 </div>
66- ` } ; export default class y { static { p ( this , "NeuralNetworkBuilder" ) } constructor ( ) { this . _app = Vue . createApp ( { } ) , this . _app . component ( "array_attr" , m ) , this . _app . component ( "mlp_model" , s ) , this . _vue = null , this . _name = Math . random ( ) . toString ( 32 ) . substring ( 2 ) } get layers ( ) { const t = this . _vue ?this . _vue . $refs . layerselm . layers :[ { type :"full" , size :10 , a :"sigmoid" } ] , a = [ ] ; for ( let e = 0 ; e < t . length ; e ++ ) t [ e ] . type === "full" ?( a . push ( { type :"full" , out_size :t [ e ] . size } ) , a . push ( { type :t [ e ] . a , n :t [ e ] . poly_pow } ) ) :a . push ( t [ e ] ) ; return a } get invlayers ( ) { const t = this . layers , a = [ ] ; for ( let e = t . length - 1 ; e >= 0 ; e -= 2 ) a . push ( t [ e - 1 ] , t [ e ] ) ; return a } get optimizer ( ) { return this . _opt && this . _opt . property ( "value" ) } makeHtml ( t , { optimizer :a = ! 1 } = { } ) { t . append ( "span" ) . attr ( "id" , `mlp_model_${ this . _name } ` ) . append ( "mlp_model" ) . attr ( "ref" , "layerselm" ) , this . _vue = this . _app . mount ( `#mlp_model_${ this . _name } ` ) , a && ( t . append ( "span" ) . text ( " Optimizer " ) , this . _opt = t . append ( "select" ) . attr ( "name" , "optimizer" ) , this . _opt . selectAll ( "option" ) . data ( Object . keys ( o ) ) . enter ( ) . append ( "option" ) . property ( "value" , e => e ) . text ( e => e ) , this . _opt . property ( "value" , "adam" ) ) } }
66+ ` } ; export default class y { static { n ( this , "NeuralNetworkBuilder" ) } constructor ( ) { this . _app = Vue . createApp ( { } ) , this . _app . component ( "array_attr" , s ) , this . _app . component ( "nn_model" , o ) , this . _vue = null , this . _name = Math . random ( ) . toString ( 32 ) . substring ( 2 ) } get layers ( ) { const t = this . _vue ?this . _vue . $refs . layerselm . layers :[ { type :"full" , size :10 , a :"sigmoid" } ] , a = [ ] ; for ( let e = 0 ; e < t . length ; e ++ ) t [ e ] . type === "full" ?( a . push ( { type :"full" , out_size :t [ e ] . size } ) , a . push ( { type :t [ e ] . a , n :t [ e ] . poly_pow } ) ) :a . push ( t [ e ] ) ; return a } get invlayers ( ) { const t = this . layers , a = [ ] ; for ( let e = t . length - 1 ; e >= 0 ; e -= 2 ) a . push ( t [ e - 1 ] , t [ e ] ) ; return a } get optimizer ( ) { return this . _opt && this . _opt . property ( "value" ) } makeHtml ( t , { optimizer :a = ! 1 } = { } ) { const e = t . span ( ) ; e . element . id = `nn_model_${ this . _name } ` ; const i = document . createElement ( "nn_model" ) ; i . setAttribute ( "ref" , "layerselm" ) , e . element . append ( i ) , this . _vue = this . _app . mount ( `#nn_model_${ this . _name } ` ) , a && t . span ( ) . select ( { label :" Optimizer " , values :Object . keys ( m ) , value :"adam" } ) } }
0 commit comments