Skip to content

Commit c4c921f

Browse files
committed
Update docs
1 parent 651f005 commit c4c921f

File tree

80 files changed

+163
-5337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+163
-5337
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
import tensorflow as tf
2323
import tensorlayerx as tl
2424

25-
x = tf.placeholder(tf.float32, [None, 64])
26-
net_in = tensorlayerx.layers.InputLayer(x)
25+
net_in = tl.layers.Input((3, 64))
2726

28-
net = tensorlayerx.layers.DenseLayer(net_in, n_units=25, act=tf.nn.relu, name='relu1')
27+
net = tl.nn.Linear(out_features=25, in_features=64, act='relu')
2928

30-
print("Output Shape:", net.outputs.get_shape().as_list()) ### Output Shape: [None, 25]
29+
print("Output Shape:", net(net_in).shape) ### Output Shape: [None, 25]
3130

3231
# ======================================================== #
3332
###### THIS CODE IS AN EXAMPLE, REPLACE WITH YOUR OWN ######

docs/modules/nn.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Layer list
1414

1515
Module
1616

17-
SequentialLayer
17+
Sequential
1818

1919
Input
2020

@@ -34,8 +34,8 @@ Layer list
3434
Conv1d
3535
Conv2d
3636
Conv3d
37-
DeConv2d
38-
DeConv3d
37+
ConvTranspose2d
38+
ConvTranspose3d
3939
DepthwiseConv2d
4040
SeparableConv1d
4141
SeparableConv2d
@@ -127,7 +127,7 @@ Module
127127

128128
Sequential Layer
129129
^^^^^^^^^^^^^^^^
130-
.. autoclass:: SequentialLayer
130+
.. autoclass:: Sequential
131131

132132
.. -----------------------------------------------------------
133133
.. Input Layer
@@ -187,13 +187,13 @@ Conv3d
187187
Deconvolutions
188188
^^^^^^^^^^^^^^^^^^^^^^^^^^
189189

190-
DeConv2d
190+
ConvTranspose2d
191191
"""""""""""""""""""""
192-
.. autoclass:: DeConv2d
192+
.. autoclass:: ConvTranspose2d
193193

194-
DeConv3d
194+
ConvTranspose3d
195195
"""""""""""""""""""""
196-
.. autoclass:: DeConv3d
196+
.. autoclass:: ConvTranspose3d
197197

198198

199199
Deformable Convolutions

docs/user/examples.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Basics
2525
- Convolutional Network (CIFAR-10), simple usage and supports multiple backends. Classification task, see `cifar10_cnn.py <https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/cifar10_cnn.py>`__.
2626
- Recurrent Neural Network (IMDB), simple usage and supports multiple backends. Text classification task, see `imdb_LSTM_simple.py <https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/imdb_LSTM_simple.py>`__.
2727
- Using tensorlayerx to automatic inference input shape. See `automatic_inference_input _shape.py <https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/automatic_inference_input%20_shape.py>`__.
28-
- Using Layerlist in tensorlayerx. See `tutorial_LayerList.py <https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/tutorial_LayerList.py>`__.
29-
- Using SequentialLayer in tensorlayerx. See `mnist_SequentialLayer.py <https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/mnist_SequentialLayer.py>`__.
28+
- Using ModuleList in tensorlayerx. See `tutorial_ModuleList.py <https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/tutorial_ModuleList.py>`__.
29+
- Using Sequential in tensorlayerx. See `mnist_Sequential.py <https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/mnist_Sequential.py>`__.
3030
- Using Dataflow in tensorlayerx. See `mnist_dataflow.py <https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/mnist_dataflow.py>`__.
3131
- Using nested layer in tensorlayerx. See `nested_usage_of_layer.py <https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/nested_usage_of_layer.py>`__.
3232
- Using tensorlayerx to save tensorflow model to pb. See `tensorflow_model_save_to_pb.py <https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/tensorflow_model_save_to_pb.py>`__.

docs/user/get_start_model.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Sequential model
1212

1313
.. code-block:: python
1414
15-
from tensorlayerx.nn import SequentialLayer
15+
from tensorlayerx.nn import Sequential
1616
from tensorlayerx.nn import Linear
1717
import tensorlayerx as tlx
1818
@@ -21,7 +21,7 @@ Sequential model
2121
layer_list.append(Linear(out_features=800, act=tlx.ReLU, in_features=784, name='Linear1'))
2222
layer_list.append(Linear(out_features=800, act=tlx.ReLU, in_features=800, name='Linear2'))
2323
layer_list.append(Linear(out_features=10, act=tlx.ReLU, in_features=800, name='Linear3'))
24-
MLP = SequentialLayer(layer_list)
24+
MLP = Sequential(layer_list)
2525
return MLP
2626
2727

