From 29b5898792c8873df9048fe5e545804c17ccd562 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 18 Sep 2019 07:40:18 -0500 Subject: [PATCH] tf.variance_scaling_initializer #396 --- src/TensorFlowNET.Core/APIs/tf.init.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/TensorFlowNET.Core/APIs/tf.init.cs b/src/TensorFlowNET.Core/APIs/tf.init.cs index 6ab916b3..15bcd766 100644 --- a/src/TensorFlowNET.Core/APIs/tf.init.cs +++ b/src/TensorFlowNET.Core/APIs/tf.init.cs @@ -62,5 +62,25 @@ namespace Tensorflow stddev: stddev, seed: seed, dtype: dtype); + + /// + /// Initializer capable of adapting its scale to the shape of weights tensors. + /// + /// + /// + /// + /// + /// + /// + public IInitializer variance_scaling_initializer(float scale = 1.0f, + string mode = "fan_in", + string distribution = "truncated_normal", + int? seed = null, + TF_DataType dtype = TF_DataType.TF_FLOAT) => new VarianceScaling( + scale: scale, + mode: mode, + distribution: distribution, + seed: seed, + dtype: dtype); } }