當前位置: 首頁>>代碼示例>>Python>>正文


Python functions.elu方法代碼示例

本文整理匯總了Python中chainer.functions.elu方法的典型用法代碼示例。如果您正苦於以下問題:Python functions.elu方法的具體用法?Python functions.elu怎麽用?Python functions.elu使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在chainer.functions的用法示例。


在下文中一共展示了functions.elu方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from chainer import functions [as 別名]
# 或者: from chainer.functions import elu [as 別名]
def __init__(self,
                 in_channels,
                 out_channels):
        super(LwopEncoderFinalBlock, self).__init__()
        with self.init_scope():
            self.pre_conv = conv1x1_block(
                in_channels=in_channels,
                out_channels=out_channels,
                use_bias=True,
                use_bn=False)
            self.body = SimpleSequential()
            with self.body.init_scope():
                for i in range(3):
                    setattr(self.body, "block{}".format(i + 1), dwsconv3x3_block(
                        in_channels=out_channels,
                        out_channels=out_channels,
                        use_bn=False,
                        dw_activation=(lambda: F.elu),
                        pw_activation=(lambda: F.elu)))
            self.post_conv = conv3x3_block(
                in_channels=out_channels,
                out_channels=out_channels,
                use_bias=True,
                use_bn=False) 
開發者ID:osmr,項目名稱:imgclsmob,代碼行數:26,代碼來源:lwopenpose_cmupan.py

示例2: forward

# 需要導入模塊: from chainer import functions [as 別名]
# 或者: from chainer.functions import elu [as 別名]
def forward(self, inputs):
        # Input shape: [batch_size, num_nodes, feature_dims]
        batch_size, num_nodes = inputs.shape[:2]
        inputs = inputs.reshape(batch_size * num_nodes, -1)
        # New shape: [batch_size * num_nodes, feature_dims]

        x = F.elu(self.fc1(inputs))
        x = F.dropout(x, self.dropout_prob)
        x = F.elu(self.fc2(x))
        x = self.bn(x)

        return x.reshape(batch_size, num_nodes, -1) 
開發者ID:chainer,項目名稱:models,代碼行數:14,代碼來源:mlp.py

示例3: make_q_func

# 需要導入模塊: from chainer import functions [as 別名]
# 或者: from chainer.functions import elu [as 別名]
def make_q_func(self, env):
        n_hidden_channels = 10
        return StatelessRecurrentSequential(
            L.Linear(env.observation_space.low.size, n_hidden_channels),
            F.elu,
            L.NStepRNNTanh(1, n_hidden_channels, n_hidden_channels, 0),
            L.Linear(n_hidden_channels, env.action_space.n),
            DiscreteActionValue,
        ) 
開發者ID:chainer,項目名稱:chainerrl,代碼行數:11,代碼來源:basetest_dqn_like.py

示例4: forward

# 需要導入模塊: from chainer import functions [as 別名]
# 或者: from chainer.functions import elu [as 別名]
def forward(self, inputs, device):
        x, = inputs
        return functions.elu(x, alpha=self.alpha), 
開發者ID:chainer,項目名稱:chainer,代碼行數:5,代碼來源:test_elu.py

示例5: __call__

# 需要導入模塊: from chainer import functions [as 別名]
# 或者: from chainer.functions import elu [as 別名]
def __call__(self, x, test=False):
        h = self.b1(F.elu(self.c1(x)), test=test)
        h = self.b2(F.elu(self.c2(h)), test=test)
        h = self.b3(F.elu(self.c3(h)), test=test)
        h = self.r1(h, test=test)
        h = self.r2(h, test=test)
        h = self.r3(h, test=test)
        h = self.r4(h, test=test)
        h = self.r5(h, test=test)
        h = self.b4(F.elu(self.d1(h)), test=test)
        h = self.b5(F.elu(self.d2(h)), test=test)
        y = self.d3(h)
        return (F.tanh(y)+1)*127.5 
開發者ID:yusuketomoto,項目名稱:chainer-fast-neuralstyle,代碼行數:15,代碼來源:net.py

示例6: selu

# 需要導入模塊: from chainer import functions [as 別名]
# 或者: from chainer.functions import elu [as 別名]
def selu(x):
    alpha = float(1.6732632423543772848170429916717)
    scale = float(1.0507009873554804934193349852946)
    return  scale * F.elu(x, alpha = alpha) 
開發者ID:Aixile,項目名稱:chainer-gan-experiments,代碼行數:6,代碼來源:ops.py


注:本文中的chainer.functions.elu方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。