本文主要是介绍[CapsNet]基于pytorch的胶囊网络工具包,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
API
论文地址:Dynamic Routing Between Capsules
开发了一个基于pytorch的胶囊网络工具包,以下是它的API:
### 胶囊化层
class Capsulation2D(nn.Module)# input.shape = (batch_size, channels, height, weight)# output.shape = (batch_size, out_channels, out_dim_capsule, height, weight)### 反胶囊化层
class DeCapsulation2D(nn.Module)# input.shape = (batch_size, channels, dim_capsule, height, weight)# output.shape = (batch_size, out_channels, height, weight)### 平化层
class CapFlatten(nn.Module)# input.shape = (batch_size, channels, dim_capsule, height, weight)# output.shape = (batch_size, channels * height * weight, dim_capsule) which is (batch_size, num_capsules, dim_capsule)### 反平化层
这篇关于[CapsNet]基于pytorch的胶囊网络工具包的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!