-
Notifications
You must be signed in to change notification settings - Fork 28
Ugly MAB POC #70
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
base: main
Are you sure you want to change the base?
Ugly MAB POC #70
Conversation
Codecov Report
@@ Coverage Diff @@
## main #70 +/- ##
==========================================
- Coverage 88.30% 86.68% -1.62%
==========================================
Files 64 64
Lines 4087 4176 +89
==========================================
+ Hits 3609 3620 +11
- Misses 333 411 +78
Partials 145 145
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
pool/shard.go
Outdated
| work chan work //todo channel in pool | ||
| minute *time.Ticker | ||
| ticks int | ||
| src *rand.Rand |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this to "rnd", because src is a bit misleading name here. At least it got me confused
pool/shard.go
Outdated
| if pool.handleReanimate() { | ||
| ctx.Heartbeat() | ||
| } | ||
| nt := float64(0.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go tip: "var nt float64" should do the same
pool/shard.go
Outdated
| //inspired by https://cybernetist.com/2019/01/24/random-weighted-draws-in-go/ | ||
| cdf := make([]float64, size) | ||
| weights := make([]float64, size) | ||
| const explorationRate = 0.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unused here
pool/shard.go
Outdated
| // continue | ||
| //} | ||
| e.Offered += 1 | ||
| a := e.Offered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... I think it's better to be doing it on "running counters", rather than global counters
# Conflicts: # go.mod # go.sum # pool/shard.go
thompson sampling prototype