Skip to content

Conversation

@mungobungo
Copy link

thompson sampling prototype

@nfx nfx requested review from nfx and removed request for nfx January 3, 2023 20:47
@codecov
Copy link

codecov bot commented Jan 3, 2023

Codecov Report

Merging #70 (998e881) into main (8cb4008) will decrease coverage by 1.61%.
The diff coverage is 20.00%.

❗ Current head 998e881 differs from pull request most recent head 334af36. Consider uploading reports for the commit 334af36 to get more accurate results

@@            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              
Impacted Files Coverage Δ
pool/pool.go 89.90% <ø> (ø)
pool/shard.go 57.74% <16.27%> (-28.20%) ⬇️
pool/entry.go 88.88% <100.00%> (+0.57%) ⬆️
sources/webanet.go 54.05% <0.00%> (-16.22%) ⬇️
sources/util.go 96.22% <0.00%> (-1.89%) ⬇️
probe/internal.go 91.55% <0.00%> (+1.29%) ⬆️

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
Copy link
Owner

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)
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants