Ejemplo n.º 1
0
def test_image_block():
    block = hyperblock_module.ImageBlock(normalize=None, augment=None)
    block.set_state(block.get_state())
    hp = kerastuner.HyperParameters()

    block.build(hp, ak.Input())

    assert common.name_in_hps('block_type', hp)
    assert common.name_in_hps('normalize', hp)
    assert common.name_in_hps('augment', hp)
Ejemplo n.º 2
0
 def assemble(self, input_node):
     block = hyperblock.ImageBlock()
     if max(self._shape[0], self._shape[1]) < 32:
         if self._num_samples < 10000:
             self.hps.append(hp_module.Choice(
                             block.name + '_resnet/v1/conv4_depth', [6],
                             default=6))
             self.hps.append(hp_module.Choice(
                             block.name + '_resnet/v2/conv4_depth', [6],
                             default=6))
             self.hps.append(hp_module.Choice(
                             block.name + '_resnet/next/conv4_depth', [6],
                             default=6))
             self.hps.append(hp_module.Int(
                             block.name + '_xception/num_residual_blocks', 2, 4,
                             default=4))
     return block(input_node)
Ejemplo n.º 3
0
 def assemble(self, input_node):
     # for image, use the num_instance to determine the range of the sizes of the
     # resnet and xception
     # use the image size to determine how the down sampling works, e.g. pooling.
     return hyperblock.ImageBlock()(input_node)