examples/basic_tutorials/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Please read this [DOCS](https://tensorlayerx.readthedocs.io/en/latest/user/get_s
44

55
## Define a model
66
TensorLayerX provides Sequential and Subclass define a model. Sequential model allows you to build model in a fluent way while Subclass allows you to fully control the forward process.
7-
- [Sequential Model](https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/mnist_SequentialLayer.py)
8-
- [Layer List](https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/tutorial_LayerList.py)
7+
- [Sequential Model](https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/mnist_Sequential.py)
8+
- [Module List](https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/tutorial_ModuleList.py)
99
- [Nested Usage of Layer](https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/nested_usage_of_layer.py)
1010
- [Automatic Inference Input Shape](https://github.com/tensorlayer/TensorLayerX/blob/main/examples/basic_tutorials/automatic_inference_input_shape.py)
1111

examples/basic_tutorials/mnist_SequentialLayer.py renamed to examples/basic_tutorials/mnist_Sequential.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# os.environ['TL_BACKEND'] = 'mindspore'
66
os.environ['TL_BACKEND'] = 'paddle'
77

8-
from tensorlayerx.nn import SequentialLayer
8+
from tensorlayerx.nn import Sequential
99
from tensorlayerx.nn import Linear
1010
import tensorlayerx as tlx
1111
from tensorlayerx.dataflow import Dataset
@@ -14,7 +14,7 @@
1414
layer_list.append(Linear(out_features=800, act=tlx.ReLU, in_features=784, name='linear1'))
1515
layer_list.append(Linear(out_features=800, act=tlx.ReLU, in_features=800, name='linear2'))
1616
layer_list.append(Linear(out_features=10, act=tlx.ReLU, in_features=800, name='linear3'))
17-
MLP = SequentialLayer(layer_list)
17+
MLP = Sequential(layer_list)
1818

1919
X_train, y_train, X_val, y_val, X_test, y_test = tlx.files.load_mnist_dataset(shape=(-1, 784))
2020

examples/basic_tutorials/nested_usage_of_layer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import numpy as np
88
import tensorflow as tf
99

10-
from tensorlayerx.nn import Module, SequentialLayer
10+
from tensorlayerx.nn import Module, Sequential
1111
import tensorlayerx as tlx
1212
from tensorlayerx.nn import (Conv2d, Linear, Flatten, MaxPool2d, BatchNorm2d, Elementwise)
1313
from tensorlayerx.dataflow import Dataset, DataLoader
@@ -86,7 +86,7 @@ def make_layer(self, in_channel):
8686
range_block = Block(in_channel)
8787
layers.append(range_block)
8888

89-
return SequentialLayer(layers)
89+
return Sequential(layers)
9090

9191

9292
# get the network

examples/basic_tutorials/tutorial_LayerList.py renamed to examples/basic_tutorials/tutorial_ModuleList.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
# os.environ['TL_BACKEND'] = 'mindspore'
77
os.environ['TL_BACKEND'] = 'paddle'
88

9-
from tensorlayerx.nn import Module, LayerList, Linear
9+
from tensorlayerx.nn import Module, ModuleList, Linear
1010
import tensorlayerx as tlx
1111

1212
d1 = Linear(out_features=800, act=tlx.ReLU, in_features=784, name='linear1')
1313
d2 = Linear(out_features=800, act=tlx.ReLU, in_features=800, name='linear2')
1414
d3 = Linear(out_features=10, act=tlx.ReLU, in_features=800, name='linear3')
1515

16-
layer_list = LayerList([d1, d2])
16+
layer_list = ModuleList([d1, d2])
1717
# Inserts a given d2 before a given index in the list
1818
layer_list.insert(1, d2)
1919
layer_list.insert(2, d2)

examples/model_zoo/resnet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from tensorlayerx import logging
1616
from tensorlayerx.files import (maybe_download_and_extract)
1717
from tensorlayerx.nn import (BatchNorm, Conv2d, Linear, Elementwise, GlobalMeanPool2d, MaxPool2d)
18-
from tensorlayerx.nn import Module, SequentialLayer
18+
from tensorlayerx.nn import Module, Sequential
1919

2020
__all__ = [
2121
'ResNet50',
@@ -165,7 +165,7 @@ def make_layer(self):
165165

166166
if block_name == self.end_with:
167167
break
168-
return SequentialLayer(layer_list)
168+
return Sequential(layer_list)
169169

170170

171171
def ResNet50(pretrained=False, end_with='fc1000', n_classes=1000):

examples/model_zoo/vgg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import tensorlayerx as tlx
3535
from tensorlayerx import logging
3636
from tensorlayerx.files import assign_weights, maybe_download_and_extract
37-
from tensorlayerx.nn import (BatchNorm, Conv2d, Linear, Flatten, SequentialLayer, MaxPool2d)
37+
from tensorlayerx.nn import (BatchNorm, Conv2d, Linear, Flatten, Sequential, MaxPool2d)
3838
from tensorlayerx.nn import Module
3939

4040
__all__ = [
@@ -149,7 +149,7 @@ def make_layers(config, batch_norm=False, end_with='outputs'):
149149
is_end = True
150150
if is_end:
151151
break
152-
return SequentialLayer(layer_list)
152+
return Sequential(layer_list)
153153

154154

155155
def restore_model(model, layer_type):

0 commit comments

Comments
 (0)