def init_params(options, preemb=None):
 params = OrderedDict()
 if (preemb == None):
  params['Wemb'] = norm_weight(options['n_words'], options['dim_word'])
 else:
  params['Wemb'] = preemb
 params = get_layer('ff')[0](options, params, prefix='ff_state', nin=options['dimctx'], nout=options['dim'])
 params = get_layer(options['decoder'])[0](options, params, prefix='decoder', nin=options['dim_word'], dim=options['dim'])
 if options['doutput']:
  params = get_layer('ff')[0](options, params, prefix='ff_hid', nin=options['dim'], nout=options['dim_word'])
  params = get_layer('ff')[0](options, params, prefix='ff_logit', nin=options['dim_word'], nout=options['n_words'])
 else:
  params = get_layer('ff')[0](options, params, prefix='ff_logit', nin=options['dim'], nout=options['n_words'])
 return params

def init_params ( options , preemb = None ) : params = OrderedDict ( ) if ( preemb == None ) : params [ 'Wemb' ] = norm_weight ( options [ 'n_words' ] , options [ 'dim_word' ] ) else : params [ 'Wemb' ] = preemb params = get_layer ( 'ff' ) [ 0 ] ( options , params , prefix = 'ff_state' , nin = options [ 'dimctx' ] , nout = options [ 'dim' ] ) params = get_layer ( options [ 'decoder' ] ) [ 0 ] ( options , params , prefix = 'decoder' , nin = options [ 'dim_word' ] , dim = options [ 'dim' ] ) if options [ 'doutput' ] : params = get_layer ( 'ff' ) [ 0 ] ( options , params , prefix = 'ff_hid' , nin = options [ 'dim' ] , nout = options [ 'dim_word' ] ) params = get_layer ( 'ff' ) [ 0 ] ( options , params , prefix = 'ff_logit' , nin = options [ 'dim_word' ] , nout = options [ 'n_words' ] ) else : params = get_layer ( 'ff' ) [ 0 ] ( options , params , prefix = 'ff_logit' , nin = options [ 'dim' ] , nout = options [ 'n_words' ] ) return params
initialize all parameters .