Skip to content

Commit

Permalink
update conv doc
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoming0625 committed Dec 31, 2023
1 parent 3982629 commit 91a32ec
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions brainpy/_src/dnn/conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

from jax import lax

from brainpy import math as bm, tools, check
from brainpy import math as bm, tools
from brainpy._src.dnn.base import Layer
from brainpy._src.initialize import Initializer, XavierNormal, ZeroInit, parameter
from brainpy.types import ArrayType
from brainpy._src.dnn.base import Layer

__all__ = [
'Conv1d', 'Conv2d', 'Conv3d',
Expand Down Expand Up @@ -488,9 +488,7 @@ def __init__(
mode: bm.Mode = None,
name: str = None,
):
super(_GeneralConvTranspose, self).__init__(name=name, mode=mode)

assert self.mode.is_parent_of(bm.TrainingMode, bm.BatchingMode, bm.NonBatchingMode)
super().__init__(name=name, mode=mode)

self.num_spatial_dims = num_spatial_dims
self.in_channels = in_channels
Expand Down Expand Up @@ -586,22 +584,17 @@ def __init__(
"""Initializes the module.
Args:
output_channels: Number of output channels.
kernel_shape: The shape of the kernel. Either an integer or a sequence of
in_channels: Number of input channels.
out_channels: Number of output channels.
kernel_size: The shape of the kernel. Either an integer or a sequence of
length 1.
stride: Optional stride for the kernel. Either an integer or a sequence of
length 1. Defaults to 1.
output_shape: Output shape of the spatial dimensions of a transpose
convolution. Can be either an integer or an iterable of integers. If a
`None` value is given, a default shape is automatically calculated.
padding: Optional padding algorithm. Either ``VALID`` or ``SAME``.
Defaults to ``SAME``. See:
https://www.tensorflow.org/xla/operation_semantics#conv_convolution.
with_bias: Whether to add a bias. By default, true.
w_init: Optional weight initialization. By default, truncated normal.
b_init: Optional bias initialization. By default, zeros.
data_format: The data format of the input. Either ``NWC`` or ``NCW``. By
default, ``NWC``.
w_initializer: Optional weight initialization. By default, truncated normal.
b_initializer: Optional bias initialization. By default, zeros.
mask: Optional mask of the weights.
name: The name of the module.
"""
Expand Down Expand Up @@ -648,6 +641,7 @@ def __init__(
"""Initializes the module.
Args:
in_channels: Number of input channels.
out_channels: Number of output channels.
kernel_size: The shape of the kernel. Either an integer or a sequence of
length 2.
Expand Down Expand Up @@ -704,22 +698,17 @@ def __init__(
"""Initializes the module.
Args:
output_channels: Number of output channels.
kernel_shape: The shape of the kernel. Either an integer or a sequence of
in_channels: Number of input channels.
out_channels: Number of output channels.
kernel_size: The shape of the kernel. Either an integer or a sequence of
length 3.
stride: Optional stride for the kernel. Either an integer or a sequence of
length 3. Defaults to 1.
output_shape: Output shape of the spatial dimensions of a transpose
convolution. Can be either an integer or an iterable of integers. If a
`None` value is given, a default shape is automatically calculated.
padding: Optional padding algorithm. Either ``VALID`` or ``SAME``.
Defaults to ``SAME``. See:
https://www.tensorflow.org/xla/operation_semantics#conv_convolution.
with_bias: Whether to add a bias. By default, true.
w_init: Optional weight initialization. By default, truncated normal.
b_init: Optional bias initialization. By default, zeros.
data_format: The data format of the input. Either ``NDHWC`` or ``NCDHW``.
By default, ``NDHWC``.
w_initializer: Optional weight initialization. By default, truncated normal.
b_initializer: Optional bias initialization. By default, zeros.
mask: Optional mask of the weights.
name: The name of the module.
"""
Expand Down

0 comments on commit 91a32ec

Please sign in to comment.