|
def | __init__ (self, int n=0) |
|
torch.tensor | forward (self, torch.tensor y, torch.LongTensor y_true) |
|
|
| n |
| Number of Taylor terms.
|
|
Class for calculation of Taylor cross entropy loss.
Attributes:
n (int): Number of Taylor series terms to be used for loss calculation.
Definition at line 45 of file torch_tcce.py.
◆ __init__()
def __init__ |
( |
|
self, |
|
|
int |
n = 0 |
|
) |
| |
Initialize the loss class.
Parameters:
n (int)(optional): Number of Taylor series terms to be used for loss calculation.
Definition at line 54 of file torch_tcce.py.
54 def __init__(self, n: int = 0):
56 Initialize the loss class.
59 n (int)(optional): Number of Taylor series terms to be used for loss calculation.
◆ forward()
torch.tensor forward |
( |
|
self, |
|
|
torch.tensor |
y, |
|
|
torch.LongTensor |
y_true |
|
) |
| |
Calculates the Taylor categorical cross entropy loss.
Parameters:
y(torch.tensor): Tensor containing the output of the model.
y_true(torch.tensor): 1D tensor containing the truth value for a given set of features.
Returns:
The calculated loss as a torch tensor.
Definition at line 66 of file torch_tcce.py.
The documentation for this class was generated from the following file: