Eddie's Learning Record 17

1. Duration

Monday, September 19th, 2022 - Saturday, September 24th, 2022


2. Learning Record

2.1 Coding

I started to modify the code of the paper [1]. The major work I did was to change the name of each variable in order to make it understandable based on my understanding and the Google Python Style Guide. The longest variable name is reconstructed_current_clean_subject_videos_ground_truth_labels but it was much easier to recall what this variable is for.

It was worth mentioning that I was stuck in a problem for about two days. There is a line of code written like this:

video_list = [video for subject in subjects for videos in subject for video in videos]

However, it is not recommended to write several “for“ in one line. Consequently, I recorded it like this:

video_list = []
for subject in subjects:
  for videos in subject:
    video_list = [video for video in videos]

But actually, it was wrong! The correct code is like this below, there is only a tiny difference.

video_list = []
for subject in subjects:
  for videos in subject:
    for video in videos:
      video_list.append(video)


3. Feeling

3.1 Confused

As I was recoding, I realized my understanding of the paper and the code seemed to be slightly different from what the authors wanted to express.


4. Reference

[1]G.-B. Liong, J. See, and L.-K. Wong, “Shallow Optical Flow Three-Stream CNN for Macro- and Micro-Expression Spotting from Long Videos.” arXiv, 2021. doi: 10.48550/ARXIV.2106.06489.

Eddie's Learning Records logo
Subscribe to Eddie's Learning Records and never miss a post.
  • Loading comments...