Skip to content

Commit

Permalink
(update_activity) simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
shnarazk committed Aug 21, 2021
1 parent 04f175f commit 9a39c23
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/assign/learning_rate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ impl Var {
// 1. cancel_until -> reward_at_unassign -> assertion failed
//
if self.timestamp < t {
let rate = self.participated as f64 / (t - self.timestamp) as f64;
self.reward *= decay;
self.reward += (1.0 - (rate - 1.0).powf(2.0)).powf(0.5) * reward;
self.participated = 0;
if 0 < self.participated {
let rate = self.participated as f64 / (t - self.timestamp) as f64;
self.reward += (1.0 - (1.0 - rate).powi(2)) * reward;
self.participated = 0;
}
self.timestamp = t;
}
self.reward
Expand Down

0 comments on commit 9a39c23

Please sign in to comment.