GithubHelp home page GithubHelp logo

sandy4321 / vae-anomaly-detector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jguymont/vae-anomaly-detector

0.0 0.0 0.0 211.75 MB

Experiments on unsupervised anomaly detection using variational autoencoder. The variational autoencoder is implemented in Pytorch.

License: MIT License

Python 100.00%

vae-anomaly-detector's Introduction

VAE Anomaly Detector

Code accompanying this project.

Installation

In order to use the system, you will need to install the following dependencies:

  • Pytorch
  • Numpy

To install, build the source code from the repository by running the following command in your terminal:

git clone https://github.com/JGuymont/vae-anomaly-detector.git
cd vae-anomaly-detector
python -m venv venv
venv\Scripts\activate
python -m pip install --upgrade pip

Install Pytorch (see website for GPU supported installation):

pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

Install other requirements:

pip install -r requirements.txt

SMS Spam Collection Dataset

You can download the dataset on Kaggle. The SMS Spam Collection is a set of SMS tagged messages that have been collected for SMS Spam research. It contains one set of SMS messages in English of 5,574 messages, tagged acording being ham (legitimate) or spam. The file spam.csv contain one message per line. Each line is composed by two columns: v1 contains the label (ham or spam) and v2 contains the raw text.

To reproduce the experiment without changing the configuration, you should save the file spam.csv in the data/ directory.

Splitting the data

Start by splitting the data into a training set and a test set.

python split_data.py --train_size 0.5

Running this command in the terminal will create train.csv and a test.csv and save them in the directory data/. Note that you only need to run this command omce.

Training

Train the model by running the flollowing command

python main.py --model boc

vae-anomaly-detector's People

Contributors

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