前言
Fastflow论文复现时用到的FrEIA库的一些操作
FrEIA配置在环境中
在requirements.txt文件中
FrEIA @ git+https://github.com/VLL-HD/FrEIA@1779d1fba1e21000fda1927b59eeac0a6fcaa284
pip install -r requirements.txt
直接配置
pip install git+https://github.com/VLL-HD/FrEIA@1779d1fba1e21000fda1927b59eeac0a6fcaa284
FrEIA介绍
背景:为做INN(Invertible neural network,网络能够同时从两个方向传播)网络设计的库。
参考(官方文档):Small fully-connected INNs — FrEIA v0.2 documentation
FrEIA代码段
import FrEIA.framework as Ff
Ff.SequenceINN:与nn.ModuleLists/nn.Sequential类似
import FrEIA.modules as Fm
Fm.AllInOneBlock:包括仿射变换(affine coupling)/置换(permutation)/全局仿射转换(affine transformation:"ActNorm")
permute_soft:置换时使用矩阵与否
affine_clamping:给输出做限制,防止指数爆炸
subnet_constructor:返回的模型属于torch.nn.module里的,预留的