def set_weights(net, model_file):
 with open(model_file) as f:
  print ('Load pretrained weights from %s...' % model_file)
  model = pickle.load(f)
 print 'Set the weights...'
 lasagne.layers.set_all_param_values(net, model, trainable=True)

def set_weights ( net , model_file ) : with open ( model_file ) as f : print ( 'Load pretrained weights from %s...' % model_file ) model = pickle . load ( f ) print 'Set the weights...' lasagne . layers . set_all_param_values ( net , model , trainable = True )
sets the parameters of the model using the weights stored in model_file parameters net: a lasagne layer model_file: string path to the model that containes the weights returns none .