Skip to content

Commit eb6042f

Browse files
author
Junpeng Lao
authored
Merge pull request #2232 from a-rodin/scaling-default-to-identity
WIP: replace Hessian scaling guessing by an identity matrix
2 parents c3afa00 + c4659b4 commit eb6042f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymc3/step_methods/hmc/base_hmc.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pymc3.model import modelcontext, Point
66
from .quadpotential import quad_potential
77
from pymc3.theanof import inputvars, make_shared_replacements
8+
import numpy as np
89

910

1011
class BaseHMC(ArrayStepShared):
@@ -41,7 +42,7 @@ def __init__(self, vars=None, scaling=None, step_scale=0.25, is_cov=False,
4142
vars = inputvars(vars)
4243

4344
if scaling is None and potential is None:
44-
scaling = model.test_point
45+
scaling = np.ones(model.dict_to_array(model.test_point).size)
4546

4647
if isinstance(scaling, dict):
4748
scaling = guess_scaling(Point(scaling, model=model), model=model, vars=vars)

0 commit comments

Comments
 (0)