1 Star 0 Fork 2

wonder/ConvLSTM-PyTorch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model.py 1000 Bytes
一键复制 编辑 原始数据 按行查看 历史
jhhuang96 提交于 5年前 . reconstruction
from torch import nn
import torch.nn.functional as F
import torch
from utils import make_layers
class activation():
def __init__(self, act_type, negative_slope=0.2, inplace=True):
super().__init__()
self._act_type = act_type
self.negative_slope = negative_slope
self.inplace = inplace
def __call__(self, input):
if self._act_type == 'leaky':
return F.leaky_relu(input, negative_slope=self.negative_slope, inplace=self.inplace)
elif self._act_type == 'relu':
return F.relu(input, inplace=self.inplace)
elif self._act_type == 'sigmoid':
return torch.sigmoid(input)
else:
raise NotImplementedError
class ED(nn.Module):
def __init__(self, encoder, decoder):
super().__init__()
self.encoder = encoder
self.decoder = decoder
def forward(self, input):
state = self.encoder(input)
output = self.decoder(state)
return output
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wonderif/ConvLSTM-PyTorch.git
git@gitee.com:wonderif/ConvLSTM-PyTorch.git
wonderif
ConvLSTM-PyTorch
ConvLSTM-PyTorch
master

搜索帮助