# Year 2020 Resolution Log

The high level goals and expectations for the year 2020.
created: modified: status: in-progress reading time: 20 mins

# Preamble

A New Year’s resolution is a common western tradition where, at the start of the new calendar year, a commitment to lasting change is established. These resolutions typically include changing an undesired behaviour (quitting smoking), accomplishing a personal goal (going to the gym consistently), or otherwise improving their life (become less offended by others).

By documenting my resolutions, I intend to have an accountable record to refer to when I review the events of the year 2020. The resolutions that are proposed minimize dependence on external factors, and therefore remain primarily within my realm of control.

## Master’s Degree

By the end of 2020, I aim to have a significant portion of my master’s degree thesis completed. I will adhere to the thesis preparation, requirements, and deadlines set by the University of Alberta Faculty of Graduate Studies and Research.

If possible, my final oral examination (thesis defense) will have been scheduled/completed.

## At Least One App

By the end of the year, at least one high quality mobile application will be available to download from the popular mobile application distribution platforms (Google Play Store, Apple App Store).

## Commitment to Health and Wellness

Throughout the year, I aim to commit to the following lifestyle changes:

1. Continue on the Fast-5 daily intermittent fasting schedule. Currently, I have successfully fasted since December 22nd, 2019 with an eating window between 2pm and 7pm.

2. Maintain morning fitness routine with Bonnie. I aim to complete at least one ten minute FitnessBlender exercise per day, at least five days a week. Two days of arbitrary flex time per week are provided.

3. Sustain current bouldering (rock climbing) activity at the University. The Wilson Climbing Centre is free for students and walking distance from my lab. While completing my MSc. thesis, I will attend the climbing wall two times per week, if available.

# Rubric

Resolution Unsatisfactory Satisfactory Good Excellent
Master’s Degree Thesis largely incomplete. Significant effort required (>3 months) for written dissertation. Thesis requires major revision. Between 1-3 months of effort is necessary for dissertation pass and oral examination. Thesis requires minor revision. Less than one month of effort is necessary for degree completion. Thesis complete. Defense scheduled or completed. Convocation scheduled.
Mobile App No mobile application is published on any distribution platform. One application is published onto the major distribution platforms. No other criteria satisfied. One or more applications have been published. Applications have generally positive user feedback, and reviews. More than one application has been published. Applications have positive user feedback, reviews, and monetary income.
Health & Wellness Over 90 inexcusable skips or absences to the Fast-5, FitnessBlender, and Climbing Centre activities. Between 60 and 90 inexcusable combined skips or absences. Between 30 and 60 inexcusable combined skips or absences . Less than 30 inexcusable skips or absences.

## Health and Wellness Penalty Calculation

Scores are calculated every Sunday. Skipping one full week of fasting, fitness blender, and climbing would incur a penalty of:

$$7_\text{Fast} + 5_\text{Fitness} + 2_\text{Climb} = 14_\text{Penalty Points}$$

Although inexcusable absences itself is subjective, the intention is to distinguish days where I did not perform a health and wellness activity due to laziness.

# Resolution Log

I will update this post every week until the end of 2020.

## January

January 2020 penalty summary:
$$\text{Fast} = 1 + 1 \text{; Fitness} = 0 \text{; Climb} = 2$$

It is eye opening how long recovery from a cold takes.

### Week 1: Wed, Jan 1 - Sun, Jan 5

Fast-5 accomplished each day, climbed on Thursday, Jan 2nd. Skipped one day of Fitness Blender on Sunday Jan 5. Most difficult part of this journey is the fast, especially when in social situations where other people are eating.

### Week 2: Mon, Jan 6 - Sun, Jan 12

Skipped two days of Fitness Blender. Fast-5 failed on Sunday due to dinner with girlfriend’s family I ate outside of the eating window, roughly ~830pm dinner finished. Climbed on Monday and on Friday. Weighed self, roughly 69kg (152lb).

### Week 3: Mon, Jan 13 - Sun, Jan 19

I’ve been run down with a terrible cold this week. What had begun on Friday, January 17th as an unusually pervasive sore throat had turned into a weekend of progressively becoming weaker. A full blown hallucinogenic nightmare of chills, cold sweats, and phlegm occurred by Monday. That being said, given the time period specified in the header, I was able to climb twice, I never broke the fast, and I skipped two days of Fitness Blender (within my 5 days per week criteria).

