提交 43cb38b8 authored 作者: Frederic's avatar Frederic

Add a theano flags that allow to raise the equilibrium max_use_ratio.

上级 f4b29ab6
...@@ -13,6 +13,14 @@ AddConfigVar('optdb.position_cutoff', ...@@ -13,6 +13,14 @@ AddConfigVar('optdb.position_cutoff',
'Where to stop eariler during optimization. It represent the position of the optimizer where to stop.', 'Where to stop eariler during optimization. It represent the position of the optimizer where to stop.',
FloatParam(numpy.inf), FloatParam(numpy.inf),
in_c_key=False) in_c_key=False)
#upgraded to 20 to avoid EquibriumOptimizer error
# to be max'ed out by constant folding (can
# I increase the max ratio only for
# constant folding somehow?
AddConfigVar('optdb.max_use_ratio',
'A ratio that prevent infinite loop in EquilibriumOptimizer.',
FloatParam(20),
in_c_key=False)
class DB(object): class DB(object):
def __hash__(self): def __hash__(self):
...@@ -168,10 +176,7 @@ class EquilibriumDB(DB): ...@@ -168,10 +176,7 @@ class EquilibriumDB(DB):
opts = super(EquilibriumDB, self).query(*tags, **kwtags) opts = super(EquilibriumDB, self).query(*tags, **kwtags)
return opt.EquilibriumOptimizer(opts, return opt.EquilibriumOptimizer(opts,
max_depth=5, max_depth=5,
max_use_ratio=20,#upgraded to 20 to avoid equibriumOptimizer max_use_ratio=config.optdb.max_use_ratio,
# to be max'ed out by constant folding (can
# I increase the max ratio only for
# constant folding somehow?
failure_callback=opt.NavigatorOptimizer.warn_inplace) failure_callback=opt.NavigatorOptimizer.warn_inplace)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论