Arnene, Recurrent Neural Network from scratch [DRAFT]
In the following weeks, I'll be self-studying how to create a RNN. The repository can be found here.
TODO Continue study the logic behind a RNN.
TODO Code it.
These are things in my head, don't take them too seriously. Bear in mind that, actually, I have no idea what I am saying.
In the following weeks, I'll be self-studying how to create a RNN. The repository can be found here.
TODO Continue study the logic behind a RNN.
TODO Code it.
I stumpled upon with this: An Architectural Decision (AD) is a software design choice that addresses a functional or non-functional requirement that is architecturally significant... sold! you got my attention. I'm the kind of person who is always blaming me from the past. WTF you were thinking, man!Seriously!? I have a Notion account. I have my calendar full of activity cards of the day but I find it odd to have there. This, ADR, should be in the repository.
Since I'm learning Rust I thought it was a good idea to create a cargo command to create an ADR. I looked in crates.io and there was none. YEIIIII!
So, I created it. It's working. I marked it as done in my todo list. Felt good.
I recently found MuOxi, a MUD game engine written in Rust. It reminds of my days of MUDs in the lately '90s and early '00s. I spent a few nights with strangers around the global having epic text-based adventures. Good times.
Maybe it was nostalgy but I decided to contribute to the project. It's open source and I noticed they are not using docker for at least development. They are using Redis and Postgres. So, I thought it could be a good start if I dockerize I stopped using docker months ago. I stumbled upon a project that got into my nerve. It took eons to start. Puff! It was actually easy to work as per usual. the engine. So I did it. It's a working progress. I'm almost finished, though.
While working on the PR, I noticed the engine was failing. The connection with Redis was failing apparently. I checked Redis was up and running. It was. I checked and double-checked it again, nothing. Something told me I was doing something wrong, hmmmm. Usually it's something simple and stupid. I knew I would have a Duh! moment.
In the meantime, I wanted to test the connection with redis. I knew it was running and the open port was 6379. I didn't want to install a redis client in my environment and I didn't want to test it from the inside because it'd be useless.
So, I found a one liner out in the jungle and I loved it.
Once I was sure it was running and open. I was 110% sure I was doing something stupid. I checked the
docker-compose.override.yml. The network was defined. The server was defined. Then
docker-compose.yml. And that was the Duh! moment: both services, Postgres and Redis, were defined but the network was not.
I added it to both services, stop the containers and run it again.
BOOM! it was working.
That title is most likely an oversimplification but we tend to do that because it makes things easier. Layers over layers. Sometimes I wonder if the organization of reality actually determines the organization of neurons. If so, would reorganization of neurons change our perspective of reality? Wouldn't then new knowledge change our perspective? I'm tripping again... . In Unix-like operating systems, what it says is, everything is represented by a file.
Take for example the above. I'm running
top as an example. You can see that the PID is 577. This process running right now
Isn't that fascinating? The future is unknown. The past is gone. The present doesn't exist.
. We can see some details at
/proc/PID/. For now, let's do the status.
Even though it's a process running you can see its file representation. You can do even more i.e.
/proc/PID/fd/1 and see
stdout among other things.
All that makes me thing about Category Theory but I think it has become an unhealthy obssesion.
Recently, I needed to add a new tiny authorization feature to the controllers of a Laravel application I never understood the PHP bashing but hey I'm not a software engineering so I'll my mouth shut. . And since I was adding new stuff, the rule was: whatever I touch, if it's awful, refactor it first. I follow rules until I break them. In this case, the rule was a good rule.
So I dived in. and I found something like as follows:
The function was ~40 lines in total. There were a couple refactors I did but for the purpose of this post, I'm focusing on Service Object Pattern.
The programmer who coded this was apparently a junior which it made sense since the code I saw Well... I'm sure about that but complaining right now I find it unfair since he can't defend himself. Moving on. . He decided to create a Trait and move the logic of createOrderAsSale in it. The controller was working just fine so my job was to add my authorization feature.
I'm not an Laravel expert so I spent a few days learning the Laravel ways. The first thing I did was to change the function parameter to:
Laravel recommends to add a form request for complex validations. This, however, was a complex validation but I decided to add the form request anyway since it has the authorize function in itself by default.
After I added the form request, it was quite simple to integrate the authorization feature. I added it and now I have to add controller tests (there were none at that moment).
The authorization feature had unit tests already in place. I just needed to add test for the controller store action since there was no controller test and I just added new lines of code (remember the rule). I knew the controller was doing already too much but I didn't think refactor a priority right now since I needed to deliver this authorization future. I changed my mind though once I tried to add unit tests for the controller store action.
The controller should get a request and delegate whatever needs to be done to other classes/services. This wasn't the case. Not only it was not the case but there was a trait and as far as I can tell we should add a Trait if we find ourselves repeating a lot of functionality across many classes or to encapsulate useful functionality that we can add to our classes on an as-needed basis. Also, Traits suppose to be use inside a class.
So, I thought of the current code base. I have a controller that gets a request and do stuff either on its own or through a trait that is used only by this controller. The trait basically takes information as add that information to a new record. After that, it returns the initialized that later the controller save on the database. Hmmm
No, I told to myself. The trait makes no sense. It's not reusable. It does not do what it says it does namelich it does not create an order as a sale. This needs to be updated, I decided.
First, I got rid of the Trait and I chose a service object pattern. The class will have only one public function called call. The function will be static. The name of the class will be CreateOrder and it can be used as follows:
That change made immediately easy to unit test the controller store action. I just needed to test the store action, mock the class CreateOrder, test for bad and good order creations and done. I can then add a unit test for the class CreateOrder later.
I like very much the Service Object Pattern because the convention follows, I think, name the class by telling what it does.
And we lowered the entropy bit...
Since I was a child I have always have these depressions moments. I dunno why or how they happen. I tried to journal about it at some point to recognize patterns but nothing came through. I remember my parents wanted me to go to the psychologist but I refused. I didn't want to know I was crazy or fucked up up there.
You can imagine a quite moody teenager. I dunno how I didn't end up being an emo or goth. I think since I tried to rationalize it somehow I overcome it. I still have those moments. And I think that's also the reason why I ended up being a pessimist philosopher kind of guy.
Last year, I decided to get my DNA tested I don't recommend it, though. There is a lot of shit in there that I needed to cope with. And at least for me, it was a hard process. I'm still on denial of a few things. . After a few weeks I got my raw data and I started using it in websites that provides you more information based on markers and what-not. Before that, I already knew that coffee helps to keep depression aside. I don't drink too much coffee, though. I prefer earl grey tea (black tea) which also have caffeine.
So, It turns out I have a gene called CYP1A2 which translates into Likely to be a fast metabolizer of caffeine. I'm also have other genes like ABCG2, BDNF, MLXIPL, EFCAB5, CYP1A1, GKCR, AHR1, and AHR which basically means tendency to consume moderate amount of coffee. I guess my will is stronger since I don't drink that much caffeine.
I remember El Poderoso He used to be called like that because legend has it he met El Diablo, a man with no face and no human feet. El Diablo bowed before him, my grandpa, hence the nickname. , my grandpa from my 'amá's side, used to drink a lot of coffee. I guess I got that from him.
I'm one of those that complains about how terrible the interview process, at least in the IT context, is. I have had quite a few interviews. I have seen many diff stylists. They have left me with a taste of disatisfaction. The sad thing is I dunno how to fix it. I guess it's one of those art that's have to master.
Now, a few days ago I have what I considered The Interview of my life Before I wrote this, I tried to look for a word that expresses my feeling but I'm bad at expressing feelings so I'm sure it's easier to find the origin of the Universe than the word. .
I'm also the kind of people who complain about other peope saying it's just business as in they want to separate human emotion from the equation. Every time I hear that, I can't stop thinking they are just as bad as dealing with emotion than everybody else. So, it's easier to disassociate yourself.
What was so great about that interview? We talk about my failures and vulnerabilities. No ego. No superiority complex. No fear to be exposed. They were so open and understandable. I felt so fill-with-a-word. I really don't know how to to call it. it was an amazing hour.
I knew however I wasn't the right fit. There are most likely far better people than me... by millions. But I wanted to try, you know? In the end, I think I won.
It's a shame, I believe, more companies don't interview like that.
For people like it's hard to find the right music to get into it called as you wish: zone, flow, nirvana, the place to be, etc. I find myself in the world I can be for many hours. . I have finally finished creating my master piece. This natürlich only works for my particular brain.
But hey, it's music, maybe you enjoy it too as for what it is: patterns all the way down...
I like Rust lang very much. I started using it a couple of years ago to create a crate. And I'm pretty sure the code is the worst in the Rust community. I mean, I was learning after all. What do I regret, though, is not the bad code, that happens. I regret that I just did the crate but I didn't continue using Rust at all after that.
So, a few weeks ago I decided to continue with my Rust learning.
I started Bouncer.
The logic of the library is pretty simple: any request you make to a third-party service will be controlled by Bouncer. Bouncer will deal with delay/throttle the requests as needed. It uses Redis as backend.
The code so far is pretty straight forward:
The good thing about this project is that I've been mentored by Jane, shout out to her!
It's a working in progress, natürlich. Leider, I recently decided to cut out one of my incomes, a freelance gig. It was bound to happen, I just wasn't happy with the gig anymore. It was a interesting adventure which the deserve is own post It will be sort of a rant. I saw the signs from the beginning but the money was good (altought other friend coders said it was one third of what I should be charging). But money doesn't buy happinness... right? . Anyway, I've been working on demos for companies but a day only have 24 hrs and even though I like coding... my biology hits hard when I don't sleep enough.
The whole idea of having best practices and design patterns is to avoid chaos Did you know the opposite of Chaos is Cosmos? sigh . A Builder, as the word says, it builds thing or things. In Bouncer context I moved from this
The most obvious thing is that it's quite readable. In both cases, you will need to read Bouncer API. The differences is that in the first version, you will need to remember every time the position of the params (and params' name) when passing them along to the function. In the second version, you will need to remember the names of the params, the order of how you call them is not relevant. It saves effort.
In physics and mathematics, you want to write less Remember, every thing seems to follow the path of least action. . So you create equations and those equations are compacted into a less wordy equations and so on and so forth.
Something similar, I believe, happens in computer science. You want to create code that humans can read but at the same time you want code that does not make invest more effort than necessary.
One thing that I find fascinating (that somehow is connected to this is post) is Life seems to be all about low entropy. And... at least when I try code in my head I have this principle: try to make the code less chaotic (high entropy) because I know that future me will hate myself (not to mention that probably other coders will want to kill me).
More about Builder pattern here.
In almost every project I end up using at some point the Service Object pattern. I like
because of the convention of naming the class with what the PORO
Don't you love acronyms? I certainly do. To me, it's the similar abstraction like verbing nouns i.e. instead of go to the internet and use the search engine Google to find it. The word Internet is another one. This is fun.
CreateRefund.call. You know by reading the class name what's happening in same or what should be happening inside.
However, I don't follow all the rules. For example, I don't create a class but rather a module. Instead of doing the following:
I will use modules only:
Notice that I try not to use the name of the pattern in the class name.
The reason is because the pattern name will be visible in the backtrace. When it comes to your IDE, the class will be inside
app/services. The redundancy is not needed there.
Now, why do I use module instead of a class? To be honest, my answer has not evidence to back it up. In fact, that's the reason of this post, to find out how my beliefs are wrong or perhaps right, I dunno. My reason to choose a module instead of a class was because I didn't want to initialize more objects (less object creation). I have never done the benchmarks. I only know that modules are not initialized. is it, though?
First, some benchmarks in with two dummy functions:
Huh! Ok, there is a difference. I'm more curious though in the amount of instantiated objects.
The stats for the class approach are:
and the stats for the module approach are:
ooooook! there was a difference in objects creation after all. My concern started because I realized of the following:
So, Module and Class have the same class. What does the superclass method do? Returns the superclass of class, or nil. Although, the superclass method is only in Class not in Module. And that's how this mystery appeared in the first place.
I like games. I like them very much. I recently had a tattoo made in my right forearm to illustrate my love and admiration for Horizon: Zero Down specially for Aloy. If I were a woman, I would be Aloy hence a tattoo of her in my arm.
I also love games like Shenzhen I/O and Factorio which leads me to automatization. I'm not sure we want to automate everything anymore I found this in Jess's blog. I'm sure she wasn't advocating to automate everything but it got me thinking. .
We gain more time but my question is for what. Man könnte argumentieren for whatever you want which sounds like a great answer and one could imagine all things we would wanted to be done but I don't think that's the case.
Why do you think new years resolutions are hard?
Why do you think people need religion?
Why do you think gringos are afraid of robots or bad hombres taking their jobs?
I think the answer to all those questions comes from the same root: .
They literally are made of meat but this is thinking meat. And the part that does this thinking is a pattern recognization machine. To work, it needs input. It has sensors of all kinds. But if you deprive those sensors from input, it goes haywire.
It is not that simple since there are many layers but the underlying mechanics is like that. Finding meaning or the act of finding meaning is in itself a pattern. From A to B. If there is no A nor B, then what to do?
The ape-descended being start asking questions... remember this is a thinking meat. But this thinking meat most likely has no answers. And this is not good. It's not good because the thinking meat cannot go back to not thinking unless it's a thinking meat monk or something.
So, back to automatization. People need to struggle. Then what to automate? What we need to leave untouched? Keine Ahnung. But my bet is it will happening the same as we are currently living: a society where religion is disappearing and humans are losing ground and most humans need a ground or they will go haywire.
I like Dr. Strangelove. I find it to be a great satire not only of cold war but humans themselves I mean, think about it. We have three major problems in the past: energy (food, water), reproduction, and not be be eaten. Now, for non-poor people, you have all of them covered and somehow you are still miseable. I think the trade-off was not justifiable. And if you go deeper, it might be the main reason of this overpopulation. Talk about denial of death, am I right, people? .
That's the reason for the title + it fits perfectly. So, Los geht's.
In Nov 2019 I learned that I went to therapy when I was a child for like 3 years. I don't recall any of that but 'Amá chose to share that piece of information before I moved to Germany. Apparently, I have short burst of rage and lots of energy. I remember in kindergarden to be quite active and get bored easily... a lot.
In my teenage phase, I attributed all my issues to being a teenager. I was very sensitive to people's comments about me. I got overwhelmed by crowds regardless of relationship I had with them. I prefer to be alone more importantly, to be alone on the roof watching the stars. I kept me calm. Computer games helped a lot but school was in the way, I only had interests in patterns (math). For the rest of the classes I was a bad student.
Then the time to go to university arrived. I was a still shy and lonely person but I made friends. These dudes where somehow like me. I studied physics. From time to time, there were parties but I couldn't stay longer, I got weirded out. It was me of course but I dunno why I assumed that would faded it away.
Somehow, can't recall how, I learned to deal with my emotions and my sensitiveness. I learned to control my levels of energy. And I noticed that I liked coding, a lot. I learned that I can spend hours in front of the computer just coding away... hours. So, I became a coder, programmer, a dude who whispers to computers.
Until Aug 2020, I gave me a present: a DND test for ancestry, diet and mental disorders. I did it out of curiosity. I already knew there was sefardic descendency. What I didn't know was that I also have ashkenazi descendency. There is also Filipino, Manchurian, Coptic Egyptian, Senegambian and Angolan. Being mexican is truly a mezcolanza I wonder if that's what makes of the Cosmic Race. is there such thing as race? .
What got my attention was the mental disorder part The diet part too. Apparently for my genetics it's better to follow the Nordic Diet. I guess I was meant to move close to the North pole jiggles. . The analizes says I have a lot of markers for ADHD, some for OCD and some other for Autism I forgot to mention before but I also have a constant sort of depression. I battle that by working a lot and find ways to distract myself which it's hard since I get bored easily. . I did know those mental disorders but I wasn't aware of all the details of each one of them.
Let's start with OCD. It makes sense. Sometimes I have burst of making things in order, symmetrical and beautiful aesthetic to the point that people get annoyed by me, I'm sorry. Autism. I might. I doubt it, though. The only thing I can think of it's when people say that I'm rude in some conversations. What they mean is I say things as they are instead of sugarcode them. But the ADHD... this one makes quite a lot of sense. It brought me peace to many of my personal issues. It brought me resolution. It wasn't easy, thought. I was in denial for days. I wanted to be normal even though I knew I was fucked up.
After a few days I made peace with myself. I realized that it might not be so bad. I also realized this might be why I like coding. Coding is hyperfocus to me. Coding is heaven. Coding is my happy place just like that roof and the stars. It can be a superpower, I just need to learn how to harness it.
So I stopped worrying.
Just like history is written by the winners, I think the whole achievements thing is also the same thing. We hear about this and that and how great. But rarely we hear about the failures. We hear about failures when it comes to shame someone or to feel superior How you noticed there are people waiting to be offended or to jump into crazy conclusions just to denigrate someone? Jeez... .
That made me think that we are not teaching how to own your mistakes and failures. It took many years to finally start talking about them openly like it was nothing. It's weird, don't you think? After all, we learn by failing In fact, my bet is that we can only learning by failing or rather things are only things in comparison to something else. So, winning is one side of the coin and there can only be a coin with two sides hence failing. To things to be computable, to compute, there's gotta be more than two. .
Imagine doing that in job interviews? I did, just a couple of times. And as you probably expected, it wasn't a good thing. I mean, it wasn't seen as a good thing by the interviewer. I was totally fine with it.
In these turbulent times, I can't help to feel deceived.
It's nobody's fault. I don't think that anyone has deceived humanity with bad intentions.
Here I am listening to Kate Bush's Cloudbusting... and It makes me feel... It reminds me to that moment when I learnt that adults are fallible. How fragile humanity is I happen to believe the ultimate greatest lie of this human civilization is... Progress. .
This is the moment when I wish there were gods and goddesses. Aliens, if you will. Someone who could save us from our childish behavior and premature use of technology.
And yet I just know that something good is gonna happen.
Tomorrow it's my 37 Sun cycle which it's only special to me and probably my mom I don't recall having a birthday party. 'Amá tried to compensate that by giving me birthday parties lawter. It didn't work. I felt super awkward and overwhelmed. Although that might be because of something else in my head. .
Like any other human being or sentient being, I broke some many bubbles so far. So many illusions we have created as a civilization. A civilization being one of them. Gosh. So many lies.
However, I think that in a reality without meaning, you have the power and responsibility (if you want to be sane) to create your own meaningful way of living.
In my case, it sums to the following GIF I made.
Like any developer, I have done a lot of interviews. The interviews are a bit diff, I think, since I have no computer science degree. I'm a physicist by training. Some people may think that probably means I'm smart. I am not.
One of the things I learned as a child was that I'm not smart. I'm not wise. I'm not intelligent. There is nothing special about me and there are far more better people than me in any area. I forced myself to live with that. It's hard since family and friends say otherwise but that, I believe, does not help me at all.
At my age, I've learned to live with that. It's sort of sad since I know I'll be behind. I'll be left behind. It's hard to accept that but I'm ok with the logic of how Nature/Reality seems to work.
I recently had to decline to continue with a process with a company because its process involved challenges like the ones you have at Facebook, Amazon, Google, Microsoft, you name it. They also wanted to know how much time it took me to solve the problem. To me, the company wanted the best of the best which, well, I am not I have also the idea that those sort of interview processes provide so little information about the person but I think it's my ego trying to not to get hurt. .
I could have fake it. Nowadays, you can find anything on the internet and I'm positive I could have found the solution. To what end? I'm not smart. Cheating won't make me smart, I think. It was not even about being honest. I doubt I'd be smart by cheating.
I like to believe that what I have cultivated is, that for most things, I don't need to be smart, I just have to be careful. I doubt I'm the best but I do think I best myself every day.