DeepLearning - Maple Programming Help

Home : Support : Online Help : Programming : DeepLearning Package : Managing Dataflow Graphs : DeepLearning/Restore

DeepLearning

 Restore
 save and restore sessions
 Save
 save and restore sessions

 Calling Sequence Restore(path) Save(path)

Parameters

 path - string; path to checkpoint file

Description

 • The Restore(path) command loads a saved computation session to memory from a checkpoint file located at path.
 • The Save(path) command saves a computation session in memory to a checkpoint file located at path.
 • These functions are part of the DeepLearning package, so they can be used in the short form Restore(..) and Save(..) only after executing the command with(DeepLearning). However, they can always be accessed through the long form of the command by using DeepLearning[Restore](..) or DeepLearning[Save](..).

Details

Examples

Examples of Einstein summation on vectors

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $v≔\mathrm{Variable}\left(\left[1.0,0.5\right],\mathrm{datatype}=\mathrm{float}\left[8\right]\right)$
 ${v}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Variable:0}}\\ {\mathrm{Shape: \left[2\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (1)
 > $c≔\mathrm{Constant}\left(\left[1.5,3.0\right],\mathrm{datatype}=\mathrm{float}\left[8\right]\right)$
 ${c}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Const:0}}\\ {\mathrm{Shape: \left[2\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (2)
 > $\mathrm{AssignAdd}\left(v,c\right)$
 $\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: AssignAdd:0}}\\ {\mathrm{Shape: \left[2\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (3)
 > $\mathrm{sess}≔\mathrm{GetDefaultSession}\left(\right)$
 ${\mathrm{sess}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Session}}\\ {\mathrm{}}\end{array}\right]$ (4)
 > $\mathrm{sess}:-\mathrm{Run}\left(\mathrm{VariablesInitializer}\left(\right)\right)$
 ${\mathrm{Python}}{:-}{\mathrm{None}}$ (5)
 > $\mathrm{Save}\left("/tmp/model.ckpt"\right)$
 > $\mathrm{Restore}\left("/tmp/model.ckpt"\right)$

Compatibility

 • The DeepLearning[Restore] and DeepLearning[Save] commands were introduced in Maple 2018.