Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCH does not return same results with fixed rand seed #28

Open
eltrompetero opened this issue May 2, 2021 · 0 comments
Open

MCH does not return same results with fixed rand seed #28

eltrompetero opened this issue May 2, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@eltrompetero
Copy link
Owner

The following code should always return the same solution, but it does not:

solver = MCH(X,
             sample_size=10_000,
             rng=np.random.RandomState(0),
             calc_observables=calc_observables,
             model=model,
             mch_approximation=mch_approximation)

# Define function for changing learning parameters as we converge.
def learn_settings(i):
    """
    Take in the iteration counter and set the maximum change allowed in any given 
    parameter (maxdlamda) and the multiplicative factor eta, where 
    d(parameter) = (error in observable) * eta.
    
    Additional option is to also return the sample size for that step by returning a 
    tuple. Larger sample sizes are necessary for higher accuracy.
    """
    return {'maxdlamda':exp(-i/5.)*.5,'eta':exp(-i/5.)*.5}

# Run solver.
solver.solve(initial_guess=model.multipliers,
             maxiter=30,
             custom_convergence_f=learn_settings,
             n_iters=500,
             burn_in=1_000);
@eltrompetero eltrompetero added the bug Something isn't working label May 2, 2021
@eltrompetero eltrompetero self-assigned this May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant