"""ADAPTIVE BATCH SIZE"""print("Adaptive batch size: using grouping batch sampler, frames_per_gpu fixed fed in")print(" -> least padding, gather wavs with accumulated frames in a batch\n")# datatotal_hours=95282mel_hop_length=256mel_sampling_rate=24000# targetwanted_max_updates=1000000# train paramsgpus=8frames_per_gpu=38400# 8 * 38400 = 307200grad_accum=1# intermediatemini_batch_frames=frames_per_gpu*grad_accum*gpusmini_batch_hours=mini_batch_frames*mel_hop_length/mel_sampling_rate/3600updates_per_epoch=total_hours/mini_batch_hourssteps_per_epoch=updates_per_epoch*grad_accum# resultepochs=wanted_max_updates/updates_per_epochprint(f"epochs should be set to: {epochs:.0f} ({epochs/grad_accum:.1f} x gd_acum {grad_accum})")print(f"progress_bar should show approx. 0/{updates_per_epoch:.0f} updates")print(f" or approx. 0/{steps_per_epoch:.0f} steps")# othersprint(f"total {total_hours:.0f} hours")print(f"mini-batch of {mini_batch_frames:.0f} frames, {mini_batch_hours:.2f} hours per mini-batch")