當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。