Пример #1
0
 def __init__(self,
              channel_1_num,
              channel_2_num,
              conv_size,
              hidden_size,
              pool_size,
              learning_rate,
              x_dim=784,
              y_dim=10):
     self.channel_1_num = channel_1_num
     self.channel_2_num = channel_2_num
     self.conv_size = nni.choice(2, 3, 5, 7, name='self.conv_size')
     self.hidden_size = nni.choice(124, 512, 1024, name='self.hidden_size')
     self.pool_size = pool_size
     self.learning_rate = nni.uniform(0.0001,
                                      0.1,
                                      name='self.learning_rate')
     self.x_dim = x_dim
     self.y_dim = y_dim
     self.images = tf.placeholder(tf.float32, [None, self.x_dim],
                                  name='input_x')
     self.labels = tf.placeholder(tf.float32, [None, self.y_dim],
                                  name='input_y')
     self.keep_prob = tf.placeholder(tf.float32, name='keep_prob')
     self.train_step = None
     self.accuracy = None
Пример #2
0
 def test_default_name(self):
     val = nni.uniform(1, 10)  # NOTE: assign this line number to lineno1
     self.assertEqual(val, '5')