flax.nnx# 實驗性 API。請參閱 NNX 頁面 以了解更多詳細資訊。 圖形 split() merge() update() pop() state() variables() graph() graphdef() iter_graph() clone() call() GraphDef UpdateContext UpdateContext.merge() UpdateContext.split() update_context() current_update_context() 模組 Module Module.eval() Module.iter_children() Module.iter_modules() Module.set_attributes() Module.sow() Module.train() nn 激活函數 celu() elu() gelu() glu() hard_sigmoid() hard_silu() hard_swish() hard_tanh() leaky_relu() log_sigmoid() log_softmax() logsumexp() one_hot() relu() selu() sigmoid() silu() soft_sign() softmax() softplus() standardize() swish() tanh() 注意力機制 MultiHeadAttention combine_masks() dot_product_attention() make_attention_mask() make_causal_mask() 資料類型 canonicalize_dtype() promote_dtype() 初始化器 constant() delta_orthogonal() glorot_normal() glorot_uniform() he_normal() he_uniform() kaiming_normal() kaiming_uniform() lecun_normal() lecun_uniform() normal() truncated_normal() ones() ones_init() orthogonal() uniform() variance_scaling() xavier_normal() xavier_uniform() zeros() zeros_init() 線性 Conv ConvTranspose Embed 線性 LinearGeneral Einsum LoRA LoRA LoRALinear 正規化 BatchNorm LayerNorm RMSNorm GroupNorm 遞迴 LSTMCell OptimizedLSTMCell SimpleCell GRUCell RNN Bidirectional flip_sequences() 隨機 Dropout rnglib Rngs Rngs.__init__() RngStream reseed() spmd get_partition_spec() get_named_sharding() with_partitioning() with_sharding_constraint() 狀態 State State.filter() State.merge() State.split() 訓練 指標 Metric Average Accuracy Welford MultiMetric 最佳化器 最佳化器 轉換 Jit Remat Scan Vmap grad() jit() remat() scan() value_and_grad() vmap() eval_shape() custom_vjp() cond() switch() while_loop() fori_loop() 變數 BatchStat Cache Intermediate Param Variable VariableMetadata VariableState with_metadata() 輔助程式 Dict Sequential TrainState TrainState.replace() 視覺化 display() 篩選器庫 to_predicate() WithTag PathContains OfType Any All Not Everything Nothing 橋接 ToNNX ToNNX.__call__() ToNNX.lazy_init() ToLinen ToLinen.__call__() to_linen() NNXMeta NNXMeta.__call__() NNXMeta.add_axis() NNXMeta.get_partition_spec() NNXMeta.remove_axis() NNXMeta.replace() NNXMeta.replace_boxed() NNXMeta.to_nnx_variable() NNXMeta.unbox()