コード例 #1
0
ファイル: stochastic.py プロジェクト: itdxer/neupy
    def output(self, input_value):
        if not self.training_state:
            return input_value

        theano_random = theano_random_stream()
        noise = theano_random.normal(size=input_value.shape, avg=self.mean, std=self.std)
        return input_value + noise
コード例 #2
0
ファイル: stochastic.py プロジェクト: ravisankaradepu/saddle
    def output(self, input_value):
        if not self.training_state:
            return input_value

        theano_random = theano_random_stream()
        noise = theano_random.normal(size=input_value.shape,
                                     avg=self.mean, std=self.std)
        return input_value + noise
コード例 #3
0
ファイル: stochastic.py プロジェクト: itdxer/neupy
    def output(self, input_value):
        if not self.training_state:
            return input_value

        theano_random = theano_random_stream()
        proba = 1.0 - self.proba
        mask = theano_random.binomial(n=1, p=proba, size=input_value.shape, dtype=input_value.dtype)
        return (mask * input_value) / proba
コード例 #4
0
ファイル: stochastic.py プロジェクト: ravisankaradepu/saddle
    def output(self, input_value):
        if not self.training_state:
            return input_value

        theano_random = theano_random_stream()
        proba = (1.0 - self.proba)
        mask = theano_random.binomial(n=1, p=proba,
                                      size=input_value.shape,
                                      dtype=input_value.dtype)
        return (mask * input_value) / proba
コード例 #5
0
    def __init__(self, n_visible, n_hidden, **options):
        self.theano_random = theano_random_stream()

        super(ConfigurableABC, self).__init__(n_hidden=n_hidden,
                                              n_visible=n_visible,
                                              **options)

        self.weight = create_shared_parameter(value=self.weight,
                                              name='algo:rbm/matrix:weight',
                                              shape=(n_visible, n_hidden))
        self.hidden_bias = create_shared_parameter(
            value=self.hidden_bias,
            name='algo:rbm/vector:hidden-bias',
            shape=(n_hidden, ),
        )
        self.visible_bias = create_shared_parameter(
            value=self.visible_bias,
            name='algo:rbm/vector:visible-bias',
            shape=(n_visible, ),
        )

        super(RBM, self).__init__(**options)
コード例 #6
0
ファイル: rbm.py プロジェクト: itdxer/neupy
    def __init__(self, n_visible, n_hidden, **options):
        self.theano_random = theano_random_stream()

        super(ConfigurableABC, self).__init__(n_hidden=n_hidden,
                                              n_visible=n_visible, **options)

        self.weight = create_shared_parameter(
            value=self.weight,
            name='algo:rbm/matrix:weight',
            shape=(n_visible, n_hidden)
        )
        self.hidden_bias = create_shared_parameter(
            value=self.hidden_bias,
            name='algo:rbm/vector:hidden-bias',
            shape=(n_hidden,),
        )
        self.visible_bias = create_shared_parameter(
            value=self.visible_bias,
            name='algo:rbm/vector:visible-bias',
            shape=(n_visible,),
        )

        super(RBM, self).__init__(**options)
コード例 #7
0
    def output(self, *input_values):
        mu, sigma = input_values

        random = theano_random_stream()
        return mu + T.exp(sigma) * random.normal(mu.shape)
コード例 #8
0
    def output(self, *input_values):
        mu, sigma = input_values

        random = theano_random_stream()
        return mu + T.exp(sigma) * random.normal(mu.shape)
コード例 #9
0
 def __init__(self, n_hidden, **options):
     self.theano_random = theano_random_stream()
     super(RBM, self).__init__(n_hidden=n_hidden, **options)