Python tensorflow.python.platform.test.TestCase() Examples

The following are 5 code examples of tensorflow.python.platform.test.TestCase(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module tensorflow.python.platform.test , or try the search function .
Example #1
Source File: learning_test.py    From tf-slim with Apache License 2.0 5 votes vote down vote up
def setUp(self):
    super(test.TestCase, self).setUp()
    np.random.seed(0)
    self._max_norm = 1.0
    self._grad_vec = np.array([1., 2., 3.])
    self._clipped_grad_vec = self.clip_values(self._grad_vec)
    self._zero_vec = np.zeros(self._grad_vec.size) 
Example #2
Source File: learning_test.py    From tf-slim with Apache License 2.0 5 votes vote down vote up
def setUp(self):
    super(test.TestCase, self).setUp()
    np.random.seed(0)
    self._multiplier = 3.7
    self._grad_vec = np.array([1., 2., 3.])
    self._multiplied_grad_vec = np.multiply(self._grad_vec, self._multiplier) 
Example #3
Source File: learning_test.py    From tf-slim with Apache License 2.0 5 votes vote down vote up
def setUp(self):
    super(test.TestCase, self).setUp()
    # Create an easy training set:
    np.random.seed(0)

    self._inputs = np.zeros((16, 4))
    self._labels = np.random.randint(0, 2, size=(16, 1)).astype(np.float32)

    for i in range(16):
      j = int(2 * self._labels[i] + np.random.randint(0, 2))
      self._inputs[i, j] = 1 
Example #4
Source File: learning_test.py    From tf-slim with Apache License 2.0 5 votes vote down vote up
def setUp(self):
    super(test.TestCase, self).setUp()
    # Create an easy training set:
    np.random.seed(0)
    self._inputs = np.random.rand(16, 4).astype(np.float32)
    self._labels = np.random.randint(0, 2, size=(16, 1)).astype(np.float32) 
Example #5
Source File: learning_test.py    From tf-slim with Apache License 2.0 5 votes vote down vote up
def setUp(self):
    super(test.TestCase, self).setUp()
    # Create an easy training set:
    np.random.seed(0)

    self._inputs = np.zeros((16, 4))
    self._labels = np.random.randint(0, 2, size=(16, 1)).astype(np.float32)

    for i in range(16):
      j = int(2 * self._labels[i] + np.random.randint(0, 2))
      self._inputs[i, j] = 1