本文整理汇总了Python中keras.initializers.Orthogonal方法的典型用法代码示例。如果您正苦于以下问题:Python initializers.Orthogonal方法的具体用法?Python initializers.Orthogonal怎么用?Python initializers.Orthogonal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类keras.initializers
的用法示例。
在下文中一共展示了initializers.Orthogonal方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: creat_model
# 需要导入模块: from keras import initializers [as 别名]
# 或者: from keras.initializers import Orthogonal [as 别名]
def creat_model(input_shape, num_class):
init = initializers.Orthogonal(gain=args.norm)
sequence_input =Input(shape=input_shape)
mask = Masking(mask_value=0.)(sequence_input)
if args.aug:
mask = augmentaion()(mask)
X = Noise(0.075)(mask)
if args.model[0:2]=='VA':
# VA
trans = LSTM(args.nhid,recurrent_activation='sigmoid',return_sequences=True,implementation=2,recurrent_initializer=init)(X)
trans = Dropout(0.5)(trans)
trans = TimeDistributed(Dense(3,kernel_initializer='zeros'))(trans)
rot = LSTM(args.nhid,recurrent_activation='sigmoid',return_sequences=True,implementation=2,recurrent_initializer=init)(X)
rot = Dropout(0.5)(rot)
rot = TimeDistributed(Dense(3,kernel_initializer='zeros'))(rot)
transform = Concatenate()([rot,trans])
X = VA()([mask,transform])
X = LSTM(args.nhid,recurrent_activation='sigmoid',return_sequences=True,implementation=2,recurrent_initializer=init)(X)
X = Dropout(0.5)(X)
X = LSTM(args.nhid,recurrent_activation='sigmoid',return_sequences=True,implementation=2,recurrent_initializer=init)(X)
X = Dropout(0.5)(X)
X = LSTM(args.nhid,recurrent_activation='sigmoid',return_sequences=True,implementation=2,recurrent_initializer=init)(X)
X = Dropout(0.5)(X)
X = TimeDistributed(Dense(num_class))(X)
X = MeanOverTime()(X)
X = Activation('softmax')(X)
model=Model(sequence_input,X)
return model
开发者ID:microsoft,项目名称:View-Adaptive-Neural-Networks-for-Skeleton-based-Human-Action-Recognition,代码行数:33,代码来源:va-rnn.py
示例2: __init__
# 需要导入模块: from keras import initializers [as 别名]
# 或者: from keras.initializers import Orthogonal [as 别名]
def __init__(self, eps_std=0.05, seed=None):
self.eps_std = eps_std
self.seed = seed
self.orthogonal = Orthogonal()
示例3: __init__
# 需要导入模块: from keras import initializers [as 别名]
# 或者: from keras.initializers import Orthogonal [as 别名]
def __init__(self, eps_std=0.05, seed=None, init=False):
self._init = init
self.eps_std = eps_std
self.seed = seed
self.orthogonal = initializers.Orthogonal()
self.he_uniform = initializers.he_uniform()
示例4: _build_fn_orthogonal_e_1
# 需要导入模块: from keras import initializers [as 别名]
# 或者: from keras.initializers import Orthogonal [as 别名]
def _build_fn_orthogonal_e_1(input_shape): # `Orthogonal(gain=Real(0.3, 0.9))`
model = Sequential(
[
Dense(Integer(50, 100), input_shape=input_shape),
Dense(1, kernel_initializer=Orthogonal(gain=Real(0.3, 0.9))),
]
)
model.compile(optimizer="adam", loss="binary_crossentropy", metrics=["accuracy"])
return model
示例5: _build_fn_orthogonal_e_3
# 需要导入模块: from keras import initializers [as 别名]
# 或者: from keras.initializers import Orthogonal [as 别名]
def _build_fn_orthogonal_e_3(input_shape): # `Orthogonal(gain=0.5)`
model = Sequential(
[
Dense(Integer(50, 100), input_shape=input_shape),
Dense(1, kernel_initializer=Orthogonal(gain=0.5)),
]
)
model.compile(optimizer="adam", loss="binary_crossentropy", metrics=["accuracy"])
return model
#################### `orthogonal` - Including default (`Initializer`) ####################
示例6: _build_fn_orthogonal_i_2
# 需要导入模块: from keras import initializers [as 别名]
# 或者: from keras.initializers import Orthogonal [as 别名]
def _build_fn_orthogonal_i_2(input_shape): # `Orthogonal()`
model = Sequential(
[
Dense(Integer(50, 100), input_shape=input_shape),
Dense(1, kernel_initializer=Orthogonal()),
]
)
model.compile(optimizer="adam", loss="binary_crossentropy", metrics=["accuracy"])
return model
示例7: _build_fn_orthogonal_i_4
# 需要导入模块: from keras import initializers [as 别名]
# 或者: from keras.initializers import Orthogonal [as 别名]
def _build_fn_orthogonal_i_4(input_shape): # `Orthogonal(gain=1.0)`
model = Sequential(
[
Dense(Integer(50, 100), input_shape=input_shape),
Dense(1, kernel_initializer=Orthogonal(gain=1.0)),
]
)
model.compile(optimizer="adam", loss="binary_crossentropy", metrics=["accuracy"])
return model
示例8: _build_fn_orthogonal_i_6
# 需要导入模块: from keras import initializers [as 别名]
# 或者: from keras.initializers import Orthogonal [as 别名]
def _build_fn_orthogonal_i_6(input_shape): # `Orthogonal(gain=Real(0.6, 1.6))`
model = Sequential(
[
Dense(Integer(50, 100), input_shape=input_shape),
Dense(1, kernel_initializer=Orthogonal(gain=Real(0.6, 1.6))),
]
)
model.compile(optimizer="adam", loss="binary_crossentropy", metrics=["accuracy"])
return model
#################### Categorical Initializers ####################
示例9: _build_fn_categorical_4
# 需要导入模块: from keras import initializers [as 别名]
# 或者: from keras.initializers import Orthogonal [as 别名]
def _build_fn_categorical_4(input_shape): # `Categorical(["glorot_normal", Orthogonal(gain=1)])`
model = Sequential(
[
Dense(Integer(50, 100), input_shape=input_shape),
Dense(1, kernel_initializer=Categorical(["glorot_normal", Orthogonal(gain=1)])),
]
)
model.compile(optimizer="adam", loss="binary_crossentropy", metrics=["accuracy"])
return model