### Week 4: Mon, Jan 20 - Sun, Jan 26

Most of this week was spent in cold/sickness recovery. Tuesday, I had a meeting at the CN tower to discuss the ECG research. Friday, the only day I went to the lab, I was able to reverse engineer the ECG traces from a SQL database dump. I broke my fasting window Friday the 24th due to Chinese New Year evening dinners at my grandmother’s. Also no wall climbing was done this week due to illness.

### Week 5: Mon, Jan 27 - Sun, Feb 2

I did not adhere to my fast on Saturday February 1st. I also did not climb at all this week with no valid excuse other than laziness and poor time management. I performed fitness blender activities at least five times this week.

## February

### Week 6: Mon, Feb 3 - Sun, Feb 9

I had a moment of weakness this Saturday morning and indulged in two hotdogs during a grocery run to Costco. Additionally, this Sunday was my Grandmother’s birthday dinner. I continued eating until well after the 7pm window close. I missed three days of Fitness blender. I climbed twice this week.

### Week 7: Mon, Feb 10 - Sun, Feb 16

Many lapses in the fasting window occurred this week. Friday, Valentines Day Dinner; Saturday, Post V-Day Dinner Hot Pot with friends, Sunday, Dinner with Bonnie’s family. I was able to climb twice this week and I performed Fitness Blender every day.

Speaking to a friend about my fasting window and the strictness which I apply my rubric, I was offered a suggestion to begin recording deviation of time from the window, rather than just marking failure cases. One behavior I see is if I break the window, I no longer have incentive to continue the fast for the remainder of the day. By having more fine grained logging of my eating habits, it may provide more insight into the effectiveness of the fast.

### Week 8: Mon, Feb 17 - Sun, Feb 23

The climbing wall is closed from Feb 15 to Feb 26 due to Adaptability wall construction. I did not track my eating windows this week, but noted three days in which I had not followed my fasting window schedule of 2-7pm. I fitness blended daily, with the exception of Thursday.

### Week 9: Mon, Feb 24 - Sun, Mar 1

Climbed twice this week. Performed daily fitness blender exercises. Maintained consistent fasting window, eating only between 2-7pm.

Starting to allow myself to be less strict about fasting as results are very apparent (target weight achieved, have abs again). Social eating (late dinners in particular) are very problematic for the fasting window. Most of times my breakfast meal is delayed until 3pm to compensate. May stop tracking fasting schedule and just delay meals as habit? Problematic for year-long rubric/schedule.

## March

### Week 10: Mon, Mar 2 - Sun, Mar 8

Ate past 7pm on Sunday, March 8th. Otherwise nominal.

### Week 11: Mon, Mar 9 - Sun, Mar 15

Deferred to Week 12

### Week 12: Mon, Mar 16 - Sun, Mar 22

Last two weeks have been quite a blur. The COVID-19 pandemic seemed to arrive quite suddenly. On Week 11, I had climbed on the Monday, but was too worried to go climb since.

I had a difficult Friday, Mar 20th. My trusted Dell XPS 13 laptop popped a capacitor and I no longer had a ready to go research laptop. The next day, after taking the day to self reflect and reprioritize I recalled the importance of being mindful, of having stillness and being focused.

At the beginning of the year, I wrote down a rubric outlining grading criteria with respect to my Master’s Degree, the Climbing/Fasting/Health and wellness, and the Mobile app. I began to feel very discouraged and very nit-picky about tracking my dietary fasting windows and climbing. However, I remain satisfied with the long term habits that I have developed with respective to my eating and with exercise. Every morning, with tolerance of 1 day per week, I do fitness blender morning exercises with my girlfriend. I also remain mindful most days that I do not eat until well into the afternoon. Admittedly, it is not always between 2-7pm, I have limited my evening snacking and pushed my breakfast meal out considerably past my previous limits. I believe that this is the right step for longevity, and the original rigour for keeping to the strict 2-7pm window is no longer appropriate.

