DeepLearning - Maple Programming Help

Home : Support : Online Help : Programming : DeepLearning Package : Tensors : Managing Tensors : DeepLearning/VariablesInitializer

DeepLearning

 VariablesInitializer
 initialize variables

 Calling Sequence VariablesInitializer()

Description

 • The VariablesInitializer() command returns an Operation which can be run in a Session to initialize all the variables in the graph.
 • This function is part of the DeepLearning package, so it can be used in the short form VariablesInitializer(..) only after executing the command with(DeepLearning). However, it can always be accessed through the long form of the command by using DeepLearning[VariablesInitializer](..).

Details

 • The implementation of VariablesInitializer uses the tf.global_variables_initializer command from the TensorFlow Python API. Consult the TensorFlow Python API documentation for tf.global_variables_initializer for more information on random number generation during TensorFlow computations.

Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $v≔\mathrm{Variable}\left(\left[0.3\right],\mathrm{datatype}=\mathrm{float}\left[8\right]\right)$
 ${v}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Variable:0}}\\ {\mathrm{Shape: \left[1\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (1)
 > $\mathrm{init}≔\mathrm{VariablesInitializer}\left(\right)$
 ${\mathrm{init}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: init}}\\ {\mathrm{Shape: undefined}}\\ {\mathrm{Data Type: undefined}}\end{array}\right]$ (2)
 > $\mathrm{sess}≔\mathrm{GetDefaultSession}\left(\right)$
 ${\mathrm{sess}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Session}}\\ {\mathrm{}}\end{array}\right]$ (3)
 > $\mathrm{sess}:-\mathrm{Run}\left(\mathrm{init}\right)$
 ${\mathrm{Python}}{:-}{\mathrm{None}}$ (4)

Compatibility

 • The DeepLearning[VariablesInitializer] command was introduced in Maple 2018.