LazyInstanceNorm2d¶
- class torch.nn.LazyInstanceNorm2d(eps=1e-05, momentum=0.1, affine=True, track_running_stats=True, device=None, dtype=None)[source][source]¶
一個
torch.nn.InstanceNorm2d模組,其num_features引數採用延遲初始化。InstanceNorm2d的num_features引數是從input.size(1)推斷出來的。將延遲初始化的屬性有 weight、bias、running_mean 和 running_var。請檢視
torch.nn.modules.lazy.LazyModuleMixin,獲取有關延遲模組及其限制的更多文件。- 引數
num_features – 從預期的輸入尺寸 或 推斷出的 。
eps (float) – 新增到分母上的值,用於數值穩定性。預設值:1e-5
momentum (可選[float]) – 用於計算 running_mean 和 running_var 的值。預設值:0.1
affine (bool) – 一個布林值。當設定為
True時,此模組具有可學習的仿射引數,初始化方式與 batch normalization 相同。預設值:False。track_running_stats (bool) – 一個布林值。當設定為
True時,此模組跟蹤執行中的均值和方差;當設定為False時,此模組不跟蹤這些統計資訊,在訓練和評估模式下始終使用批次統計資訊。預設值:False
- 形狀
輸入形狀: 或
輸出形狀: 或 (與輸入形狀相同)