mirror of
https://github.com/open-mmlab/mmclassification.git
synced 2025-06-03 21:53:55 +08:00
20 lines
333 B
Python
20 lines
333 B
Python
|
from abc import ABCMeta, abstractmethod
|
||
|
|
||
|
import torch.nn as nn
|
||
|
|
||
|
|
||
|
class BaseHead(nn.Module, metaclass=ABCMeta):
|
||
|
"""Base head.
|
||
|
|
||
|
"""
|
||
|
|
||
|
def __init__(self):
|
||
|
super(BaseHead, self).__init__()
|
||
|
|
||
|
def init_weights(self):
|
||
|
pass
|
||
|
|
||
|
@abstractmethod
|
||
|
def forward_train(self, x, gt_label, **kwargss):
|
||
|
pass
|