Python miscc.config.cfg.RNN_TYPE Examples
The following are 6
code examples of miscc.config.cfg.RNN_TYPE().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
miscc.config.cfg
, or try the search function
.
Example #1
Source File: model.py From DM-GAN with MIT License | 6 votes |
def __init__(self, ntoken, ninput=300, drop_prob=0.5, nhidden=128, nlayers=1, bidirectional=True): super(RNN_ENCODER, self).__init__() self.n_steps = cfg.TEXT.WORDS_NUM self.ntoken = ntoken # size of the dictionary self.ninput = ninput # size of each embedding vector self.drop_prob = drop_prob # probability of an element to be zeroed self.nlayers = nlayers # Number of recurrent layers self.bidirectional = bidirectional self.rnn_type = cfg.RNN_TYPE if bidirectional: self.num_directions = 2 else: self.num_directions = 1 # number of features in the hidden state self.nhidden = nhidden // self.num_directions self.define_module() self.init_weights()
Example #2
Source File: model.py From multiple-objects-gan with MIT License | 6 votes |
def __init__(self, ntoken, ninput=300, drop_prob=0.5, nhidden=128, nlayers=1, bidirectional=True): super(RNN_ENCODER, self).__init__() self.n_steps = cfg.TEXT.WORDS_NUM self.ntoken = ntoken # size of the dictionary self.ninput = ninput # size of each embedding vector self.drop_prob = drop_prob # probability of an element to be zeroed self.nlayers = nlayers # Number of recurrent layers self.bidirectional = bidirectional self.rnn_type = cfg.RNN_TYPE if bidirectional: self.num_directions = 2 else: self.num_directions = 1 # number of features in the hidden state self.nhidden = nhidden // self.num_directions self.define_module() self.init_weights()
Example #3
Source File: model.py From attn-gan with MIT License | 6 votes |
def __init__(self, ntoken, ninput=300, drop_prob=0.5, nhidden=128, nlayers=1, bidirectional=True): super(RNN_ENCODER, self).__init__() self.n_steps = cfg.TEXT.WORDS_NUM self.ntoken = ntoken # size of the dictionary self.ninput = ninput # size of each embedding vector self.drop_prob = drop_prob # probability of an element to be zeroed self.nlayers = nlayers # Number of recurrent layers self.bidirectional = bidirectional self.rnn_type = cfg.RNN_TYPE if bidirectional: self.num_directions = 2 else: self.num_directions = 1 # number of features in the hidden state self.nhidden = nhidden // self.num_directions self.define_module() self.init_weights()
Example #4
Source File: model.py From semantic-object-accuracy-for-generative-text-to-image-synthesis with MIT License | 6 votes |
def __init__(self, ntoken, ninput=300, drop_prob=0.5, nhidden=128, nlayers=1, bidirectional=True): super(RNN_ENCODER, self).__init__() self.n_steps = cfg.TEXT.WORDS_NUM self.ntoken = ntoken # size of the dictionary self.ninput = ninput # size of each embedding vector self.drop_prob = drop_prob # probability of an element to be zeroed self.nlayers = nlayers # Number of recurrent layers self.bidirectional = bidirectional self.rnn_type = cfg.RNN_TYPE if bidirectional: self.num_directions = 2 else: self.num_directions = 1 # number of features in the hidden state self.nhidden = nhidden // self.num_directions self.define_module() self.init_weights()
Example #5
Source File: model.py From AttnGAN with MIT License | 6 votes |
def __init__(self, ntoken, ninput=300, drop_prob=0.5, nhidden=128, nlayers=1, bidirectional=True): super(RNN_ENCODER, self).__init__() self.n_steps = cfg.TEXT.WORDS_NUM self.ntoken = ntoken # size of the dictionary self.ninput = ninput # size of each embedding vector self.drop_prob = drop_prob # probability of an element to be zeroed self.nlayers = nlayers # Number of recurrent layers self.bidirectional = bidirectional self.rnn_type = cfg.RNN_TYPE if bidirectional: self.num_directions = 2 else: self.num_directions = 1 # number of features in the hidden state self.nhidden = nhidden // self.num_directions self.define_module() self.init_weights()
Example #6
Source File: model.py From AttnGAN with MIT License | 6 votes |
def __init__(self, ntoken, ninput=300, drop_prob=0.5, nhidden=128, nlayers=1, bidirectional=True): super(RNN_ENCODER, self).__init__() self.n_steps = cfg.TEXT.WORDS_NUM self.rnn_type = cfg.RNN_TYPE self.ntoken = ntoken # size of the dictionary self.ninput = ninput # size of each embedding vector self.drop_prob = drop_prob # probability of an element to be zeroed self.nlayers = nlayers # Number of recurrent layers self.bidirectional = bidirectional if bidirectional: self.num_directions = 2 else: self.num_directions = 1 # number of features in the hidden state self.nhidden = nhidden // self.num_directions self.define_module() self.init_weights()