mirror of
https://github.com/ml-explore/mlx.git
synced 2025-08-20 18:39:45 +08:00
updated docs and added examples to doc string ^^
This commit is contained in:
parent
7ec3cadf98
commit
7b0f8bda9c
@ -20,6 +20,7 @@ Layers
|
||||
Linear
|
||||
Conv1d
|
||||
Conv2d
|
||||
BatchNorm1d
|
||||
LayerNorm
|
||||
RMSNorm
|
||||
GroupNorm
|
||||
|
@ -203,7 +203,13 @@ class BatchNorm1d(Module):
|
||||
affine (bool, optional): If True, learn an affine transform to apply after the normalization. Default is True.
|
||||
|
||||
Examples:
|
||||
-> TODO: Add examples.
|
||||
>>> import mlx.core as mx
|
||||
>>> import mlx.nn as nn
|
||||
>>> mx.random.seed(42)
|
||||
>>> input = mx.random.normal((5, 4), dtype=mx.float32)
|
||||
>>> # Batch norm
|
||||
>>> bn = nn.BatchNorm1d(num_features=4, affine=True)
|
||||
>>> output = bn(x)
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
Loading…
Reference in New Issue
Block a user