new loss functions

This commit is contained in:
SayanoAI
2024-09-10 11:57:58 -04:00
parent 9b4534481a
commit 91e552f756
6 changed files with 164 additions and 153 deletions
+4
View File
@@ -67,6 +67,10 @@ def autocorrelation1d(log_magnitude, max_lag=None):
return autocorr.nan_to_num(0)
def minmax_scale(tensor: torch.Tensor, eps=1e-8):
tensor = (tensor - tensor.min()) / (tensor.max() - tensor.min() + eps)
return tensor
def init_weights(m, mean=0.0, std=0.01):
classname = m.__class__.__name__
if classname.find("Conv") != -1: