Skip to content

Commit

Permalink
ES enhancements (not sucessful)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akon32 committed Jul 9, 2023
1 parent 690dc23 commit d99e45a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions py/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def random_inds(arr, ratio):
size = arr.shape[0]
return np.random.choice(range(size), math.ceil(size * ratio), False)

score_sum = 0.0
scores = []
for _ in range(n_eval):
mus_inds = random_inds(mus_instruments, mus_ratio)
att_inds = random_inds(att_places, att_ratio)
Expand All @@ -132,9 +132,11 @@ def random_inds(arr, ratio):
att_tastes[att_inds],
pillar_center_radius[pillar_inds] if len(pillar_inds) > 0 else np.array([]),
use_playing_together_ext)
score_sum += sc
scores.append(sc)
scores = np.array(scores)
score_avg = scores.mean() - 1 * scores.std()

return score_sum / n_eval / mus_ratio / att_ratio
return score_avg / mus_ratio / att_ratio


def musicians_out_of_scene_penalty(scene: Stage, mus_places_volumes: np.ndarray) -> float:
Expand Down
1 change: 1 addition & 0 deletions py/solving.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def gen_one():

for solution in population:
sol_score = call_score(solution)
current_score = call_score(current_solution)
if sol_score[0] > current_score[0] and (step < step_count * 0.7 or sol_score[1] >= current_score[1]):
current_solution = solution
current_score = sol_score
Expand Down

0 comments on commit d99e45a

Please sign in to comment.