Epoch count heuristic for tabular fit_one_cycle

I was running some experiments with different size data sets and found what I think might be a useful heuristic for automatically setting an epoch count on fit_one_cycle with tabular learner. Offering to this forum as a thank you for the library.

def fastai_epoch_heuristic(self, rowcount, columncount):
“”"
#Heuristic to calculate number of epochs to apply
#Tries to er on the side of underfit
#some further validations on this heuristic still needed
“”"

epoch_count = 1
rowcount = rowcount / 50000

if rowcount > 1:
  
  epoch_count = int(rowcount ** 0.5)
  
epoch_count = int(epoch_count * ((columncount / 15) ** 0.5))

if epoch_count < 1:
  epoch_count = 1
  
return epoch_count
1 Like

Can you share any insights or experiments towards how you got to here? :slight_smile:

Yeah I have a preprint available on medium as “A Numbers Game” which discusses the experiments. It occurs to me that these experiments were all run with a consistent dense layer setup so taking variations of that point into account may be an appropriate extension.

1 Like

Link? :slight_smile: