sugartensor.sg_net module¶
-
sugartensor.sg_net.
sg_densenet_121
(x, opt)[source]¶ Applies dense net 121 model.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
x: A Tensor. opt:
k: An integer. The Growth rate of densenet. Default is 32. num_class: An integer. Number of class. Default is 1000. conv_only: Boolean. If True, fc layers are not applied. Default is False. squeeze: Boolean. If True (default), the dimensions with size 1 in the final outputs will be removed. act: String. ‘relu’ (default). the activation function name reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String(Optional). If provided, used as the scope name of this network- Returns:
- A Tensor.
-
sugartensor.sg_net.
sg_densenet_161
(x, opt)[source]¶ Applies dense net 161 model.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
x: A Tensor. opt:
k: An integer. The Growth rate of densenet. Default is 48. num_class: An integer. Number of class. Default is 1000. conv_only: Boolean. If True, fc layers are not applied. Default is False. squeeze: Boolean. If True (default), the dimensions with size 1 in the final outputs will be removed. act: String. ‘relu’ (default). the activation function name reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String(Optional). If provided, used as the scope name of this network- Returns:
- A Tensor.
-
sugartensor.sg_net.
sg_densenet_169
(x, opt)[source]¶ Applies dense net 169 model.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
x: A Tensor. opt:
k: An integer. The Growth rate of densenet. Default is 32. num_class: An integer. Number of class. Default is 1000. conv_only: Boolean. If True, fc layers are not applied. Default is False. squeeze: Boolean. If True (default), the dimensions with size 1 in the final outputs will be removed. act: String. ‘relu’ (default). the activation function name reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String(Optional). If provided, used as the scope name of this network- Returns:
- A Tensor.
-
sugartensor.sg_net.
sg_densenet_201
(x, opt)[source]¶ Applies dense net 201 model.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
x: A Tensor. opt:
k: An integer. The Growth rate of densenet. Default is 32. num_class: An integer. Number of class. Default is 1000. conv_only: Boolean. If True, fc layers are not applied. Default is False. squeeze: Boolean. If True (default), the dimensions with size 1 in the final outputs will be removed. act: String. ‘relu’ (default). the activation function name reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String(Optional). If provided, used as the scope name of this network- Returns:
- A Tensor.
-
sugartensor.sg_net.
sg_densenet_layer
(x, opt)[source]¶ Applies basic architecture of densenet layer.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
x: A Tensor. opt:
dim: An integer. Dimension for this resnet layer num: Number of times to repeat act: String. ‘relu’ (default). the activation function name trans: Boolean. If True(default), transition layer will be applied. reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String. (optional) Used as convolution layer prefix- Returns:
- A Tensor.
-
sugartensor.sg_net.
sg_resnet_101
(x, opt)[source]¶ Applies residual net 101 model.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
x: A Tensor. opt:
num_class: An integer. Number of class. Default is 1000. conv_only: Boolean. If True, fc layers are not applied. Default is False. squeeze: Boolean. If True (default), the dimensions with size 1 in the final outputs will be removed. act: String. ‘relu’ (default). the activation function name reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String(Optional). If provided, used as the scope name of this network- Returns:
- A Tensor.
-
sugartensor.sg_net.
sg_resnet_152
(x, opt)[source]¶ Applies residual net 152 model.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
x: A Tensor. opt:
num_class: An integer. Number of class. Default is 1000. conv_only: Boolean. If True, fc layers are not applied. Default is False. squeeze: Boolean. If True (default), the dimensions with size 1 in the final outputs will be removed. act: String. ‘relu’ (default). the activation function name reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String(Optional). If provided, used as the scope name of this network- Returns:
- A Tensor.
-
sugartensor.sg_net.
sg_resnet_200
(x, opt)[source]¶ Applies residual net 200 model.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
x: A Tensor. opt:
num_class: An integer. Number of class. Default is 1000. conv_only: Boolean. If True, fc layers are not applied. Default is False. squeeze: Boolean. If True (default), the dimensions with size 1 in the final outputs will be removed. act: String. ‘relu’ (default). the activation function name reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String(Optional). If provided, used as the scope name of this network- Returns:
- A Tensor.
-
sugartensor.sg_net.
sg_resnet_50
(x, opt)[source]¶ Applies residual net 50 model.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
x: A Tensor. opt:
num_class: An integer. Number of class. Default is 1000. conv_only: Boolean. If True, fc layers are not applied. Default is False. squeeze: Boolean. If True (default), the dimensions with size 1 in the final outputs will be removed. act: String. ‘relu’ (default). the activation function name reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String(Optional). If provided, used as the scope name of this network- Returns:
- A Tensor.
-
sugartensor.sg_net.
sg_resnet_layer
(x, opt)[source]¶ Applies basic architecture of residual net.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
x: A Tensor. opt:
dim: An integer. Dimension for this resnet layer num: Number of times to repeat act: String. ‘relu’ (default). the activation function name reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String. (optional) Used as convolution layer prefix- Returns:
- A Tensor.
-
sugartensor.sg_net.
sg_vgg_16
(tensor, opt)[source]¶ Applies vgg 16 model.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
tensor: A Tensor opt:
num_class: An integer. Number of class. Default is 1000. conv_only: Boolean. If True, fc layers are not applied. Default is False. squeeze: Boolean. If True (default), the dimensions with size 1 in the final outputs will be removed. act: String. ‘relu’ (default). the activation function name bn: True or False(default). If True, batch normal will be applied reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String(Optional). If provided, used as the scope name of this network- Returns:
- A Tensor.
-
sugartensor.sg_net.
sg_vgg_19
(tensor, opt)[source]¶ Applies vgg 19 model.
- Note that the fc layers in the original architecture
- will be replaced with fully convolutional layers. For convenience, We still call them fc layers, though.
- Args:
tensor: A Tensor. opt:
num_class: An integer. Number of class. Default is 1000. conv_only: Boolean. If True, fc layers are not applied. Default is False. squeeze: Boolean. If True (default), the dimensions with size 1 in the final outputs will be removed. act: String. ‘relu’ (default). the activation function name bn: True or False(default). If True, batch normal will be applied reuse: Boolean(Optional). If True, all variables will be loaded from previous network. name: String(Optional). If provided, used as the scope name of this network- Returns:
- A Tensor.