I would like to try lists again. I have begun using a task/list application to track necessary todo items. I will try to check off as many of them as I can. Every week, rather than a passive recap of eating windows, I would like to self-reflect on how the lists approach is working. One thing that was surprising to me was how quickly I was able to get my Linux setup up and running again, and how approachable it was when using the list as a guideline. I will work on how best to phrase the todo items mindfully.

As for the rubric, I am no longer very serious about it, but I intend to reflect back and estimate on good faith how I fared. The metrics for MSc. Thesis and the mobile app are still very applicable, as a deliverable is generated (whereas fitness & health is more a routine)

### Week 13: Mon, Mar 23 - Sun, Mar 29

I’ve found that keeping a todo list that I can check off has been very useful in keeping me accountable for my work. Keeping each task roughly equal to 1 hour’s worth of work appears to be the secret. If the task takes more than an hour to complete, it should be broken down further. Occasionally, I allow myself to write down tasks that I accomplished but have not recorded ahead of time just to have the satisfaction of marking it off of the list.

As a result of the todo task list, I’ve made progress in the ECG classification problem posed by the Physionet 2020 challenge organizers. I will submit my new model this week, as well as update the research log in the wiki.

In terms of eating, I am satisfied with my current schedule, which has naturally shifted from a ‘Fast-5’ to a ‘Lean-8’, where my allowed eating time starts around 11am and ends around 7pm. I have not been keeping track of it diligently.

### Week 14: Mon, Mar 30 - Sun, Apr 5

This week has been less productive than I would have liked. I experimented with not taking my morning daily ADHD medication just to see the impact on my day to day activities. I found that I was less able prioritize and focus on my tasks. It was difficult for me to plan detailed, itemized tasks for the next days. I felt like I had greater difficulty in getting out of bed, that I was sleeping in considerably more, and it was more difficult for me to get into the flow of productive work.

That being said, I was still able to make progress in the ECG research. I submitted one successful attempt at the PhysioNet challenge using the newer feature extraction methods. Will update again next week.

## April

### Week 15: Mon, Apr 6 - Sun, Apr 12

Perhaps the most important thing to getting things done is not a framework, like lists, spreadsheets, tracking software, but rather the people that you surround yourself with that push and motivate you to become a better individual. I’ve seem to hit a little bit of a plateau, using the todo lists to dictate my daily tasks. It has become difficult to adequately plan the next day’s activities, other than setting a general “Do 1 hour of research”, and then actually accomplishing 4 hours. One of the challenges with specific, deliverable based tasks is it is hard to know what needs doing before the discovery of what the problem is. Most of research is simply churn, hyperparameter tuning, and waiting.

On an aside, I’ve shaven my head bald. I figured that since COVID-19 related restrictions are not going to ease up within the next week, I would take hair matters into my own hands and clip all of it off. It was beginning to get difficult to manage. I am amazed at how people with long hair don’t drive themselves crazy with the itching and shedding.

My daily fitness blender habits and lean-8 meal times are still going strong. The lean-8 is easier to enforce than the fitness blender, but for that I am grateful to have a motivating partner who starts the exercise each morning.

### Week 16: Mon, Apr 13 - Sun, Apr 19

This list/todo approach to task completion has been underutilized this week. Instead, three solid days were dedicated towards ECG classification research with promising results and figures. Lots of additional experimentation was done given new label-wise plots of F1-scores.

One blocker: my MacBookPro battery has begun to swell. Before, where my four laptop feet once rested against the table, now the bottom of the laptop bulges out. I’ve ordered a new battery, but Amazon’s reduced capacity means that it would arrive in early May (est. May 12th). So much of my productivity depends on reliable access to technology. Having these laptop issues is a major source of recent anxiety.

### Week 17: Mon, Apr 20 - Sun, Apr 26

I really enjoy having the todo-list as a fallback, even if I don’t use it with careful intention. When there are long running tasks (that recur weekly, for instance) it imposes a much needed sense of routine and order that I find missing in my life, especially since the ‘norm’ of post self-isolation has not fully settled in yet. I am thankful that I have kombucha that I need to make every two weeks. I am grateful that I have structured finances and some assets that I need to manage each Monday. I appreciate that the PhysioNet 2020 CinC abstract deadline is Friday, May 1st.

As an aside, this week I’ve rediscovered Factorio- which has consumed far too much of my life. I need to show a little bit more restraint when playing that game, perhaps setting more strict timers (limiting myself to 2 hours per day at most, pending the task list). Additionally, I found myself stuck in this mental loop.

