add deeper domain cnn; refactor hyperband using load_data function
This commit is contained in:
@@ -2,7 +2,7 @@ from collections import namedtuple
|
||||
|
||||
import keras
|
||||
from keras.engine import Input, Model as KerasModel
|
||||
from keras.layers import Conv1D, Dense, Dropout, Embedding, GlobalMaxPooling1D, TimeDistributed
|
||||
from keras.layers import Conv1D, Dense, Dropout, Embedding, GlobalAveragePooling1D, GlobalMaxPooling1D, TimeDistributed
|
||||
|
||||
import dataset
|
||||
|
||||
@@ -22,6 +22,24 @@ def get_domain_embedding_model(embedding_size, input_length, filter_size, kernel
|
||||
return KerasModel(x, y)
|
||||
|
||||
|
||||
def get_domain_embedding_model2(embedding_size, input_length, filter_size, kernel_size, hidden_dims,
|
||||
drop_out=0.5) -> KerasModel:
|
||||
x = y = Input(shape=(input_length,))
|
||||
y = Embedding(input_dim=dataset.get_vocab_size(), output_dim=embedding_size)(y)
|
||||
y = Conv1D(filter_size,
|
||||
kernel_size,
|
||||
activation='relu')(y)
|
||||
y = Conv1D(filter_size,
|
||||
kernel_size,
|
||||
activation='relu')(y)
|
||||
y = Conv1D(filter_size,
|
||||
kernel_size,
|
||||
activation='relu')(y)
|
||||
y = GlobalAveragePooling1D()(y)
|
||||
y = Dense(hidden_dims, activation="relu")(y)
|
||||
return KerasModel(x, y)
|
||||
|
||||
|
||||
def get_final_model(cnnDropout, flow_features, window_size, domain_length, cnn_dims, kernel_size,
|
||||
dense_dim, cnn) -> Model:
|
||||
ipt_domains = Input(shape=(window_size, domain_length), name="ipt_domains")
|
||||
|
Reference in New Issue
Block a user