updated docs and added examples to doc string ^^

This commit is contained in:
m0saan 2023-12-19 10:13:24 +01:00
parent 7ec3cadf98
commit 7b0f8bda9c
2 changed files with 8 additions and 1 deletions

View File

@ -20,6 +20,7 @@ Layers
Linear
Conv1d
Conv2d
BatchNorm1d
LayerNorm
RMSNorm
GroupNorm

View File

@ -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__(