提交 0213fc71 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Reduce the step size used for numerical gradient computation in float32.

上级 755cfd65
...@@ -4420,9 +4420,9 @@ class numeric_grad: ...@@ -4420,9 +4420,9 @@ class numeric_grad:
# For now, we use a heuristic that catches very bad gradients, but is not perfectly # For now, we use a heuristic that catches very bad gradients, but is not perfectly
# accurate. # accurate.
type_eps = {'float64': 1e-7, type_eps = {'float64': 1e-7,
'float32': 3e-3, 'float32': 3e-4,
numpy.dtype('float64'):1e-7, numpy.dtype('float64'):1e-7,
numpy.dtype('float32'):3e-3} numpy.dtype('float32'):3e-4}
def __init__(self, f, pt, eps=None): def __init__(self, f, pt, eps=None):
"""Return the gradient of f at pt. """Return the gradient of f at pt.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论