Beispiel #1
0
 def __init__(
         self,
         numFilters,
         filterHeight,
         filterWidth,
         filterDepth,
         name,
         stride=(1, 1, 1),
         pad=0,
         untieBiases=False,
         initializations=[MI.GlorotNormal('W'),
                          MI.SingleValue('b', 0)],
         flipFilters=True,
         **kwargs):
     super(Convolution3D,
           self).__init__(LasagneCONV.Conv3DLayer,
                          initializations=initializations,
                          lasagneHyperParameters={
                              "numFilters":
                              numFilters,
                              "filter_size":
                              (filterHeight, filterWidth, filterDepth),
                              "stride":
                              stride,
                              "pad":
                              pad,
                              "untie_biases":
                              untieBiases,
                              "flip_filters":
                              flipFilters
                          },
                          lasagneKwargs={},
                          name=name,
                          **kwargs)
Beispiel #2
0
    def __init__(
            self,
            size,
            initializations=[MI.GlorotNormal('W'),
                             MI.SingleValue('b', 0)],
            **kwargs):
        super(Dense, self).__init__(initializations=initializations, **kwargs)
        if isinstance(size, int):
            sh = (None, size)
        elif isinstance(size, float):
            sh = (None, int(size))
        else:
            sh = [None]
            sh.extend(list(size))
            sh = tuple(sh)

        self.size = size
        self.setHP("shape", sh)

        self.setParameters({
            "W": MTYPES.Parameter("%s.W" % (self.name)),
            "b": MTYPES.Parameter("%s.b" % (self.name))
        })

        self.inputShape = None
        self.originalInputShape = None
Beispiel #3
0
 def __init__(
         self,
         numFilters,
         filterSize,
         name,
         stride=1,
         pad=0,
         untieBiases=False,
         flipFilters=True,
         initializations=[MI.GlorotNormal('W'),
                          MI.SingleValue('b', 0)],
         **kwargs):
     super(Convolution1D, self).__init__(LasagneCONV.Conv1DLayer,
                                         initializations=initializations,
                                         lasagneHyperParameters={
                                             "num_filters": numFilters,
                                             "filter_size": filterSize,
                                             "stride": stride,
                                             "pad": pad,
                                             "untie_biases": untieBiases,
                                             "flip_filters": flipFilters
                                         },
                                         lasagneKwargs={},
                                         **kwargs)