|
|
|
|
|
|
|
|
batch_sizes = batch_sizes[:len(y)] |
|
|
batch_sizes = batch_sizes[:len(y)] |
|
|
p = np.polyfit(batch_sizes, y, deg=1) # first degree polynomial fit |
|
|
p = np.polyfit(batch_sizes, y, deg=1) # first degree polynomial fit |
|
|
b = int((f * fraction - p[1]) / p[0]) # y intercept (optimal batch size) |
|
|
b = int((f * fraction - p[1]) / p[0]) # y intercept (optimal batch size) |
|
|
print(f'{prefix}Using colorstr(batch-size {b}) for {d} {t * fraction:.3g}G/{t:.3g}G ({fraction * 100:.0f}%)') |
|
|
|
|
|
|
|
|
print(f'{prefix}Using batch-size {b} for {d} {t * fraction:.3g}G/{t:.3g}G ({fraction * 100:.0f}%)') |
|
|
return b |
|
|
return b |