本文整理汇总了Python中solver.Solver.save_best_model方法的典型用法代码示例。如果您正苦于以下问题:Python Solver.save_best_model方法的具体用法?Python Solver.save_best_model怎么用?Python Solver.save_best_model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类solver.Solver
的用法示例。
在下文中一共展示了Solver.save_best_model方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: train
# 需要导入模块: from solver import Solver [as 别名]
# 或者: from solver.Solver import save_best_model [as 别名]
def train(param=PARAMS, sv=SOLVE, small=False):
sv['name'] = 'TEST'
input_var = raw_input('Are you testing now? ')
if 'no' in input_var:
sv.pop('name')
else:
sv['name'] += input_var
#out = u.get(6,small=True, aug=True)
imgs, ll = load_rnn_pk(files)
imgs = imgs.reshape((-1,1,256,256))
ll = ll.reshape((-1,1,256,256))
datas = u.prepare_set(imgs, ll)
out = u.create_iter(*datas, batch_size=5)
net = cnn_net(
use_logis=True
)
param['eval_data'] = out[1]
s = Solver(net, out[0], sv, **param)
s.train()
s.predict()
s.all_to_png()
s.save_best_model()
s.plot_process()
示例2: train
# 需要导入模块: from solver import Solver [as 别名]
# 或者: from solver.Solver import save_best_model [as 别名]
def train(param=PARAMS, sv=SOLVE, small=False):
sv['name'] = 'TEST'
input_var = raw_input('Are you testing now? ')
if 'no' in input_var:
sv.pop('name')
else:
sv['name'] += input_var
out = get(6, small=True, aug=True)
net = net()
param['eval_data'] = out['eval']
s = Solver(net, out['train'], sv, **param)
s.train()
s.predict()
s.all_to_png()
s.save_best_model()
s.plot_process()