本文整理匯總了Python中neon.transforms.Softmax方法的典型用法代碼示例。如果您正苦於以下問題:Python transforms.Softmax方法的具體用法?Python transforms.Softmax怎麽用?Python transforms.Softmax使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類neon.transforms
的用法示例。
在下文中一共展示了transforms.Softmax方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main_branch
# 需要導入模塊: from neon import transforms [as 別名]
# 或者: from neon.transforms import Softmax [as 別名]
def main_branch(branch_nodes):
return [Conv((7, 7, 64), padding=3, strides=2, **common),
Pooling(**pool3s2p1),
Conv((1, 1, 64), **common),
Conv((3, 3, 192), **commonp1),
Pooling(**pool3s2p1),
inception([(64, ), (96, 128), (16, 32), (32, )]),
inception([(128,), (128, 192), (32, 96), (64, )]),
Pooling(**pool3s2p1),
inception([(192,), (96, 208), (16, 48), (64, )]),
branch_nodes[0],
inception([(160,), (112, 224), (24, 64), (64, )]),
inception([(128,), (128, 256), (24, 64), (64, )]),
inception([(112,), (144, 288), (32, 64), (64, )]),
branch_nodes[1],
inception([(256,), (160, 320), (32, 128), (128,)]),
Pooling(**pool3s2p1),
inception([(256,), (160, 320), (32, 128), (128,)]),
inception([(384,), (192, 384), (48, 128), (128,)]),
Pooling(fshape=7, strides=1, op="avg"),
Affine(nout=1000, init=init1, activation=Softmax(), bias=Constant(0))]
示例2: aux_branch
# 需要導入模塊: from neon import transforms [as 別名]
# 或者: from neon.transforms import Softmax [as 別名]
def aux_branch(bnode):
return [bnode,
Pooling(fshape=5, strides=3, op="avg"),
Conv((1, 1, 128), **common),
Affine(nout=1024, init=init1, activation=relu, bias=bias),
Dropout(keep=0.3),
Affine(nout=1000, init=init1, activation=Softmax(), bias=Constant(0))]
# Now construct the model
示例3: create_network
# 需要導入模塊: from neon import transforms [as 別名]
# 或者: from neon.transforms import Softmax [as 別名]
def create_network():
init = Kaiming()
padding = dict(pad_d=1, pad_h=1, pad_w=1)
strides = dict(str_d=2, str_h=2, str_w=2)
dilation = dict(dil_d=2, dil_h=2, dil_w=2)
common = dict(init=init, batch_norm=True, activation=Rectlin())
layers = [
Conv((9, 9, 9, 16), padding=padding, strides=strides, init=init, activation=Rectlin()),
Conv((5, 5, 5, 32), dilation=dilation, **common),
Conv((3, 3, 3, 64), dilation=dilation, **common),
Pooling((2, 2, 2), padding=padding, strides=strides),
Conv((2, 2, 2, 128), **common),
Conv((2, 2, 2, 128), **common),
Conv((2, 2, 2, 128), **common),
Conv((2, 2, 2, 256), **common),
Conv((2, 2, 2, 1024), **common),
Conv((2, 2, 2, 4096), **common),
Conv((2, 2, 2, 2048), **common),
Conv((2, 2, 2, 1024), **common),
Dropout(),
Affine(2, init=Kaiming(local=False), batch_norm=True, activation=Softmax())
]
return Model(layers=layers)
# Parse the command line arguments