penzai.deprecated.v1 (Original V1 API)#
penzai.deprecated.v1
is Penzai’s original neural network system, which
has been replaced by the new “V2” design. It is available here for compatibility
with existing users of the V1 API. For a summary of the differences between the
V1 and V2 APIs, and a guide to migrating to the V2 API, see the
“Changes in the V2 API” overview document.
To use the V1 API, we suggest importing the pz
alias namespace from
penzai.deprecated.v1.pz
:
from penzai.deprecated.v1 import pz
The rest of this page lists the main components used in the V1 API.
Specific to the V1 Neural Network API#
V1 Layers#
Most models and layers in the V1 API are subclasses of pz.Layer
, which means
they can be called with a single argument.
|
Alias of |
|
The following decorators can be used to enable runtime shape-checking on
penzai.deprecated.v1.core.layer.Layer
(pz.Layer
) subclasses:
|
Alias of |
|
Alias of |
V1 Parameters#
In the V1 API, Parameters are always ordinary PyTree nodes. Parameter sharing is indicated by extra metadata and PyTree transformations inside the model.
|
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 |
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 |
Base Effect Types#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
alias of |
Side Inputs#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
Side Outputs#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
Randomness#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
Local State#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
Effect Utilities#
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |
|
Alias of |