:py:mod:`orcanet.builder_util.builders` ======================================= .. py:module:: orcanet.builder_util.builders Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: orcanet.builder_util.builders.BlockBuilder Functions ~~~~~~~~~ .. autoapisummary:: orcanet.builder_util.builders.get_input_block .. py:class:: BlockBuilder(defaults=None, verbose=False, input_opts=None, **kwargs) Builds single-input block-wise sequential neural network. :Parameters: **defaults** : dict or None Default values for all blocks in the model. **verbose** : bool Print info about the building process? **batch_size** : int, optional Define a fixed batchsize for the input. .. !! processed by numpydoc !! .. py:method:: build(input_shape, configs) Build the whole model, using the default values when arguments are missing in the layer_configs. :Parameters: **input_shape** : dict Name and shape of the input layer. **configs** : list List of configurations for the blocks in the model. Each element in the list is a dict and will result in one block connected to the previous one. The dict has to contain the type of the block, as well as any arguments required by that specific block type. :Returns: **model** : keras model .. .. !! processed by numpydoc !! .. py:method:: attach_block(layer, layer_config) Attach a block to the given layer based on the layer config. Will use the default values given during initialization if they are not present in the layer config. :Parameters: **layer** : keras layer Layer to attach the block to. **layer_config** : dict Configuration of the block to attach. The dict has to contain the type of the block, as well as any arguments required by that specific block. :Returns: keras layer .. .. !! processed by numpydoc !! .. py:function:: get_input_block(input_shapes, batchsize=None, names=None) Build input layers according to a dict mapping the layer names to shapes. If none appears in shape, input is ragged. :Parameters: **input_shapes** : dict Keys: Input layer names. Values: Their shapes. **batchsize** : int, optional Specify fixed batchsize. **names** : tuple, optional Make sure the inputs are these names and return them in this order. :Returns: **inputs** : tf.Tensor or tuple A list of named keras input layers, or the input Tensor if there is only one input. .. !! processed by numpydoc !!