about
projects
blog

Learnings Week of June3, 2024

I write this with neo vim so please exuse grammer and spelling. Jun 3, 2024 Today, I worked did a few Leetcode problems, including a hard graph problem called, Alien Dictionary. Then, I ran on the treadmill for 30 mins, took a shower, and when grocercy shopping. After lunch, I did a brief machine learning lesson on create a neuron in python. The lesson was super simple, but got me exploring some math consepts that I am clueless about, such as this equation ... y = 1 / 1 + e ^^ -x, which is called the sigmoid equation. Basic idea of a neural net is that there are inputs (numbers) that have weights (numbers), that feed into a neuron. Each input is multiplied by it's weight, and summed together with the other inputs. Then, there is an activation function that mutates the data, and gives an output. So, the example in this case was to take the sum of all of the inputs plus their weights, then plug them into the sigmoid function. From what I understand, the reason for using the sigmoid function is to obtain a number between 0 and 1, and use a non-linear function, to better accomidate complex.. something. Then, I practiced guitar, and now I'm writing this. I am thinking of implementing a cellular atometa algo right now.


Jun 4, 2024 I did several Leetcode problems in the DP category including house robber, number of steps, and number of possible palendrome substrings. Then I did an intro lesson on linear algebra involving, vector and matrix arithmetic, dot product, and matrix multiplication. The latter part was the trickiest to understand. I visualize it as thought the first matrix can be kicked over, so that the rows line up with each of the columns of the second matrix. Then like a butcher shaves slices of meat to make a sandwich, you basically feed in the first matrix to the second to get the dot product at each cell. Spent several hours trying to create Conway's Game of Life in JavaScript. After only being able to spin up the fan on my computer... I prompted my way to a working verion in a few minutes. The implementation, is not mind blowing, but it works well. It even accomdated me by connecting the model with the AudioContextAPI. I provided the pitches, but there is too much distortion. I feel that I need to reflect a little bit on this experience. We study math, when it is clearly easier to look up the answer. We care about our understanding. I was working on this project so that I could gain a better understanding of the model, and of how it could be implemented in javascript. ChatGPT made something that works, but it not cool. Maybe there is still a lot of room for cool with programming.


June 5, 2024 10:40am Started today with Leetcode DP problems. The stair one, and house robber to warm up (I feel like the house robber problem is getting more confusing the more times I do it..), then did a new one called Decode Ways, where I had to return the number of possible ways that a string of numbers could be interpreted. The numbers 1-26 represented the letters of the alphabet. My solution got through about half of the test cases, so I looked it up and found several very complicated solutions that will take me some time to be more fluent with. Did a half-ass walking workout, then I also read through the code that GPT generated for the Conway's Game of Life problem that I was working on yesterday. I found that my code was actually not that different. I have 3 big takaways from looking at the generated code. When GPT called the function to update the view, it was done using the html class reference for all of the cells, which made the operation O(n), rathern than how I was doing it by iterating through the entire matrix O(n ** 2) I believe. When updating the 'grid' which was the underlying state representation, full of 1s and 0s, an entirely new grid was constructed each time, then filled in according the rules of the game. I feel like I should have thought of this as well, since I worked on several CLI applications using the Bubbletea framework for Go, which follows a similar process in terms of always returning a copy, rather than updating the model, or in this case, the grid. Last night, I also started setting up my Go server for a music tutor project that I am likely going to make with Daniel-san. I'm basically going along with Alex Edward's "Let's Go Further" book on how to setup a JSON api. Now, I am going to continue learning about neural networks and how they can be applied to music. I will need to practice guitar today, because I have several friends that said they are coming to the the band play.


June 8, 2024 1:35am Well, I got very sucked into the project I mentioned above. I have mostly been focused on the Music Tutor app. At this point, I am able to store my textbook embeddings in a Postgres database, and query them. I decided to use a Docker Image with Postgres and the pgvector extension, so that I could avoid dealing with the database stuff on my machine directly. I will not say that it has been easy peasy.. definitly spent many hours trying to debug somthing embarassingly simple (wrong database dns) wondering "why can I query the embeddings in my application but not via the CLI 😬. BUT, maybe next time, it really will be easy peasy. Although I pushed aside all of the music and Leetcode stuff for the past few days, I think that it was a good thing. Go is the @*#$! I really enjoy writing code in Go. I just seems to hit that sweet spot between simple and easy to understand, and making me feel really cool because it just compiles super fast, and either works or it doesn't. Wisdom. Tech stack so far is Go, Postgres, and Langchain. Thinking about using NextJS for a static build of the front end, or possibly use htmx and Go templates to keep it simple. I am going to decide this part after coming up with a design, so that I have an idea for the level of interactivity that I might need.