Skip to content

Commit

Permalink
Removed prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Katrina Petroske committed Jul 27, 2018
1 parent 9689a42 commit 7d7cc26
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
9 changes: 4 additions & 5 deletions libensemble/alloc_funcs/inverse_bayes_allocf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ def only_persistent_gens_for_inverse_bayse(worker_sets, H, sim_specs, gen_specs,
# Then give back everything in the last batch
last_batch_inds = H['batch'][inds_generated_by_i]==np.max(H['batch'][inds_generated_by_i])
inds_to_send_back = np.where(np.logical_and(inds_generated_by_i,last_batch_inds))[0]
pdb.set_trace()
#if H['batch'][-1] > 0:
#n = gen_specs['subbatch_size']*gen_specs['num_subbatches']
#k = H['batch'][-1]
#H['weight'][(n*(k-1)):(n*k)] = H['weight'][(n*k):(n*(k+1))]
if H['batch'][-1] > 0:
n = gen_specs['subbatch_size']*gen_specs['num_subbatches']
k = H['batch'][-1]
H['weight'][(n*(k-1)):(n*k)] = H['weight'][(n*k):(n*(k+1))]
Work[i] = {'persis_info': persis_info[i],
'H_fields': ['like'],
'tag':EVAL_GEN_TAG,
Expand Down
4 changes: 0 additions & 4 deletions libensemble/gen_funcs/persistent_inverse_bayes.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ def persistent_updater_after_likelihood(H,persis_info,gen_specs,libE_info):
# Not sure why there are two comm.recv
libE_info = Work['libE_info']
calc_in = comm.recv(buf=None, source=0)
print('x = ',O['x'] )
print('prior = ', O['prior'])
print('prop = ', O['prop'])
print('calc_in = ', calc_in)
w = O['prior'] + calc_in['like'] - O['prop']


Expand Down
1 change: 0 additions & 1 deletion libensemble/sim_funcs/inverse_bayes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def likelihood_calculator(H, persis_info, sim_specs, libE_info):
"""
del libE_info # Ignored parameter
O = np.zeros(len(H['x']),dtype=sim_specs['out'])
print('x = ', H['x'])
for i,x in enumerate(H['x']):
O['like'][i] = six_hump_camel_func(x)

Expand Down
8 changes: 6 additions & 2 deletions libensemble/tests/regression_tests/inverse_bayes_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@

# Perform the run
H, persis_info, flag = libE(sim_specs, gen_specs, exit_criteria, alloc_specs=alloc_specs, persis_info=persis_info)
np.save('in_bayes_ex', H)


if MPI.COMM_WORLD.Get_rank() == 0:
# Change the last weights to correct values (H is a list on other cores and only array on manager)
ind = 2*gen_specs['subbatch_size']*gen_specs['num_subbatches']
H[-ind:] = H['prior'][-ind:] + H['like'][-ind:] - H['prop'][-ind:]
np.save('in_bayes_ex', H)
print(H)
#print(H.dtype)
print(H.dtype)

0 comments on commit 7d7cc26

Please sign in to comment.