class_docstr: Unit tests for QLearning.
class_docstr_tok: ["Unit","tests","for","QLearning","."]
code: def test_replay_start_size(self, mock_parameters):
      self._setup_parameters(mock_parameters.return_value)
      # Set exploration rate to 0
      mock_parameters.return_value.initial_epsilon = 0
      mock_parameters.return_value.epsilon_decay_step_count = 100
      mock_parameters.return_value.epsilon_minimum = 0
      mock_parameters.return_value.replay_start_size = 3
  
      action_space = spaces.Discrete(2)
      observation_space = spaces.Box(0, 1, (1,))
      sut = QLearning("", observation_space, action_space)
      sut._trainer = MagicMock()
      sut._replay_memory = MagicMock()
  
      _, debug = sut.start(np.array([0.1], np.float32))
      self.assertEqual(sut.step_count, 0)
      self.assertEqual(sut._trainer.train_minibatch.call_count, 0)
      self.assertEqual(debug["action_behavior"], "RANDOM")
  
      _, debug = sut.step(0.1, np.array([0.2], np.float32))
      self.assertEqual(sut.step_count, 1)
      self.assertEqual(sut._trainer.train_minibatch.call_count, 0)
      self.assertEqual(debug["action_behavior"], "RANDOM")
  
      sut.end(0.2, np.array([0.3], np.float32))
      self.assertEqual(sut.step_count, 2)
      self.assertEqual(sut._trainer.train_minibatch.call_count, 0)
  
      _, debug = sut.start(np.array([0.4], np.float32))
      self.assertEqual(sut.step_count, 2)
      self.assertEqual(sut._trainer.train_minibatch.call_count, 0)
      self.assertEqual(debug["action_behavior"], "RANDOM")
  
      a, debug = sut.step(0.3, np.array([0.5], np.float32))
      self.assertEqual(sut.step_count, 3)
      self.assertEqual(sut._trainer.train_minibatch.call_count, 0)
      self.assertEqual(debug["action_behavior"], "GREEDY")
  
      a, debug = sut.start(np.array([0.6], np.float32))
      self.assertEqual(sut.step_count, 3)
      self.assertEqual(sut._trainer.train_minibatch.call_count, 0)
      self.assertEqual(debug["action_behavior"], "GREEDY")
  
      a, debug = sut.step(0.4, np.array([0.7], np.float32))
      self.assertEqual(sut.step_count, 4)
      self.assertEqual(sut._trainer.train_minibatch.call_count, 1)
      self.assertEqual(debug["action_behavior"], "GREEDY")
  
imports: import unittest
  import cntk.contrib.deeprl.tests.spaces
  import numpy
  from cntk.contrib.deeprl.agent.qlearning import QLearning
  from cntk.contrib.deeprl.agent.shared.cntk_utils import huber_loss
  from cntk.contrib.deeprl.agent.shared.replay_memory import _Transition
  from cntk.layers import Dense
  from cntk.losses import squared_error
  from cntk.ops import input_variable
label_desc: Use image node_id 13 for calling the QLearningTest obj's underlying member method code with example usage: obj.test_replay_start_size(mock_parameters) without return types