hugochan / KATE

Code & data accompanying the KDD 2017 paper "KATE: K-Competitive Autoencoder for Text"
BSD 3-Clause "New" or "Revised" License
142 stars 49 forks source link

VAE loss and classification accuracy #18

Open yuyingg0921 opened 5 years ago

yuyingg0921 commented 5 years ago

hi :) sorry to bother you again I tried train_vae.py to train a vae model without competition layer but got high loss (60-70). (and dimension is 128) earlystopping happened in about 20-50 epoch though I already tried a larger patience. The loss includes kld and reconstruction error but is this loss value in normal scale? and then I used pred_vae.py to predict 20news document embeddings. but after running run_classifier.py, I can only get about 22% classification accuracy.

Do you have any suggestion for improving the vae model!? thank you

hugochan commented 5 years ago

@yuyingg0921 You should be able to get reasonably good results using VAE. Can you share your hyper-parameters when training the model?

yuyingg0921 commented 5 years ago

yes. most parameters are default value. batch size =100 validation size = 1000 epoch = 100 dimensions = [128,128] , [512/512] I also tried with and without a competition layer.

train_vae.py: python train_vae.py -i output_20news/train.corpus -nd 128 128 -sm model_vae image with larger earlystopping patience: image

run_classifier.py: image image

Somayeh12 commented 5 years ago

Hi, I run your code with 20newsgroup, I get the earlystopping too. it stops at epoch 33/100 and the loss is 0.48. Any suggestion?

hugochan commented 5 years ago

@yuyingg0921 @Somayeh12 You might want to try running the code using the same TensorFlow version as mentioned in requirements.txt. See #24