Skip to content

Commit

Permalink
Refactored the parameters.
Browse files Browse the repository at this point in the history
Made it simpler to compare and optimize.

- Made the size of the unwarp window a field in the Zimtohrli struct.
- Made the Go wrapper bundle all parameters in a single struct that's
  passed all the way to the C++ layer to avoid having to pipe each
  parameter individually through several functions.
- Made the study tool easier to use on multiple datasets.
- Improved the optimize mode of the study tool.
  • Loading branch information
Martin Bruse authored and zond committed May 20, 2024
1 parent a59b52a commit 9855b6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions go/progress/bar.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ func (b *Bar) Update(total, completed, errors int) {
timeUsed := now.Sub(b.lastRender)
currentCompletedSpeed := float64(completed-b.completed) / float64(timeUsed)
currentFractionSpeed := (fraction - (float64(b.completed) / float64(b.total))) / float64(timeUsed)
minutesUsed := float64(timeUsed) / float64(time.Minute)
w := math.Exp(-minutesUsed)
secondsUsed := float64(timeUsed) / float64(time.Second)
w := math.Exp(-0.1 * secondsUsed)
b.emaCompletedSpeed = b.emaCompletedSpeed*w + currentCompletedSpeed*(1-w)
b.emaFractionSpeed = b.emaFractionSpeed*w + currentFractionSpeed*(1-w)
}
eta := time.Duration((1 - fraction) / b.emaFractionSpeed)
round := time.Minute
if eta < time.Minute {
if eta < 2*time.Minute {
round = time.Second
}
suffix := fmt.Sprintf(" %.2f/s ETA: %s", b.emaCompletedSpeed*float64(time.Second), eta.Round(round))
Expand Down

0 comments on commit 9855b6d

Please sign in to comment.