def __init__(self, size_embed, size, size_out, depth, gru_activation=tanh, dropout_prob=0.0): autoassign(locals()) self.Encode = StackedGRU(self.size_embed, self.size, self.depth, activation=self.gru_activation, dropout_prob=self.dropout_prob) self.FromImg = Dense(self.size_out, self.size) self.Predict = Dense(self.size, self.size_embed) self.params = params(self.Encode, self.FromImg, self.Predict)
def __init__(self, size_repr, size_hidden=200, size_classify=3, activation=tanh, dropout=0.0): autoassign(locals()) self.Dropout = Dropout(prob=self.dropout) self.L1 = WithDropout(Dense(self.size_repr * 2, self.size_hidden), prob=dropout) self.L2 = WithDropout(Dense(self.size_hidden, self.size_hidden), prob=dropout) self.L3 = WithDropout(Dense(self.size_hidden, self.size_hidden), prob=dropout) self.classify = Dense(self.size_hidden, self.size_classify) self.params = util.params(self.Dropout, self.L1, self.L2, self.L3, self.classify)
def __init__(self, size_vocab, size_embed, size, size_out, depth, out_depth=1, # FIXME USE THIS PARAM gru_activation=tanh, visual_activation=linear, dropout_prob=0.0): autoassign(locals()) self.Embed = Embedding(self.size_vocab, self.size_embed) self.Encode = StackedGRUH0(self.size_embed, self.size, self.depth, activation=self.gru_activation, dropout_prob=self.dropout_prob) self.DecodeT = StackedGRU(self.size_embed, self.size, self.depth, activation=self.gru_activation, dropout_prob=self.dropout_prob) self.PredictT = Dense(size_in=self.size, size_out=self.size_embed) self.DecodeV = Dense(self.size, self.size_out) self.params = params(self.Embed, self.DecodeT, self.PredictT, self.DecodeV)
def __init__(self, size_vocab, size_embed, size, size_out, depth, textual, out_depth=1, gru_activation=tanh, visual_activation=linear, dropout_prob=0.0): autoassign(locals()) self.Embed = Embedding(self.size_vocab, self.size_embed) self.Visual = Visual(self.size_embed, self.size, self.size_out, self.depth, out_depth=self.out_depth, gru_activation=self.gru_activation, dropout_prob=self.dropout_prob) self.Textual = textual(self.size_embed, self.size, self.size_out, self.depth, gru_activation=self.gru_activation, dropout_prob=self.dropout_prob) self.params = params(self.Embed, self.Visual, self.Textual)
def __init__(self, size_embed, size, size_out, depth, gru_activation=tanh, dropout_prob=0.0): autoassign(locals()) encoder = lambda size_in, size:\ StackedGRUH0(size_embed, size, self.depth, activation=self.gru_activation, dropout_prob=self.dropout_prob) decoder = lambda size_in, size: \ StackedGRU(size_embed, size, self.depth, activation=self.gru_activation, dropout_prob=self.dropout_prob) self.Encdec = EncoderDecoderGRU(self.size, self.size, self.size, encoder=encoder, decoder=decoder) self.Predict = Dense(size_in=self.size, size_out=self.size_embed) self.params = params(self.Encdec, self.Predict)
def __init__(self, size_repr, size_classify=3, dropout=0.0): autoassign(locals()) self.Dropout = Dropout(prob=self.dropout) self.classify = Dense(self.size_repr * 2, self.size_classify) self.params = util.params(self.Dropout, self.classify)
def __init__(self, size_embed, size, size_out, depth, out_depth=1, gru_activation=tanh, dropout_prob=0.0): autoassign(locals()) self.Encode = StackedGRUH0(self.size_embed, self.size, self.depth, activation=self.gru_activation, dropout_prob=self.dropout_prob) self.Project = Dense(self.size, self.size_out) self.params = params(self.Encode, self.Project)