Skip to content
/ KerBS Public

Codes for <Kernelized Bayesian Softmax for Text Generation> in NeurIPS 2019

Notifications You must be signed in to change notification settings

NingMiao/KerBS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kernelized Bayesian Softmax for Text Generation (KerBS)

KerBS is a powerful substitute for Softmax. Please refer to our paper or poster for details.

Requirements

  • python

    • ==3.4
  • python packages

    • TensorFlow == 1.4.0 (Other versions are not tested.)
    • numpy
    • pickle
    • horovod (Running without horovod needs some slight modifications.)

Running

  • To replace Softmax with KerBS, change the output layer to KerBS_top.kerbs_top, for example,

    logits = KerBS_top.kerbs_top(top_features=h, bayes_component=3, top_dimension=10000, dtype=tf.float32)
  • To dynamically allocate senses, add HvdReallocateHook.

  • To customize reallocation strategies, change get_new_sense_allocate in reallocate.py

About

Codes for <Kernelized Bayesian Softmax for Text Generation> in NeurIPS 2019

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages