This commit is contained in:
parent
169a87fccc
commit
043c7982e6
|
@ -20,10 +20,10 @@ func (ucb *UCB) Select(r float64) int {
|
|||
}
|
||||
sz := len(ucb.cr.Counts)
|
||||
var res float64
|
||||
for _, v := range ucb.cr.Counts {
|
||||
for idx, v := range ucb.cr.Counts {
|
||||
ans := math.Sqrt((2.0 * math.Log(float64(sz))) / float64(v))
|
||||
if ans > res {
|
||||
res = ans
|
||||
res = float64(a) + ucb.cr.Rewards[idx]
|
||||
}
|
||||
}
|
||||
return int(res)
|
||||
|
|
Loading…
Reference in New Issue