Simplified V2 API (penzai.experimental.v2)#
penzai.experimental.v2 is a redesign of Penzai’s neural network system, which is intended to simplify the user experience and remove boilerplate in the original design. Eventually, this will be moved out of the “experimental” prefix and replace the original neural network components.
You can read about the V2 design in the guide “How to Think in Penzai (v2 API)”, or this document comparing the two APIs.
To use the V2 API, we suggest importing the pz alias namespace from penzai.experimental.v2.pz:
from penzai.experimental.v2 import pz
The rest of this page lists the main components used in the V2 API.
Specific to the V2 Neural Network API#
Parameters and State Variables#
The V2 API introduces stateful parameters and state variables, which simplify working with shared parameters and interventions with side effects.
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
Layers and Parameter Utilities#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
Basic Combinators#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
Basic Operations#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
Linear and Affine Layers#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Generic variance scaling initializer. |
|
Generic variance scaling initializer. |
|
Alias of |
|
Zeros initializer for named arrays. |
Standardization#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
Dropout#
|
Alias of |
|
Alias of |
|
Alias of |
Language Modeling#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
Layer Stacks#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |