park-project / park

MIT License
218 stars 55 forks source link

fix video sizes #2

Closed godka closed 5 years ago

godka commented 5 years ago

@hongzimao The original Pensieve code uses EnvivoDash3 as the reference video, which contains 6 bitrates and 49 video chunks. However, in Park, the video size is mistakenly repeated 10 times, which leads to inaccurate video descriptions. To this end, I cut the video description file via the following code.

import numpy as np

test=np.load('./video_sizes.npy')
np.save('video_sizes.npy', test[:, :test.shape[1] // 10])
hongzimao commented 5 years ago

Thanks for checking our repo this early! We repeat it 10 times to create a longer video on purpose. The effect of input process variance is more evident when the MDP horizon is long (details in https://arxiv.org/pdf/1807.02264.pdf).

A better implementation for this simulated environment is to make the video length configurable (add a parameter in https://github.com/park-project/park/blob/master/park/param.py) and we can make the default length 49 so that it is authentic to the corresponding real environment. We will make this change shortly. But if you find this reasonable too, feel free to make the change and contribute to this pull request. Thank you!

godka commented 5 years ago

Yep, it makes sense. Expanding the time sequence of videos is really an intuitive and straightforward way to tackle the problem. However, as far as I'm concerned, training a good ABR policy needs multiple videos (the same conclusion can be found in your Pensieve paper.) but not leveraging only one video repeating again & again. Thus, is it possible to provide a video description pool, I mean, just like video trace pool? I have a video dataset with 86 videos, but they are encoded with another bitrate ladders.

BTW: is it possible to add RTT in the env?

https://github.com/park-project/park/blob/e23b2f6a2215abc1718e7d1159a33b5e7cb8c9a1/park/envs/abr_sim/abr.py#L160

godka commented 5 years ago

I've read your excellent paper "Variance Reduction for Reinforcement Learning in Input-Driven Environments". I agree with your opinion.

hongzimao commented 5 years ago

@godka Sorry for missing your reply. I think it will be super useful if we can add your 86 videos in the simulation. So every time when we reset the environment, we load a random video from these 86 videos at https://github.com/park-project/park/blob/master/park/envs/abr_sim/abr.py#L61 (need to move it to reset). We will also need to update https://github.com/park-project/park/blob/master/park/envs/abr_sim/videos/video_sizes.npy. Then the length of the video will naturally be different across different videos.

If you think what I described makes sense, could you add your 86 videos accordingly? Please also add a reference to where those 86 videos are from. We will review your pull request and merge. Thanks!