Spaces:
Sleeping
Sleeping
Download model_code/model.py from oussamab2n/GazeLIFT: direct link, hf CLI and curl.
- Browser
- Download file 630 Bytes
-
https://huggingface.co/spaces/oussamab2n/GazeLIFT/resolve/main/model_code/model.py
- Command line
-
hf download hf://spaces/oussamab2n/GazeLIFT/model_code/model.py
-
curl -L -o model.py https://huggingface.co/spaces/oussamab2n/GazeLIFT/resolve/main/model_code/model.py
630 Bytes
| """Add one learned spatial3x3 Conv2d after each transposed decoder block.""" | |
| from torch import nn | |
| from transpose_reference import TransposeGazePyramidDecoder | |
| from base_model import segmentation_loss | |
| class TransposeCNNGazePyramidDecoder(TransposeGazePyramidDecoder): | |
| def __init__(self): | |
| super().__init__() | |
| for block in self.decoder: | |
| conv=nn.Conv2d(32,32,3,padding=1,bias=False) | |
| nn.init.kaiming_normal_(conv.weight,mode='fan_out',nonlinearity='relu') | |
| block.add_module('3',conv) | |
| block.add_module('4',nn.GroupNorm(8,32)) | |
| block.add_module('5',nn.GELU()) | |