Git Product home page Git Product logo

trojai_rl's Introduction

Build Status codecov

alt-text-1 alt-text-2

Overview

This is the top-level TrojAI module. It contains two submodules: datagen and modelgen. datagen contains the necessary API functions to quickly generate synthetic data that could be used for training machine learning models. The modelgen module contains the necessary API functions to quickly generate DNN models from the generated data.

Getting Started

Check out our documentation here: https://trojai.readthedocs.io, and our arXiv article here: https://arxiv.org/abs/2003.07233

Repository Organization

trojai
|   setup.py - Script to install trojai module into Python environment
|   requirements.txt - A list of Python dependencies for pip
│   developers - information for developers
│   scripts
    └───datagen - integration scripts showcasing datagen API functionality
    └───modelgen - integration scripts showcasing modelgen API functionality
└───trojai - top level Python module
    └───datagen - data generation submodule
    └───modelgen - model generation submodule
    └───test - top level scripts directory
        └───datagen - contains unittests for the datagen submodule
        └───modelgen - contains unittests for the modelgen submodule

Acknowledgements

This research is based upon work supported in part by the Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA). The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of ODNI, IARPA, or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright annotation therein.

trojai_rl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

trojai_rl's Issues

puzzle about the result

when I use this command as below to run wrapped_boxing.py, It always stopped at about 33% of 50000000 frames.
Is it normal?

$ nohup python -u wrapped_boxing.py --save_loc "../results/" --model_save_name BoxingFC512Model1ForIpynb.pt --num_clean_test 30 --num_triggered_test 30 --gpu > BoxingFC512Model1ForIpynb.log 2>&1 &

image

Issues with running notebooks/boxing_example.ipynb

There are a few issues with running notebooks/boxing_example.ipynb

  1. trojai_rl has an older gym version (0.15.3) requirement, but it appears one needs gym[accept-rom-license]==0.21.0 to get the Atari ROMs. Consequently, the numpy requirement also needs to be updated.
  2. trojai_rl.datagen.envs.wrapped_boxing_public should be trojai_rl.datagen.envs.wrapped_boxing and trojai_rl.modelgen.architectures.atari_architectures_public is perhaps trojai_rl.modelgen.architectures.atari_architectures
  3. Running train_boxing_model() produces the following error: TypeError: only integer scalar arrays can be converted to a scalar index
    The problem seems to be in torch_ac_optimizer.py. The code below produces a torch array when using argmax
    if argmax_action: action = torch.argmax(dist.probs) # get 'best' decision else: action = dist.sample()
    Using action = action.numpy()[0] before passing it to the step function appears to fix the issue, since the step function is expecting a scalar.

With these changes, we get qualitatively similar results on the new model trained by the notebook and the pretrained ones.

Screen Shot 2021-11-09 at 3 07 37 PM

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.