Source code for akida.input_data

from akida.core import (Layer, LayerParams, LayerType)


[docs]class InputData(Layer): """This layer is used to specify the input dimensions of a low bitwidth Model. Models accepting 8-bit images must start with an InputConvolutional layer, but layers accepting integer inputs with a lower bitwidth (i.e. not images) must start instead with an InputData layer. This layer does not modify its inputs: it just allows to define the Model input dimensions and bitwidth. Args: input_shape (tuple): the 3D input shape. input_bits (int): input bitwidth. name (str, optional): name of the layer. """ def __init__(self, input_shape, input_bits=4, name=""): try: params = LayerParams( LayerType.InputData, { "input_width": input_shape[0], "input_height": input_shape[1], "input_channels": input_shape[2], "input_bits": input_bits }) # Call parent constructor to initialize C++ bindings # Note that we invoke directly __init__ instead of using super, as # specified in pybind documentation Layer.__init__(self, params, name) except BaseException: self = None raise