adaptive
adaptive copied to clipboard
document loss function to find the band gap
Many people have asked me how to do this.
I've recommended them to use the following loss function:
@adaptive.learner.learner1D.uses_nth_neighbors(0)
def abs_min_log_loss(xs, ys):
from adaptive.learner.learner1D import default_loss
ys = [np.log(np.abs(y).min()) for y in ys]
return default_loss(xs, ys)
We should put this in the documentation somewhere.
What's the motivation for log
, as opposed to any other monotonous function?
This makes small y-values more important.
But 1/abs(y).min()
would make it even more important. I'm wondering why log
specifically.
when we say "band gap" here I guess we're making certain assumptions, e.g. system has direct gap, and valence and conduction bands are at y<0
and y>0
respectively.