当前位置: 首页>>代码示例>>Python>>正文


Python initializers.Orthogonal方法代码示例

本文整理汇总了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() 
开发者ID:keras-team,项目名称:keras-contrib,代码行数:6,代码来源:convaware.py

示例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() 
开发者ID:deepfakes,项目名称:faceswap,代码行数:8,代码来源:initializers.py

示例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 
开发者ID:HunterMcGushion,项目名称:hyperparameter_hunter,代码行数:11,代码来源:test_keras.py

示例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`) #################### 
开发者ID:HunterMcGushion,项目名称:hyperparameter_hunter,代码行数:14,代码来源:test_keras.py

示例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 
开发者ID:HunterMcGushion,项目名称:hyperparameter_hunter,代码行数:11,代码来源:test_keras.py

示例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 
开发者ID:HunterMcGushion,项目名称:hyperparameter_hunter,代码行数:11,代码来源:test_keras.py

示例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 #################### 
开发者ID:HunterMcGushion,项目名称:hyperparameter_hunter,代码行数:14,代码来源:test_keras.py

示例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 
开发者ID:HunterMcGushion,项目名称:hyperparameter_hunter,代码行数:11,代码来源:test_keras.py


注:本文中的keras.initializers.Orthogonal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。