To choose to do nothing is also a choice, which means you cannot truly do nothing

I will complete the abstract, send it off for revision, and work on the opt web application this week.

### Week 18: Mon, Apr 27 - Sun, May 3

Despite making progress in the ECG classification research problem, I’ve come to realize a few disappointing facets of my research journey. I am hitting this wall now of seeing marginal improvements with my classification model, despite adding in various new manual feature extraction techniques. I am using traditional signal feature extraction approaches and appear to be hitting a bottleneck of sorts- my supervisor and my PhD colleague have different opinions on the usefulness of hyperparameter search. My supervisor believes it to be a promising next step, while the PhD colleague insists that we are missing some silver bullet of feature extraction/signal representation that will improve performance. Myself- I see value in both, and it is a toss-up, I do think that setting up some AutoML/hyperparameter tuning experiment using random/genetic search would yield more long-term potential.

This Sunday (May 4th), I’ve hit a bit of a mental and emotional pain point. I watched the DeepMind documentary on AlphaGo, the reinforcement learning program that defeated the top Go player in the world 4 games to 1. I was once again reminded that the start of my research journey was not fueled by maximizing an score on some classification challenge, but to explore the fundamental inner workings of deep neural networks and how a self-learning agent can be used to improve itself over time. Although I think it is too late for me to switch my research gears again, I feel as if I need to make some more space for this learning- that it is inexcusable for me not to pursue this given the time and space gifted to me from the COVID-19 pandemic.

I have made small improvements to opt, namely adding in some stubs for live view user authentication and Create/Read/Update/Delete. One blocker is that Gigalixir’s free plan, which I graciously use to deploy a prototype version of my application, does not support postgresql citext extension for case insensitive text datatypes.

This week, I aim to have an AutoML experiment running for ECG hyperparameter selection per classification label. I also aim to add in the Topological Data Analysis Arrhythmia Detection features, even though I am not using deep neural networks in my approach. I strongly want to resume my Reinforcement Learning (RL) journey by continuing where I left off in the Coursera lectures.

## May

### Week 19: Mon, May 4 - Sun, May 10

I’ve setup all the necessary feature extraction and parameter passing meta to enable a full AutoML experiment using microsoft/nni. Unfortunately, despite searching for three full days (3 days of non-stop experiment running), the hyperparameter search seems to give only a minor improvement to what I already had prior to the search. The only thing that’s concrete is that XGBoost’s dart booster seems to give better results than gbtree. Other tree parameters, like max_depth, learning_rate, and gamma, still vary a lot with no statistically significant findings. The amount of effort required to port over prior work’s feature extraction instructions was non-negligible and consumed the majority of my productive time this week.

I watched a few lecture videos of RL but did not finish a week’s worth of material like I had originally anticipated. I also did not work on my Phoenix framework web application. The tasks list has been kept to a minor flow of maintenance tasks.

Because the official phase of the Physionet classification challenge begins this week, I will be continue working on improvements for ECG feature extraction and classification.

### Week 20: Mon, May 11 - Sun, May 17

I have moved away from XGBoost classification of ECG records back to deep learning approaches using PyTorch and PyTorch Lightning. Otherwise this week has been fairly uneventful in terms of research. I’ve setup a workflow for streaming my desktop environment to various streaming services through Open Broadcaster Software (OBS), in addition to recompiling nginx on my home server to support RTMP video.

This week, I will review the updated dataset released by the Physionet Challenge organizers, as the last week’s submission had an error in the data files. Additionally, I will continue with the classification/transformers architecture implementation.

### Week 21: Mon, May 18 - Sun, May 24

I have setup a working multi-label classification PyTorch lightning experiment such that the thresholds are searched for optimizing over the F-measure. The loss is Binary Cross Entropy with Logits. Forward pass during evaluation calculates probabilities using the Sigmoid function. Treating the multi-label classification problem as a set of binary classifiers was very unstable, either resulting in all negative classes, or frozen to outputting a single value despite changing inputs. This is not resolved by weighting the loss function according to the imbalanced dataset.

