code: def test_noise_injection_with_checkpointing():
      from cntk import initializer
  
      shape = (100, 100)
  
      w1 = parameter(
          shape=shape, init=initializer.glorot_uniform(seed=123)
      )
      w2 = parameter(
          shape=shape, init=initializer.glorot_uniform(seed=123)
      )
      w3 = parameter(
          shape=shape, init=initializer.glorot_uniform(seed=123)
      )
  
      lr = C.learning_parameter_schedule_per_sample(0.5)
      m = C.momentum_schedule(0.99)
  
      learner1 = C.momentum_sgd(
          [w1], lr, m, gaussian_noise_injection_std_dev=0.5
      )
      learner2 = C.momentum_sgd(
          [w2], lr, m, gaussian_noise_injection_std_dev=0.5
      )
      learner3 = C.momentum_sgd(
          [w3], lr, m, gaussian_noise_injection_std_dev=0.5
      )
  
      assert np.allclose(w1.value, w2.value) and np.allclose(
          w1.value, w3.value
      )
  
      for i in range(10):
          checkpoint = learner1.create_checkpoint()
  
          v = np.float32(np.random.rand(100, 100))
  
          learner1.update({w1: v}, 1)
          learner2.update({w2: v}, 1)
          assert not np.allclose(w1.value, w2.value)
  
          learner3.restore_from_checkpoint(checkpoint)
          learner3.update({w3: v}, 1)
          assert np.allclose(w1.value, w3.value)
  
imports: from __future__ import division, print_function
  import numpy
  import cntk
  from cntk import parameter
  import pytest
  import sys
  import itertools
  from cntk.logging import ProgressPrinter
  from cntk.learners import sgd, learning_rate_schedule, learning_parameter_schedule, UnitType, universal
  from cntk.layers import Dense, Sequential
label_desc: Use image node_id 10 for calling a global function with example usage: test_noise_injection_with_checkpointing() without return types