Skip to content

Instantly share code, notes, and snippets.

View models.py
def text_encoding(vocab_len, original_text, nt, nz,cap_length, batch_size):
# initialization of pytorch functions
# Word embedding here
text_embedding = nn.Embedding(batch_size * cap_length + 1, nt).cuda()
# RNN layers
rnn = nn.LSTM(cap_length + 1, 256, batch_size).cuda()
# FC layer
@IcedDoggie
IcedDoggie / gist:c665c71814ce4801f354bba2f7af4cfd
Created Sep 10, 2016
function call as: string_recursive(array, "", statesInString), statesInString and the empty string are constant in this case. The expected output should alert a pop-up with 'Z'.
View gist:c665c71814ce4801f354bba2f7af4cfd
var powerSets = new Array();
powerSets.push("Z");
var statesInString = states.join('');
statesInString = statesInString.substring(0, numLines); //take the NFA string only
string_recursive(powerSets,"",statesInString);
alert(powerSets[0]);
// for(i = 0; i<powerSetNumber ; i++){
// alert(powerSets[i]);
// }