Benjamin Johnson, 2022 Machine Learning Intern
Benjamin Johnson
Biography
SPS Chapter: University of Virginia
I grew up in Virginia Beach, Virginia and graduated from Princess Anne High School in 2019. I am currently entering my fourth year as a physics major at the University of Virginia with particular interest in cosmology and particle physics. In my free time, I enjoy reading, watching films, playing guitar and drums, and spending time with my friends.
Internship
Host: Potomac Research, LLC
Project
Abstract
Machine learning is a rapidly developing field of computer science with broad applications, including computational physics. This project focused on training methods for a type of machine learning system known as a reservoir computer (RC). The objective of this project was to expand the performance of an RC trained on a physical system with a specific set of equation parameters to predict the behavior accurately for different parameter values. We considered three methods of determining RC output weight matrices for the modeling of physical systems described by differential equations (in this case, the Van der Pol and Lorenz equations). The first method involved averaging the output weight matrices produced autonomously by the RC during the training period by implementing a Gaussian weighting function. For the second method, we instead passed the equation parameter into the RC directly and allowed it to analyze the effect of the parameter value on the system’s behavior. In the third method, we trained a feed-forward neural network to map directly from parameter values to output weight matrices for the RC.
Final Presentation
Internship Blog
Week 1: Broken Elevators and Reservoir Computing
My first week in Washington was filled with exploration and education. The first day I moved in, got settled, and checked out the area surrounding the dorm. The second was Memorial Day, and I met some of the other interns for the first time, then we headed down to the parade at the mall as a group. After seeing some of the monuments in the area, we settled into the shade under the trees by Constitution Avenue and watched the procession. Afterwards, we walked over to the White House, partook in a spontaneous rendition of Cha Cha Slide, got some dinner at Chipotle, and went home for the night.
The next day, the interns voyaged to the American Center for Physics and received an orientation from the heads of SPS. We built spaghetti towers and learned about the program expectations for the summer.
The following morning was my first day of work at Potomac Research. I headed out for the metro and immediately discovered the elevators in my dorm were out of service. Just my luck. Oh well, good thing I only live on the ninth floor. After descending the stairs, slightly sweatier and more winded than when I stepped out of my room, I took the blue line metro down to Alexandria. I met with one of my summer mentors, Andrew, and he gave me a bit of an orientation. Starting from the beginning, he pronounced an overview of reservoir computing (RC) and the hybrid scheme they were working on implementing. Knowing very little about the topic besides what I garnered from the papers he had sent me previously, this initial meeting was immensely helpful towards obtaining my bearings for the summer. After the orientation, I met my other two mentors, Daniel and Colin, and we journeyed to a nearby restaurant for lunch. I got to know the Potomac Research crew a bit better and enjoyed some fish’n’chips that were simply bussin. Following lunch, we headed back to work and Daniel helped me install software on my laptop that I would need for coding during my internship. This ended up being a massive pain because every step came with complications, but by around 5, I had some example code running and went home for the day.
On my second day of work, I began analyzing the Python module that Potomac Research had developed for reservoir computing, which they lovingly named respy. It’s fairly complicated, but I got a basic understanding of how it functioned, then Andrew gave me my first real task. He asked me to implement a Runge-Kutta integration method for predicting the behavior of a set of differential equations useful in chemistry. The Roberston equations, as they are named, are described as “stiff” because they require a small step size when integrating in order to produce accurate results. It took me most of the day, but I was able to get my program working for the Robertson system. Afterwards, I also implemented my program for a second system of stiff equations, the chaotic Lorenz system, which are utilized for modeling heat convection in a fluid (they’re useful for topics like weather prediction). Having dusted off the cobwebs from the part of my brain responsible for coding in Python, I was feeling a bit more confident about my position this summer.
The third day at work, I expanded my code to implement a third differential equation, the Van der Pol equation, then met with my mentors again to solidify the goals of my main project for the summer. After some discussion, they decided that my primary summer task would be a form of experiment. I would begin by calculating the power spectral series (PSD) for the Lorenz system using the code I had already developed. The PSD provides an analysis of frequencies present in the signal, much like a Fourier transform. The decision to produce this measurement was somewhat arbitrary, but it functions as a good example of some non-trivial analysis that would be more useful in practice than simply predicting the behavior of the Lorenz equations (they’re inherently chaotic, so forecasting a specific trajectory is not particularly interesting). The experiment deals with the training of the reservoir computer, a form of machine learning that the Potomac Research crew is currently investigating as a cheaper and less computationally intensive alternative to prediction using massive supercomputers. The goal is to determine which training technique will provide the best results in producing the PSD for the Lorenz system without needing to fully model the equations using the Runge-Kutta method. The Lorenz system is rather easy to model, so the reservoir computing method wouldn’t necessarily be ideal to predict its behavior, but the knowledge we gain implementing the simple case can be helpful for future endeavors. The training techniques we’re considering involve three options: the first is relying entirely on the RC to determine its own parameters for success, the second is developing another simpler machine learning technique, called a feed-forward neural network, to select the ideal RC parameters, and the third is training the RC on various Lorenz parameters as inputs, then using a weighted average of these results to predict the RC parameters which produce the most accurate PSD. After the meeting, I began working on PSD analysis for my Runge-Kutta code, then headed home for the weekend.
Throughout the week, I also had a great deal of fun with the other SPS interns. We explored the area and hung out in the dorms, baking, playing games, and watching movies. I’m very excited for the rest of the internship because it seems like I’ll learn a great deal about machine learning in addition to developing some fast friendships.
So long, until next week!
Week 2: Baseball Games, Nobel Laureates, and the Rocky Horror Picture Show
Once again, the past week has been extremely eventful. Between work and extracurriculars, the only activity I’ve missed out on is sleep. No complaints, though, I wouldn’t have it any other way.
Throughout the week, I’ve been developing my understanding of machine learning and the various ways to train a Reservoir Computer (RC) to obtain desired outputs. Rather than starting with a power spectral series of the Lorenz system as I detailed last week, I began with a simpler case: the Van der Pol equation. Possessing only one parameter called mu, this second order non-linear differential equation is much easier to model than the three coupled Lorenz equations.
I first implemented the equation as a Python function that could be passed into the RC for modeling. Next, I focused on training the RC over a set of sample mu values, then attempted to manually predict the equation for a new mu value by averaging the output matrices produced by the RC over the training sample. The output matrices convert the state of the RC to output data (a representation of the trajectory of the system), so they’re very important in the function of the algorithm. Initially, I applied a simple averaging function for proof of concept, and it appeared to work adequately, albeit somewhat inaccurately.
To improve the predictive capacity of this technique, I then implemented a Gaussian distribution to serve as a radial basis function for the averaging process. The Gaussian has the shape of a normal distribution, and the output matrices of the RC’s were factored into the average proportionally to the equation. This means that output matrices computed at mu values closer to the prediction mu value were weighted much more highly than output matrices corresponding to more distant mu values. Including this selection into the averaging greatly improved the accuracy of predictions, but it still could not compete with the purely automated function of the RC with no modification (simply allowing the RC to compute its own output matrices). We may decide that there is more work to be done or that this training technique is not entirely viable.
Outside of work, I had a great time with the other interns. On Thursday, we traveled to the American Center of Physics where we had lunch with Nobel laureate John Mather. We asked him a great deal of questions, picking his brain for physics opinions and advice. I had never met a Nobel laureate previously, so this was a fascinating experience.
On Friday, SPS took us to a Nationals baseball game, which they won heftily (guess we’re their good luck charm). Although I don’t watch much (or any) baseball, it was a blast, so many thanks to SPS for the field trip. We then attended a midnight showing of the Rocky Horror Picture Show, which was every bit as fun as I had anticipated. I had watched the movie a few times before, but never attended a live show with a shadow cast, so it was a radically different experience. A couple of gentlemen in the row in front of us were clearly veterans, and they had jokes for just about every line in the film. I could hardly pay attention to the movie over the burning in my sides from laughing, and I’m definitely looking forward to going again.
On Saturday, a few interns and I attended the March for Our Lives event at the Washington Monument, then journeyed to the Pride Parade at Dupont Circle. Afterwards, we checked out a nearby block party celebrating Pride Month, then trekked to the Lincoln Memorial to watch a fireworks show over the treetops to the southeast.
Once again, I had an immense time this week, and I’m looking forward to the adventures to come.
Be back soon.
Week 3: Neural Networks and Punk Rock
This week, I continued my experiment on the various methods we can implement to train a Reservoir Computer (RC). On Monday, I moved on from the first training technique (output matrix averaging) to the second technique: passing the mu value from the Van der Pol system directly into the RC as an additional dimension. Previously, we had modeled the one-dimensional system (only in x) using two dimensions, with x describing the position of the oscillator and y serving as the derivative of x with respect to time. With this second training method, we now added mu as a constant third dimension. After spending a great deal of time tweaking the RC parameters, I was able to find an algorithm through which the RC analyzes the mu values passed in during the training period and predicts systematic behavior for a new mu value which it had not previously seen. I have yet to compare the first two training techniques directly, but once the third and final method is operational, I’ll run experimental analysis on all three to determine the benefits and disadvantages of each.
After the second algorithm was functional, I moved onto the third. This method is slightly more complicated because it involves employing a different form of machine learning to train the RC. The idea is to use a simpler framework, called a feed-forward neural network, to determine the output weight matrices that will allow the RC to predict the system accurately. At this point, I have a fair amount of code written, but have been unsuccessful thus far in effectively training the RC to model the equations. I will pick back up troubleshooting tomorrow to work out the kinks and find an efficacious implementation.
Outside of work, I had another very busy week. Emma’s and Div’s birthdays were Monday and Tuesday respectively (happy birthday, y’all!), so we spent some time celebrating with them. On Wednesday, I drove down to Norfolk, Virginia to see one of my favorite bands play at the Norva. The band I saw is called PUP and they’re easily one of the best punk rock bands of recent years. Definitely worth a listen if you like pop punk, so check them out! The openers were Oceanator and Angel Du$t, neither of which I was familiar with, but they killed it as well. I’m going to have to listen to a few of their albums now.
On Saturday, the folks at AIP were kind enough to take the interns to a symphony at the University of Maryland, which we all thoroughly enjoyed. I hadn’t attended a symphony since I was in elementary school, so I was thrilled for the opportunity. I love classical music, and they put on a fantastic show.
That’s all for this week, so see you next blog post!
-Squirt
(P.S. Don’t ask, Janessa made me do it.)
Week 4: Beware the IDE’s of June
This week started off with a phenomenal bit of fun when the IDE I’ve been using to develop my code, Spyder, decided to stop working. Gotta love Mondays. After uninstalling and reinstalling both Spyder and Anaconda twice, I was able to get it fixed. I then began working on an implementation of the Keras deep learning module from Tensorflow to train the Reservoir Computer I’ve been studying.
On Tuesday, all the same IDE issues reappeared spontaneously, and it took me most of the day to get them fixed again. You would think solving it Monday would help me fix it on Tuesday, but you would be wrong. It took even longer to get it working the second time around. Luckily, I haven’t had any issues since.
I spent the remainder of the week attempting to get the Keras implementation working as desired, but it has proven to be more difficult than the previous reservoir training strategies. Because of the deep learning nature of Keras, it’s difficult to discern where exactly the issues are arising and how to approach solving them. Hopefully I’ll be able to achieve the intended performance characteristics this coming week.
Outside of work, I had a great time yet again. I went bowling with a group of the interns on Monday and had a blast, despite getting absolutely destroyed by Saksham. The highlight of the week was seeing Bill Nye in person at the Astronomy on the Mall event this Saturday. I always loved watching his educational videos growing up, so it was awesome to see him in person. It was also extremely rewarding working at the event as an educator myself, showing off the cloud in a bottle demo and helping Emma readjust the telescope when kids decided they wanted to free-hand it. (Shouts out to Janessa for organizing the event, well done!) In addition, my parents visited to attend the event, and we went to the Smithsonian Museum of American History nearby. It was an interesting and informative experience, and I’m glad I got to see their exhibits.
Until next Sunday!
Week 5: Brute Loops
Throughout this week, I continued my attempt to implement a reservoir computer training protocol involving a feed-forward neural network called Keras. This process has proven to be a substantial challenge. Although my IDE continued working this week without problems (hallelujah), I have been unable to accurately model the Van der Pol system with the Keras training strategy. Since all the work performed by Keras is happening behind the scenes, it’s difficult to discern what exactly is causing the drop in precision.
While the modeling is still not ideal, I am happy to report that I’ve gotten much closer than last week. The reservoir computer produces the correct periodic shape expected for the function and generally has the same amplitude. The main discrepancy lies in the wavelength and phase of the predicted signal. One major pitfall which likely augments the lack of synchronicity is the required level of precision in the output weight matrices. We are passing the mu parameters from the Van der Pol equation into the Keras deep learning routine and asking it to produce the output weight matrices for the reservoir computer (the matrices responsible for transforming the reservoir states into output data). At this point, the mean-squared-error between the correct matrix and the one produced by Keras falls on the order of 10^-6 over 500 values. This seems extremely close to the correct matrix, and in some sense indeed it is, but it’s not close enough to produce accurate predictions.
I made improvements this week by finding optimal dimensions and settings for the Keras network, often by running massive brute force loops which cycled through various settings and identified the ones which produced the lowest error (hence the title of this blog post). I also developed a unique normalization algorithm that scaled the signals based on their mu value and seemed to reduce error. In the next week, I’ll continue making adjustments to the code which I hope will result in the desired accuracy.
Outside of work, I once again enjoyed spending time with the other interns and exploring the city. On Wednesday, I went on a beautiful kayaking trip down the Potomac with Emma and Janessa. The event was hosted by Potomac Conservancy, an organization dedicated to cleaning the river running through DC, and the kayak rental fees went to their cause. On Thursday, I played Dungeons and Dragons with the other interns, so thanks to Taylor for DMing. On Friday, we walked down to Georgetown for an evening happy hour, and on Saturday we attended some Independence Day celebrations in the Dupont Circle area. I’m really looking forward to seeing some fireworks tomorrow on the Fourth of July, so don’t disappoint me DC. We’re in the nation’s capital, so you better have a serious show in the works.
Signing off til next week!
Week 6: An Explosive Holiday
Once again, I had a terrific bit of fun this week. The highlight of the week was definitely the firework show at the mall for Independence Day. We first went down to Constitution Ave to watch the parade, then grabbed a bit of lunch at Duke’s Grocery, and finally made our way to the Washington Monument to find a spot on the lawn. We enjoyed one of the best firework shows I’ve ever seen, a true feat of pyrotechnics.
On Tuesday, Brad Conrad came down to Alexandria with Janessa to meet my mentors and I for lunch. We went to a nearby restaurant and savored a delicious meal before returning to work. Thanks to Brad for treating us! That night, I played another round of Dungeons and Dragons with the other interns, so thanks to Taylor for DMing again.
On Wednesday, we planned to go kayaking on the Potomac again, but the weather was unfortunately too sketchy, so we’ll have to put that off until next week. On Thursday, I went to a movie theater with a few other interns to see the new Thor movie. It was very funny like the previous Thor film, and I’m glad Taika Waititi was tapped to direct again.
On Friday, we returned Quigley’s for happy hour, as is becoming our weekly ritual, then returned to the dorms for some games. On Saturday, my parents came to visit, and they took me to a showing of To Kill a Mockingbird at the Kennedy Center. It was a beautiful performance of a powerful play, and I would highly recommend attending if you get the chance.
At work, I continued attempting to implement the feed-forward training technique for modeling the Van der Pol system, but to no real avail. My mentors decided that this technique may not be fruitful, so we’ve sidelined it for now. They instructed me to move on to developing the output weight matrix averaging for a different system of equations, the Lorenz system.
This algorithm is very similar to the averaging technique for the Van der Pol system, which I documented in more detail in previous blog posts, so for elaboration you can read my earlier posts. Since they’re so similar, it was relatively quick and easy to get the code working for the Lorenz system. As of now, the program can model the Lorenz system fairly accurately for set sigma and beta parameter values while the rho parameter is varied. Ultimately, the goal will be to model the system while varying all three parameters. I’m not sure exactly what the next step will be in the coming week, but I believe I will either be testing the code’s efficacy in its current state or expanding the code to work for a variety of all three parameters.
Signing off til next week!
Week 7: Road Trips and Power Spectral Densities
During this week, I continued improving our reservoir computer training algorithm for the Lorenz system. I carried on using the output weight matrix averaging technique to model the Lorenz equations based on a set of initial conditions and parameters, then producing a Power Spectral Density (PSD) for the solutions. The PSD functions like a Fourier transformation to extract the frequencies present in the signal.
So far, the method has been fairly accurate at predicting the frequencies for the given parameters using the Gaussian averaging method for the output weight matrices. When compared to an explicitly calculated solution produced by the Runge-Kutta integration technique, the PSD is very similar. In the following week, I’ll continue working on this training method for the reservoir computer and testing its potentials for performance.
On Monday, my parents came and met me in Alexandria after work, and we got dinner at a seafood restaurant in the area. We then went for a lovely walk along the Potomac. On Tuesday, they took me to an Italian restaurant in Georgetown. It was fun until the walk home when I got absolutely drenched in a thunderstorm. After that, I dried off and played another round of D&D with the other interns.
On Wednesday, we went kayaking on the Potomac again, but this time more of the interns got to come along. The weather was fantastic, and it was just as enjoyable as last time. On Thursday, I went up to ACP for a lunch with the SPS fundraising team and got to savor a delicious meal and fun times with the other interns. On Friday, we attended the Jazz in the Garden event hosted at the sculpture garden by the National Mall. The performance was exceptional, and we appreciated listening from the shade under the trees. I would highly recommend attending if you enjoy jazz.
On Saturday, I travelled down to Charlottesville to visit my roommate and some other friends from school. It was wonderful seeing everyone that I’ve been missing all summer, and I’m sad I already had to leave. However, I’ve been having just as much fun in DC with the other interns, so I’m sure they’ll cheer me up soon.
Until next week!
Week 8: Changes
This week at work we switched gears on our reservoir computing (RC) project. We decided to focus on a hybrid RC format and are trying to implement it for the Van der Pol and Lorenz equations. The hybrid format involves adding a more direct calculation to the machine learning algorithm by providing it with Euler method approximations of the equations as it iterates through time. The goal is to increase the prediction accuracy of the RC while avoiding using diminutive step sizes as would be necessary using a pure Euler method model.
I’ve also begun working on my final presentation for my project this summer. I’ll have to present in just a couple of weeks, so I need to figure out exactly what will be included in my presentation and practice explaining it.
Outside of work, this week was extremely eventful. On Monday, the interns got together for a potluck-style taco night. On Wednesday, I went with Lucy and Emma to the French embassy to watch a theater production. The play was in French, but luckily they had English subtitles so I could follow along. The facility is beautiful so I would definitely recommend checking it out.
On Thursday, the NIST interns treated us to a tour of their workplace. We met many research scientists and got to hear all about their fascinating work. The highlight for me was visiting their anechoic chamber, a room designed to be so quiet that it can reach zero decibels. I had never seen anything like that outside of videos, so I was thrilled to check it out.
On Friday, Brad Conrad came down to GW to give the interns a talk about potential career paths in physics, and we found it very helpful. Afterwards, we went to Quigley’s for happy hour with Brad and a few GW employees.
On Saturday, some of the interns travelled to Sandy Point State Park in Maryland to visit the beach. The location is gorgeous, and the beach is lovely, so I would definitely recommend a trip that way if you’re in the area. I’m from Virginia Beach, so I don’t give my approval out lightly.
Until next week!
Week 9: Winding Down
This week at work I continued my efforts from last week to implement a hybrid reservoir computing scheme. I added a function which passes Euler integration steps into the reservoir in addition to the previous states and input signal when the system is in feedback mode. This serves as an additional guide to keep the reservoir on track. At this point, the process works sometimes, but is rather temperamental. It appears to depend largely on specific hyperparameters for the reservoir computer, and so it does not function consistently yet.
Outside of work, I spent most of the week taking it easy and resting up for the final week here. I watched a few movies and read a couple of Dostoevsky novels. The best movie I saw was Jordan Peele’s Nope which just released last week. It’s every bit as original and enthralling as his previous films, so I would definitely recommend seeing it on the big screen. I’ll also give an honorable mention to Everything Everywhere All at Once which was similarly unique and enjoyable. It takes a whimsical approach to the multiverse and mixes in a healthy dose of nihilism and intergenerational conflict.
On Tuesday, the interns gathered again for another D&D session and are getting ready to end our campaign. On Saturday, we investigated an underground speakeasy in Georgetown. I’ve never been to a bar like that, so it was awesome to check out.
I’m beginning to get sentimental reflecting on my time here. As much as I’m excited to see my friends back at school, I’m dreading losing the friends I made here even more. The summer simply flew by, and I wish I had another to spend with them.
Until next week!
Week 10: Til Next Time
This week, my work at Potomac Research was mostly completed, so I focused more on finalizing my presentation. I practiced presenting a few times for my mentors, and once they gave me the green light, I was ready to go for Friday. They took me out to lunch at a German restaurant in Alexandria on Wednesday, and after that I thanked them for everything and said farewell for the last time.
Outside of work, the last week of the internship was bittersweet. I’m very grateful for the friends and experiences I found in DC this summer, and I’m excited to see my crew back at school, but it’s difficult to reflect on the past few months without the sting of melancholy, knowing that I’ll hardly see the other interns again.
Our last Saturday we spent exploring Georgetown, and I finally got to see the stairs from The Exorcist. Although I had intended to check them out all summer, ironically, I only passed them by happenstance.
On Sunday, we journeyed to the Smithsonian National Gallery of Art and got to see lots of interesting exhibits. Unfortunately, we managed to miss Van Gogh and Monet, but I suppose there’s always next time. The museum is extensive, and I could spend days there, so it’s no surprise we didn’t cover everything in a few hours. That night, we gathered for a final potluck (partially to hang out, and partially to use up all the food we had left).
On Monday, we played a final round of D&D. Taylor did a great job DMing and left us on a cliffhanger, so maybe we’ll play more online when we get a chance. We went to the Lincoln Memorial and camped out on the grass behind it to watch the sunset over the Potomac, so it was a rather picturesque setting for the game (I lost the game ;).
On Wednesday, some of the interns gathered for crepes. I only had weird food left, so I may or may not have made some strange crepe concoctions, but I have no regrets.
On Thursday, we went to ACP for our practice presentations to prepare for Friday. Everyone killed it, so I was certain Friday would be a success. After we returned to the dorms, we shared some food again to try to use it up and began packing like crazy.
On Friday, we all returned to ACP for the final symposium. It was thrilling to hear about the work my fellow interns completed this summer, and I’m proud of them all (although I admit some of the more technical presentations flew straight over my head). Great job, everyone! Afterwards, we went to Quigley’s for one more Friday happy hour before we had to pack everything up for good. Brad joined us to say goodbye, and we had a blast. Returning from Quigley’s, I finished packing, loaded my car, and drove back home to Virginia Beach. I didn’t get there until after 1 am, and my mom wanted us to leave for Maine at 4 am, so needless to say I didn’t get much (or any) sleep.
I’m currently typing this from my aunt’s house in Portland, Maine, and relishing in the sub-90-degree weather. Not looking forward to returning to Charlottesville in a week to begin classes in the sweltering Virginia sun, but at least I’ll get to see my friends (and the apartment complex next door has a pool I can sneak into).
Well, this is it, so to my mentors at Potomac Research and the SPS staff: thank you so much for your support and guidance this summer! I had a phenomenal time at this internship, and I hope future interns enjoy it as much as I did. To my fellow interns: so long friends! Thank you for spending your valuable time with me these past few months; it meant the world to me. It’s agonizingly strange to transition instantaneously from seeing you every day to virtually never, but I’ll cherish the memories we formed together for the rest of my life. Although vast distances may stand between us, I’ll always hold you close in my heart. Please reach out if you ever want to catch up or if you’re passing through Virginia. See you all at PhysCon!
Til next time . . .