File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,19 +148,23 @@ void add_log(Boxoban* env) {
148148 float perf ;
149149 float score ;
150150 float targets_hit = 0.0f ;
151+ if (env -> n_targets > 0 ) {
152+ targets_hit = (float )env -> on_target / (float )env -> n_targets ;
153+ }
151154 if (env -> curriculum_mode ) {
152155 score = 0.0f ;
153156 if (env -> largest_solved_difficulty >= 0 ) {
154157 score = (float )(env -> largest_solved_difficulty + 1 );
155158 }
156- perf = score / (float )BOXOBAN_INCREMENTAL_NUM_DIFFICULTIES ;
159+ if (score >= (float )BOXOBAN_INCREMENTAL_NUM_DIFFICULTIES ) {
160+ perf = 1.0f ;
161+ } else {
162+ perf = (score + targets_hit ) / (float )BOXOBAN_INCREMENTAL_NUM_DIFFICULTIES ;
163+ }
157164 } else {
158165 perf = (env -> win == 1 ) ? 1.0f : 0.0f ;
159166 score = perf ;
160167 }
161- if (env -> n_targets > 0 ) {
162- targets_hit = (float )env -> on_target / (float )env -> n_targets ;
163- }
164168 env -> log .perf += perf ;
165169 env -> log .score += score ;
166170 env -> log .episode_length += env -> tick ;
You can’t perform that action at this time.
0 commit comments