def test_save(self): self.assertFalse(self.net.layers, "la red tiene capas") layer = Input(name="input") self.net.add_layer(layer) path = self.net.save(self.root_dir) result = path.open().read_yaml() expected = { 'name': 'test_save', 'order_layers': ['input'], 'layers': { 'input': { 'batch_size': None, 'input_var': 'int64', 'name': 'input', 'name': 'input', 'shape': [None], 'type': 'chibi_genjuu.network.Input', } } } self.assertEqual(expected, result)
def setUp(self): super().setUp() self.net = Network(name=self._testMethodName) self.input_layer = Input( name="input", shape=(2, ), ) self.net.add_layer(self.input_layer) self.softplus = Dense(name="softplus", input=self.input_layer, number_units=2, function_no_liniarity='softplus') self.sigmoid = Dense(name="sigmoid", input=self.softplus, number_units=1, function_no_liniarity='sigmoid') self.net.add_layer(self.softplus) self.net.add_layer(self.sigmoid)
def test_add_layer_input(self): self.assertFalse(self.net.layers, "la red tiene capas") layer = Input(name="input") self.net.add_layer(layer) self.assertEqual(layer, self.net.layers[layer.name])
def setUp(self): super().setUp() self.input_layer = Input(name="input") self.layer = Dense(name="dense", input=self.input_layer)
def test_from_dict(self): d = self.layer.dict result_layer = Input.from_dict(d) self.assertEqual(result_layer.dict, self.layer.dict)
def test_can_parse_int_for_use_in_the_input_var(self): self.layer = Input(name="input", input_var='int32') self.assertEqual(self.layer.type_input_var, 'int32')
def setUp(self): super().setUp() self.layer = Input(name="input")