MCPcopy Create free account
hub / github.com/algorithm-archivists/algorithm-archive / g

Function g

contents/metropolis/code/python/metropolis.py:20–22  ·  view source on GitHub ↗

Random step vector.

()

Source from the content-addressed store, hash-verified

18 return (a * np.exp(-b * (x - xs)**2)).sum(axis=0)
19
20def g():
21 '''Random step vector.'''
22 return np.random.uniform(-1,1)
23
24def metropolis_step(x, f=f, g=g):
25 '''Perform one full iteration and return new position.'''

Callers 1

metropolis_stepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected