toni-antonova / vae-text-generation Goto Github PK
View Code? Open in Web Editor NEWText Generation Using A Variational Autoencoder
Text Generation Using A Variational Autoencoder
Hi Toni
Thank you for sharing this, I am trying to reuse this repository to encode my sentences. On training the model the test set runs well but as soon as it gets to calculating the validation loss the process fails with a shape mismatch error. It complains generally in this direction -
ValueError: Cannot feed value of shape (75, 3000) for Tensor u'input_15:0', which has shape '(500, 3000)'
Where 3000 - is my max sentence len and 500 - is the batch size. However this number 75 is somehow generated dynamically and is different for different max-len and batch size values. Could you maybe give me a direction what might be going wrong here.
Thanks.
How can we build VAE or Auto-encoder using Transformer or pre-trained Transformer?
Thank you for the complete code, But would you please tell more about wikitokens.pickle and how to get it?
InvalidArgumentError Traceback (most recent call last)
in ()
epochs=epochs,
batch_size=batch_size,
validation_data=None)
# input: encoded sentence vector
# output: encoded sentence vector in dataset with highest cosine similarity
def find_similar_encoding(sent_vect):
all_cosine = []
for sent in sent_encoded:
result = 1 - spatial.distance.cosine(sent_vect, sent)
all_cosine.append(result)
data_array = np.array(all_cosine)
maximum = data_array.argsort()[-3:][::-1][1]
new_vec = sent_encoded[maximum]
return new_vec
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.