Giter Site home page Giter Site logo

neuralfeatureextractor's Introduction

NeuralFeatureExtractor

NeuralFeatureExtractor (NFE) enables feature extraction from trained PyTorch model

Supported models & datasets

current version supports following models:

Details can be found below

Supported file types

  • csv

To support new file type, simply write a class that inherits FileHandler

How to extract features for new dataset using a new model

Step 1: Link PyTorch model

In order to add a new model, copy and paste your model to model folder and modify the forward function to return the intermediate representation

The new model must be added to __init__.py as well.

Then, the trained model must be stored under pretrained_model folder

Step 2: Link DataLoader

Next, copy and paste your DataLoader to data_loader folder

Step 3: Generate config files

NFE requires two configurations

  • model_config : configuration for the Model
  • data_config : configuration for the DataLoader

Samples can be found from config folder

Step 4: Extract features

The following command generates features and stored them at generated/<model name>

python main.py --model_config <model_config> --data_config <data_config>

Supported feature extraction

target classes: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] feature size : 196

python main.py --model_config config/mnist/model_config.json --data_config config/mnist/data_config.json

Relevant packages can be installted by running pip install -r per_model_requirements/kws_res_model.txt

The dataset must be downloaded prior to feature extraction. Please refer to official Google Speech Command dataset page

target classes: ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"] feature size : 196

python main.py --model_config config/kws/model_config.json --data_config config/kws/data_config.json

Use the same CNN example for MNIST by loading FERG images with grey scale and reduce dimensions to [1, 28, 28]

target classes:

  • anger: 0
  • disgust: 1
  • fear: 2
  • joy: 3
  • neutral: 4
  • sadness: 5
  • surprise: 6

feature size : 196

python main.py --model_config config/ferg/model_config.json --data_config config/ferg/data_config.json

neuralfeatureextractor's People

Contributors

ljj7975 avatar

Watchers

James Cloos 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.