Browse Source
- Created `loss.py` with a `LossManager` class to handle loss calculation - Integrated `LossManager` into the training pipeline in `train.py` - Implemented a basic manifold loss computation using mean absolute valueNH-Rep
2 changed files with 23 additions and 1 deletions
@ -0,0 +1,20 @@ |
|||
|
|||
|
|||
|
|||
|
|||
class LossManager: |
|||
def __init__(self): |
|||
pass |
|||
|
|||
def compute_loss(self, outputs): |
|||
""" |
|||
计算流型损失的逻辑 |
|||
|
|||
:param outputs: 模型的输出 |
|||
:return: 计算得到的流型损失值 |
|||
""" |
|||
|
|||
# 计算流型损失(这里使用均方误差作为示例) |
|||
manifold_loss = (outputs.abs()).mean() # 计算流型损失 |
|||
return manifold_loss |
|||
|
Loading…
Reference in new issue