GithubHelp home page GithubHelp logo

glensjh / adversarial_training Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wangjiuniu/adversarial_training

0.0 0.0 0.0 18 KB

Pytorch implementation of the methods proposed in **Adversarial Training Methods for Semi-Supervised Text Classification** on IMDB dataset

Python 100.00%

adversarial_training's Introduction

Adversarial Training

Pytorch implementation of Adversarial Training Methods for Semi-Supervised Text Classification (sentiment analysis on IMDB dataset, only adversarial training done).

Based on

  1. Paper Adversarial training methods for semi-supervised text classification, ICLR 2017, Miyato T., Dai A., Goodfellow I. Only adversarial training has been implemented.
  2. Github repository Adversarial Training Methods. This is another implementation using tensorflow.

Requirements

This repository has been tested under python 3.6 and Pytorch 0.4.1 with GPU.

Usage

  1. Download preprocessed IMDB dataset for this repository (you can also find the URL in imdb/google_drive.txt). And then uncompressing these files into directory imdb. Of course, you can try to generate these files under the guidance of Adversarial Training Methods.
  2. Run the main function in at_pytorch/run.py:
$ cd ./at_pytorch
$ python3 run.py

Results

The running result can be seen in file at_pytorch/standard_result.txt, and brief description is as following:

Method Seq. Length Epochs Accuracy
baseline 400 10 0.854
adversarial 400 10 0.871

We have not got the results reported by the original paper, but our result shows the effectiveness of adversarial training.

adversarial_training's People

Contributors

wangjiuniu 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.