提交 2c57dd29 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Disabled some more old warnings in tests

上级 b4c10047
...@@ -254,17 +254,23 @@ def makeTester(name, op, expected, checks = {}, good = {}, bad_build = {}, ...@@ -254,17 +254,23 @@ def makeTester(name, op, expected, checks = {}, good = {}, bad_build = {},
def test_grad(self): def test_grad(self):
if skip: if skip:
raise SkipTest(skip) raise SkipTest(skip)
for testname, inputs in self.grad.items(): # Disable old warning that may be triggered by this test.
inputs = [copy(input) for input in inputs] backup = config.warn.config.warn.sum_div_dimshuffle_bug
inputrs = [value(input) for input in inputs] config.warn.config.warn.sum_div_dimshuffle_bug = False
try: try:
utt.verify_grad(self.op, inputs, mode=self.mode, rel_tol=_grad_rtol) for testname, inputs in self.grad.items():
except: inputs = [copy(input) for input in inputs]
type, exc_value, traceback = sys.exc_info() inputrs = [value(input) for input in inputs]
err_msg = "Test %s::%s: Error occurred while computing the gradient on the following inputs: %s" \ try:
% (self.op, testname, inputs) utt.verify_grad(self.op, inputs, mode=self.mode, rel_tol=_grad_rtol)
exc_value.args = exc_value.args + (err_msg, ) except:
raise type, exc_value, traceback type, exc_value, traceback = sys.exc_info()
err_msg = "Test %s::%s: Error occurred while computing the gradient on the following inputs: %s" \
% (self.op, testname, inputs)
exc_value.args = exc_value.args + (err_msg, )
raise type, exc_value, traceback
finally:
config.warn.config.warn.sum_div_dimshuffle_bug = backup
Checker.__name__ = name Checker.__name__ = name
return Checker return Checker
......
...@@ -493,7 +493,13 @@ def create(window_size=3, ...@@ -493,7 +493,13 @@ def create(window_size=3,
reconstruction_cost_function = quadratic, reconstruction_cost_function = quadratic,
tie_weights = False tie_weights = False
) )
model = architecture.make(input_size=input_dimension, input_representation_size=token_representation_size, hidden_representation_size=concatenated_representation_size, output_size=output_vocabsize, lr=lr, seed=seed, noise_level=noise_level, qfilter_relscale=qfilter_relscale, mode=compile_mode)
backup = config.warn.sum_div_dimshuffle_bug
config.warn.sum_div_dimshuffle_bug = False
try:
model = architecture.make(input_size=input_dimension, input_representation_size=token_representation_size, hidden_representation_size=concatenated_representation_size, output_size=output_vocabsize, lr=lr, seed=seed, noise_level=noise_level, qfilter_relscale=qfilter_relscale, mode=compile_mode)
finally:
config.warn.sum_div_dimshuffle_bug = backup
return model return model
def create_realistic(window_size=3,#7, def create_realistic(window_size=3,#7,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论