Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
dòng chảy căng:: ôi:: Hợp nhấtBatchNorm
#include <nn_ops.h>
Chuẩn hóa hàng loạt.
Bản tóm tắt
Lưu ý rằng kích thước của Tensor 4D được xác định bởi "NHWC" hoặc "NCHW". Kích thước của Tensor 1D phù hợp với kích thước C của Tensor 4D.
Lập luận:
- phạm vi: Một đối tượng Phạm vi
- x: Tensor 4D cho dữ liệu đầu vào.
- tỷ lệ: Tenor 1D cho hệ số tỷ lệ, để chia tỷ lệ x chuẩn hóa.
- offset: Tenor 1D để bù, để chuyển sang x chuẩn hóa.
- có nghĩa là: Một Tenor 1D cho giá trị trung bình của dân số. Chỉ được sử dụng để suy luận; phải trống để đào tạo.
- phương sai: Tenor 1D cho phương sai tổng thể. Chỉ được sử dụng để suy luận; phải trống để đào tạo.
Thuộc tính tùy chọn (xem Attrs
):
- epsilon: Một số float nhỏ được thêm vào phương sai của x.
- data_format: Định dạng dữ liệu cho x và y. "NHWC" (mặc định) hoặc "NCHW".
- is_training: Giá trị bool để biểu thị thao tác là dành cho đào tạo (mặc định) hoặc suy luận.
Trả về:
-
Output
y: Tensor 4D cho dữ liệu đầu ra. - Lô_mean
Output
: Tenor 1D cho giá trị trung bình lô được tính toán, được TensorFlow sử dụng để tính giá trị trung bình đang chạy. -
Output
batch_variance: Tensor 1D cho phương sai lô được tính toán, được TensorFlow sử dụng để tính toán phương sai đang chạy. - Dự trữ_space_1
Output
: Tenor 1D cho giá trị trung bình lô được tính toán, sẽ được sử dụng lại trong tính toán độ dốc. - Dự trữ_space_2
Output
: Tenor 1D cho phương sai lô được tính toán (phương sai đảo ngược trong trường hợp cuDNN), được sử dụng lại trong tính toán độ dốc.
Hàm tạo và hàm hủy |
---|
FusedBatchNorm (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input scale, :: tensorflow::Input offset, :: tensorflow::Input mean, :: tensorflow::Input variance)
|
FusedBatchNorm (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input scale, :: tensorflow::Input offset, :: tensorflow::Input mean, :: tensorflow::Input variance, const FusedBatchNorm::Attrs & attrs) |
Thuộc tính công khai
Chức năng công cộng
Các hàm tĩnh công khai
Attrs DataFormat(
StringPiece x
)
Epsilon
Attrs Epsilon(
float x
)
Đang đào tạo
Attrs IsTraining(
bool x
)
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# tensorflow::ops::FusedBatchNorm Class Reference\n\ntensorflow::ops::FusedBatchNorm\n===============================\n\n`#include \u003cnn_ops.h\u003e`\n\nBatch normalization.\n\nSummary\n-------\n\nNote that the size of 4D Tensors are defined by either \"NHWC\" or \"NCHW\". The size of 1D Tensors matches the dimension C of the 4D Tensors.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- x: A 4D [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) for input data.\n- scale: A 1D [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) for scaling factor, to scale the normalized x.\n- offset: A 1D [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) for offset, to shift to the normalized x.\n- mean: A 1D [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) for population mean. Used for inference only; must be empty for training.\n- variance: A 1D [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) for population variance. Used for inference only; must be empty for training.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/fused-batch-norm/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs)):\n\n- epsilon: A small float number added to the variance of x.\n- data_format: The data format for x and y. Either \"NHWC\" (default) or \"NCHW\".\n- is_training: A bool value to indicate the operation is for training (default) or inference.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) y: A 4D [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) for output data.\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) batch_mean: A 1D [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) for the computed batch mean, to be used by TensorFlow to compute the running mean.\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) batch_variance: A 1D [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) for the computed batch variance, to be used by TensorFlow to compute the running variance.\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) reserve_space_1: A 1D [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) for the computed batch mean, to be reused in the gradient computation.\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) reserve_space_2: A 1D [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) for the computed batch variance (inverted variance in the cuDNN case), to be reused in the gradient computation.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [FusedBatchNorm](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a69c179b344cda5895eb3483fb7448928)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` scale, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` offset, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` mean, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` variance)` ||\n| [FusedBatchNorm](#classtensorflow_1_1ops_1_1_fused_batch_norm_1af4af8407dca8fff3c164daa4c2f6a827)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` scale, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` offset, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` mean, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` variance, const `[FusedBatchNorm::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/fused-batch-norm/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [batch_mean](#classtensorflow_1_1ops_1_1_fused_batch_norm_1af8a5a9177a16c78954e28294cc5df54b) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [batch_variance](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a699f25d6a78f4be2daa89eed8be158fa) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_fused_batch_norm_1ad685771a3e631d8df2ad7efdbc6ba522) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [reserve_space_1](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a8d5f73afcfa418b1dd3f8c9bf586365f) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [reserve_space_2](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a3f7515925a361980789e76ea3a5bfea3) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [y](#classtensorflow_1_1ops_1_1_fused_batch_norm_1aa3cdf2e86ba7283cd1b046beee6d04b9) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| [DataFormat](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a609451fcc6f8fa94a6b11137d5db9264)`(StringPiece x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/fused-batch-norm/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs) |\n| [Epsilon](#classtensorflow_1_1ops_1_1_fused_batch_norm_1ac732e3d3d1e1c4ed404daf2820324b34)`(float x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/fused-batch-norm/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs) |\n| [IsTraining](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a89f98ad4ef79d386a2bf3d64d024f624)`(bool x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/fused-batch-norm/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs) |\n\n| ### Structs ||\n|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::FusedBatchNorm::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/fused-batch-norm/attrs) | Optional attribute setters for [FusedBatchNorm](/versions/r1.15/api_docs/cc/class/tensorflow/ops/fused-batch-norm#classtensorflow_1_1ops_1_1_fused_batch_norm). |\n\nPublic attributes\n-----------------\n\n### batch_mean\n\n```scdoc\n::tensorflow::Output batch_mean\n``` \n\n### batch_variance\n\n```gdscript\n::tensorflow::Output batch_variance\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\n### reserve_space_1\n\n```scdoc\n::tensorflow::Output reserve_space_1\n``` \n\n### reserve_space_2\n\n```scdoc\n::tensorflow::Output reserve_space_2\n``` \n\n### y\n\n```text\n::tensorflow::Output y\n``` \n\nPublic functions\n----------------\n\n### FusedBatchNorm\n\n```gdscript\n FusedBatchNorm(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input x,\n ::tensorflow::Input scale,\n ::tensorflow::Input offset,\n ::tensorflow::Input mean,\n ::tensorflow::Input variance\n)\n``` \n\n### FusedBatchNorm\n\n```gdscript\n FusedBatchNorm(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input x,\n ::tensorflow::Input scale,\n ::tensorflow::Input offset,\n ::tensorflow::Input mean,\n ::tensorflow::Input variance,\n const FusedBatchNorm::Attrs & attrs\n)\n``` \n\nPublic static functions\n-----------------------\n\n### DataFormat\n\n```text\nAttrs DataFormat(\n StringPiece x\n)\n``` \n\n### Epsilon\n\n```text\nAttrs Epsilon(\n float x\n)\n``` \n\n### IsTraining\n\n```text\nAttrs IsTraining(\n bool x\n)\n```"]]