Giter Club home page Giter Club logo

maml_cp_vae's Introduction

MAML-CP-VAE

This repository contains Pytorch implementation of the paper ST2:Small-data Text Style Transfer via Multi-task Meta-Learning. Up to now only CP-VAE version is contained, CrossAlign and VAE versions will be updated soon.

Dependencies

  • torch==1.3.1
  • python > 3.6
  • tqdm
  • pandas
  • numpy
  • scipy

Usage

clone the repo and install required packages

git clone https://github.com/DRSY/MAML_CP_VAE.git
pip install -r requirements.txt

enter the code dir

cd code

generate corpus for building vocab

bash scripts/get_pretrain_text.sh

make dirs

bash scripts/make_dirs.sh

set the corpus(s1 or s2)

export corpus=s1
export s=1

start training and inference

python main.py --configpath ../config/s$s.json --corpus $corpus --maml-epochs 20 --transfer-epochs 0 --epochs-per-val 5 --maml-batch-size 8 --sub-batch-size --train-batch-size 16 --device-idx 0

fine-tuning for each sub-task

cd ../CP-VAE
bash fine_tune.sh
bash fine_tune_copy.sh

inference after task-specific fine-tuning

bash infer.sh

Note that this repo only serve as fast prototype implementation, more robust refactor will be done soon.

Acknowledgement

Underpinning code for cp-vae is adapted from CP-VAE.

maml_cp_vae's People

Contributors

drsy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.