I am still investigating the use of the transformer model architecture for deep learning. Potential new research direction? Lead classification of signal into 12-lead ecg categories? Forcasting other lead signals given a subset of the 12 leads in ECG?

I played way too much Factorio this week.

### Week 22: Mon May 25 - Sun, May 31

I updated my ECG classification experiments to support an arbitrary number of labels, due to the new task of mapping to ~76 SNOMEDCT codes. A lot of churn, due to the changing challenge requirements, meant that some assumptions I made about the machine learning experimental setup are no longer valid. I am rerunning the experiments with a larger number of parameters- the intuition is perhaps the transformers and recurrent neural networks are not learning the distribution of the data due to not enough parameters (the SimpleCNN model has over 650k parameters, now the LSTM>Transformer has roughly 250k).

Additional rework of the caching logic needed to occur due to out of memory issues. I spent too much time trying to initialize a Kubernetes cluster. Most of my issues were due to the CRI-O runtime not playing nicely with default settings.

## June

### Week 23: Mon, Jun 1 - Sun, Jun 7

None of my ECG classification experiments have good results using the transformer architecture, despite lots of hyperparameter search. I gave a Edmonton Python Meetup talk on hyperparameter search frameworks on Monday, Jun 8th. We received notification that our abstract was accepted into CinC 2020, and now I need to figure out a way to incorporate the traditional machine learning approaches with the transformer architectures (that are not working anyways).

Feeling particularly anxious and frustrated about the research lack of progress and abstract not matching current methodology dilemma.

### Week 24: Mon, Jun 8 - Sun, Jun 14

I began writing up the four page conference paper, not using the deep learning approaches, but instead using gradient boosting tree ensembles on manually engineered features inspired by signal processing and natural language processing domains. Additionally, rather than constructing figures for the paper using a image editing program (such as Inkscape), I opted to try out PlantUML and found their state diagrams more than adequate for my needs. For generating the PDF from the tex files, latexmk, a package recommended to me by Eddie, replaced my old setup of Tectonic and texlive.

The Physionet challenge organizers released over 40,000 records that require analysis. I will do a quick summarization of the data before proceeding with my classification methods (replicating old traditional ML approaches, then continuing to explore the transformer architectures).

### Week 25: Mon, Jun 15 - Sun, Jun 21

I’ve been having some experimental setup issues, now that the number of files within the dataset files have increased. These issues include RuntimeError: received 0 items of ancdata, which are referenced briefly in closed PyTorch issues. I took a break from resolving this issue, but I suspect it will be resolved after increasing the number of file descriptors. My MBP appears to still have the issue with the sporadic shutdown and restarts, despite the new battery and the multiple NVRAM/SRAM resets. I purchased for myself a new Lenovo Yoga C740, which will arrive in the mail by the 26th.

### Week 26: Mon, Jun 22 - Sun, Jun 28

In terms of number of weeks, we are half way through the year. I’ve spent a lot of time setting up a new Lenovo C740 laptop, and running to various issues. As an aside, in the blog post I mentioned that the display brightness hotkeys do not work, but they have started working (unsure what update fixed this). I have updated my ECG outlier detection approach to be more robust to bad data, utilizing median filtering prior to bandpass filtering to reduce harmonic noise from large peaks.

## July

### Week 27: Mon, Jun 29 - Sun, Jul 5

I discovered a Python library for neurophysiological signal processing called NeuroKit2. There was a minor issue that I caught, and I submitted a pull request that was successfully merged into their development branch. It appears to be a promising feature extractor, taking roughly 1 second per record to extract a variety of heart rate variability metrics. The default signal cleaning function is superior to my raw bandpass filtering and median filtering approaches.

I will finish up writing my ensemble classifier, using these new extracted features.

### Week 28: Mon, Jul 6 - Sun, Jul 12

I made a few code quality pull requests to the NeuroKit2 library this week, notably refactoring all of the printed warnings to using the builting warnings module. Additionally, I have a set of classifiers trained (100 experiments), with corresponding plots and feature importances for the team to review. I will write up a bunch of tests to ensure scoring function quality, as well as write some sample re-weighting logic to make use of the non-zero weights across the different labels. Then, I will calculate the overall challenge scores using both approaches (raw labels, including label probabilities). I still need to integrate tsfresh features into the 12-lead ECG record in a sane manner.