Пример #1
0
    def __init__(self, variables, filter_shape, input_shape, out_shape, name,
                 **kwargs):
        assert kwargs[
            "convolutional"] == True, "Set 'convolutional = True' in configuration."
        kwargs['variables'] = create_in_trg_conv(kwargs['name'])
        Notifier.__init__(self)
        Plotter.__init__(self)
        UnitsCNNReLU.__init__(self, **kwargs)

        assert not -1 in out_shape, "For de-convolutional layers, you need to " + \
                            "define the 'out_shape' in the configuration file."

        filt_size = (input_shape[1], out_shape[1], filter_shape[2],
                     out_shape[3])
        LOGGER.debug("out_size {0}".format(out_shape))
        LOGGER.debug("filt_size {0}".format(filt_size))

        DCNN.__init__(self, variables, name, input_shape, filt_size, out_shape,
                      **kwargs)

        CostCrossEntropy.__init__(self, **kwargs)
        WeightRegular.__init__(self, **kwargs)
        SparsityLeeConv.__init__(self, **kwargs)
        MaxNormRegular.__init__(self, **kwargs)
        SerializeLayer.__init__(self)
        Monitor.__init__(self)
        self.notify(Notifier.MAKE_FINISHED)
        self.notify(Notifier.COMPILE_FUNCTIONS)
        self.notify(Notifier.REGISTER_PLOTTING)
Пример #2
0
 def __init__(self, layers, name, noise_level = 0.5, **kwargs):
     Notifier.__init__(self)
     NNStack.__init__(self, layers, layers[0].input, name, **kwargs)
     CostReconErrDenoise.__init__(self, noise_level, **kwargs)
     SerializeStack.__init__(self)
     Monitor.__init__(self)
     Plotter.__init__(self)
     self.notify(Notifier.COMPILE_FUNCTIONS)
     self.notify(Notifier.REGISTER_PLOTTING)
Пример #3
0
 def __init__(self, layers, name, **kwargs):
     Notifier.__init__(self)
     NNStack.__init__(self, layers, layers[0].input, name)
     CostCrossEntropy.__init__(self, **kwargs)
     SerializeStack.__init__(self)
     Monitor.__init__(self)
     Plotter.__init__(self)
     self.notify(Notifier.COMPILE_FUNCTIONS)
     self.notify(Notifier.REGISTER_PLOTTING)
Пример #4
0
 def __init__(self, layers, name, **kwargs):
     Notifier.__init__(self)
     NNStack.__init__(self, layers, layers[0].input, name, **kwargs)
     CostCategoricCrossEntropy.__init__(self, self.activation_h(self.input), 
                                        self.target, **kwargs)
     SerializeStack.__init__(self)
     Monitor.__init__(self)
     Plotter.__init__(self)
     self.notify(Notifier.COMPILE_FUNCTIONS)
     self.notify(Notifier.REGISTER_PLOTTING)
Пример #5
0
    def __init__(self, **kwargs):
        kwargs['variables'] = create_in_trg(kwargs['name'])
        Notifier.__init__(self)
        UnitsNNTanh.__init__(self)

        LSTM.__init__(self, act_fun_out=lambda x: T.nnet.sigmoid(x), **kwargs)
        CostLogLikelihoodBinomial.__init__(self, **kwargs)
        SparsityLee.__init__(self, **kwargs)
        WeightRegularRNN.__init__(self, **kwargs)
        SerializeLayer.__init__(self)
        Monitor.__init__(self)
        Plotter.__init__(self)
        self.notify(Notifier.MAKE_FINISHED)
        self.notify(Notifier.COMPILE_FUNCTIONS)
        self.notify(Notifier.REGISTER_PLOTTING)
Пример #6
0
 def __init__(self, **kwargs):
     kwargs['variables'] = create_in(kwargs['name'])
     Notifier.__init__(self)
     UnitsNNLinear.__init__(self)
     UnitsDropOut.__init__(self, **kwargs)
     NonNegative.__init__(self, **kwargs)
     NNAuto.__init__(self, **kwargs)
     CostSquaredError.__init__(self, **kwargs)
     SparsityLee.__init__(self, **kwargs)
     WeightRegular.__init__(self, **kwargs)
     SerializeLayer.__init__(self)
     Monitor.__init__(self)
     Plotter.__init__(self)
     self.notify(Notifier.MAKE_FINISHED)
     self.notify(Notifier.COMPILE_FUNCTIONS)
     self.notify(Notifier.REGISTER_PLOTTING)
Пример #7
0
 def __init__(self, **kwargs):
     assert kwargs[
         "convolutional"] == True, "Set 'convolutional = True' in configuration."
     kwargs['variables'] = create_in_trg_conv(kwargs['name'])
     Notifier.__init__(self)
     Plotter.__init__(self)
     UnitsCNNSigmoid.__init__(self, **kwargs)
     UnitsDropOut.__init__(self, **kwargs)
     CNN_BN.__init__(self, **kwargs)
     CostCrossEntropy.__init__(self, **kwargs)
     WeightRegular.__init__(self, **kwargs)
     MaxNormRegular.__init__(self, **kwargs)
     SparsityLeeConv.__init__(self, **kwargs)
     SerializeLayer.__init__(self)
     Monitor.__init__(self)
     self.notify(Notifier.MAKE_FINISHED)
     self.notify(Notifier.COMPILE_FUNCTIONS)
     self.notify(Notifier.REGISTER_PLOTTING)
Пример #8
0
    def __init__(self, **kwargs):
        kwargs['variables'] = create_in_trg(kwargs['name'])
        Notifier.__init__(self)
        UnitsNNTanh.__init__(self)

        RNN_Gated.__init__(self,
                           act_fun_out=lambda x: T.nnet.sigmoid(x),
                           **kwargs)
        CostCrossEntropy.__init__(self, **kwargs)
        SparsityLee.__init__(self, **kwargs)
        weight_params = [
            self.Wxh, self.Wxr, self.Wxu, self.Whh, self.Why, self.Whr,
            self.Whu
        ]
        WeightRegular.__init__(self, wl_targets=weight_params, **kwargs)
        SerializeLayer.__init__(self)
        Monitor.__init__(self)
        Plotter.__init__(self)
        self.notify(Notifier.MAKE_FINISHED)
        self.notify(Notifier.COMPILE_FUNCTIONS)
        self.notify(Notifier.REGISTER_PLOTTING)
Пример #9
0
 def __init__(self, **kwargs):
     assert kwargs[
         "convolutional"] == True, "Set 'convolutional = True' in configuration."
     kwargs['variables'] = create_in_trg_conv(kwargs['name'])
     Notifier.__init__(self)
     Plotter.__init__(self)
     try:
         UnitsCNNReLU.__init__(self,
                               downsample_out=kwargs['downsample_out'])
     except KeyError:
         raise ValueError("Entry 'downsample_out' in kwargs needed.")
     UnitsDropOut.__init__(self, **kwargs)
     CNN_BN.__init__(self, **kwargs)
     CostCrossEntropy.__init__(self)
     WeightRegular.__init__(self, **kwargs)
     SparsityLeeConv.__init__(self, **kwargs)
     MaxNormRegular.__init__(self, **kwargs)
     SerializeLayer.__init__(self)
     Monitor.__init__(self)
     self.notify(Notifier.MAKE_FINISHED)
     self.notify(Notifier.COMPILE_FUNCTIONS)
     self.notify(Notifier.REGISTER_PLOTTING)