GithubHelp home page GithubHelp logo

haitian2du / rl-afec Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chenke97/rl-afec

0.0 0.0 0.0 10.19 MB

RL-AFEC: Adaptive Forward Error Correction for Real-time Video Communication Based on Reinforcement Learning

License: MIT License

Python 100.00%

rl-afec's Introduction

RL-AFEC: Adaptive Forward Error Correction for Real-time Video Communication Based on Reinforcement Learning

This is a Tensorflow implementation of RL-AFEC.

Prerequisites

Python 3.6.8, Tensorflow v2.2.0 (CPU version)

Modules: Numpy, tqdm, absl-py

Checklist

  1. Specify num_agent, the number of worker threads collecting experience each run, using FLAG in train.py. For example, if your CPU has 12 cores, you can set num_agent to 11.
  2. Return values of the reward function in game.py for training and testing are different. Please change one line of code when you switch from training to testing and vice versa. Please see below for more details.

Training

To train an RL-AFEC agent, put the trace file (e.g., video_RL_train.txt) in data/, then specify the file name in config.py, i.e., trace_file = 'video_RL_train.txt'

In game.py, let function reward() return r:

def reward(self, tm_idx, actions):    
        ...
        return r
        #return vmaf, bw_waste, loss_pattern_after #for testing

then run

python3 train.py

Testing

To test the trained policy on a set of test traces, put the test trace file (e.g., video_RL_testing.txt) in data/, then specify the file name in config.py, i.e., test_trace_file = 'video_RL_testing.txt'

In game.py, let function reward() return vmaf, bw_waste, loss_pattern_after:

def reward(self, tm_idx, actions):    
        ...
        #return r
        return vmaf, bw_waste, loss_pattern_after #for testing

then run

python3 test.py

rl-afec's People

Contributors

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