My Girl Friend

Today is Valentines day and I want to talk about a person that has always been with me, my computer.

Just by reading the line above you maybe thinking I am a Nerd. This is more a fact than a truth. Computers have been around in my life since I was 5 years old, and I love them. Ask me if I would rather have a super computer vs a Ferrari, and I would always pick the super computer.

It wasn’t till I started making my own money did I start building my computer. Contrary to popular belief building your own computer is extremely easy these days. You can think of it like high tech Lego that is super expensive. Quality components these days can handle a fall or something being dropped on them, very easily.

Building computers for guys like me, is basically how it is for gear heads and their cars. I originally started with an okay computer (i5 & GTX 1070) and moved on to do more … a lot more. I finished my latest upgrade yesterday I got a new case, mother board, and water cooler that will allow me to over clock. Its some thing new that I want to get into 🙂

As it stands here are my specs:

CPU: i7 – 7700k – Corsair – H115i water cooler

GPU: GTX 1080 Ti – Asetek – Custom water cooler

Mother Board: ATX – Z270 GAMING PRO CARBON

Hard Drives: – 1 X 256GB SSD / 1 X 1TB HHD / 1 X 3TB HHD

This is the best of the best as of late, this is what I wanted since I was 12 🙂

JS for beginners, the TLDR version – Part 1

Java Script is not different then other languages ! It’s unique and special in its own way.

JavaScript has everything you would expect to find all computer programming languages:

  • For loops
  • While loops
  • Do – Then loops
  • If – Else Statements
  • Switch Statements
  • Classes and Objects
  • Functions
  • Dynamically Typed (most languages have this)

However it has some very weird and interesting differences:

  • It has no truth, it is a truthy language
  • You can stuff a function into a variable
  • There are more ways then one to do the same thing

Machine Learning Explained – Part 1.4

Getting Started with Matlab – Part 1:

A lot of the math used for Machine Learning (ML) is linear algebra, actually a lot of engineering in general is based on the stuff. A matrix of numbers could represent everything from a circuit based control system, to a concrete pillar under a bridge. This also means that all the CAD software runs on the stuff as well. Its basically everywhere.

Linear algebra can be done by hand or you could do it using a programming language. You could be hardcore and write your own super optimized matrix inversion antilogarithms in C. Or even use python’s Numpy, or even R. However the industry standard is Matlab, these guys hold a virtual monopoly over the realm of engineering programming languages. When I say “engineering” I mean the hard physically based stuff like designing aircraft and rockets, or buildings.

Some would argue that Matlab is easier then Python, it is but only for linear algebra. You would not want to make your website in this stuff. Matlab works using a repal interface, all your variables are stored in memory and persist in your work space, this work space can be saved and loaded up again when you need it.

Below are some Matlab’s more basic commands.

 

 

Machine Learning Explained – Part 1.3

 

Near the end of the last post I started talking about gradient descent. Now for the most part you can think of gradient as surface that your trying to find the lowest point in. However once you get into systems that require you factor in more then just one feature it stops being a 3rd surface and become an abstract idea of being a surface. Now you have to optimize for N different cost functions that represent the N number of features.

To help in do this gradient descent effectively you have to properly calibrate the learning rate and adjust your training set using feature scaling. Each of these two things will help in making gradient descent find the right solution faster.

Feature Scaling: You want to do this when there are wild discrepancies in the range of values. For example for one of the features could be the size of the house in meter squared (in the 100s), and other could be number of previous owns ( 1- 5). You want to think about these types of things because it may cause your gradient decent algorithm to jump back and fort, making it harder to find the global minima. When you do feature scaling you are simply trying to get all your features into the same range of values.

Learning Rate: As you know the learning rate is effectually your step size as you go down the 3rd surface, trying to find the global minima. Some times the gradient descent algorithm may step so far ahead it may miss the minima, and keeps missing it since its step size (learning rate) is so high. However if you making your learning rate too small it may take a very long time before you find your minima since your have to take so many more steps.

Another way to find the values that minimize the cost function is to use the Normal equation.

Screen Shot 2018-02-11 at 12.34.28 AM

Where theta is the value that minimizes the cost function.

Where X is your feature matrix

Where Y is the known output

Using the Normal equation we can compute these values  in a straight forward process without the use of iteration. However this comes at a price of speed when the feature matrixes get very big, since to compute the inverse of a (n x n) matrix is roughly O(n^3). In these cases gradient descent is going to be the better choice.

My History with Cell Phones

The first smart phone I ever got was a android. It was a small thick brick from HTC, that did everything that I could ever want. Then after awhile I decided to switch carriers, which lead me to experience one of the first windows phones, it was a Nokia Lumia 920. And after that I moved on to a number of different BLU phones. The BLU phones that I bought were nice, but I kept up grading every 8 months to half a year.

As you can see I am a pretty fickle person, I am always looking for the next cool new thing. And last year I spent the most I had ever spent on a phone up until that point, and bought a Asus Zen Phone. It was the best android phone I had ever had in my life. It was super fast, responsive, reliable, and had great battery life.

Things were going well with the phone for a while there, and for a reason I can’t remember to this day I ordered an iPhone.  I bought a used 6s which I kept for a few weeks, until I realized that I needed more storage. At which point I returned it and bought another 6s with more storage. And then I realized the battery life wasn’t good enough for me. So I went ahead and dropped 1300 dollars on a brand new iPhone 7 Plus with 128 GB of storage.

I am not sure why I bought a iPhone. I think its because I wanted to make apps for it, and wanted that brand name 🤩 After having it for a few months I found the experience to be very very alright, nothing insanely special. I still have the iPhone and don’t plan to upgrade it for a long long long time.

I kinda regretted buying it for a few months until I started to mess with iOS’s new features, ML and AR. Both of which are interesting to play with, but as you can see from the app store it not like every other app out there has AR or ML in it.

Unreal 4 VS Unity

Over the last decade Unity has become the game engine of choose for a good chuck of game developer out there. This is due to many factors, the main factor being that it was designed as a product first. Whereas a number of other engines where brought into existence to make a game. In my opinion this is the key difference between the two engines.

Unreal was originally developed to facilitate the creation of one the most beloved FPS of all time “Unreal Tournament”. Unreal Tournament was designed to be a fast paced shooter, with high graphical fidelity and high performance networking. These things are the key features of the Unreal engine, which is why the engine has the cons and pros that it does.

In Unity’s case it was designed to be nothing but a game engine that would not limit game developers in what they could do, and eliminate the many bottle necks in the game development life cycle. It is simply a product built to make any game, not a particular game.

The differences between the two are seen in the usability of either one the engines. This is most prevalent in the languages that they use. Unity uses C# (aka Microsoft’s Java) whereas Unreal uses C++. For beginners and even intermediate programmers writing effective C++ code it very difficult. Since there is no memory abstraction layer and the syntax is not as initiative to understand. Another point of difference can also be see in the minimum computer specifications needed to effectively use the engines. Unity for the most part does not require much, it could probably run on a potato. Whereas Unreal requires a quad core (i7 preferably), 8GB of Ram (preferably more), and good video card (preferably anything greater then a GTX1060) .

The differences highlighted above also explain where the two engines are usually used. After a while Epic Games started to licences out their engine. The licences were very expensive so naturally the only people that bought it were other game studios, who then made AAA games. Unity on the other hand had a free tier and inexpensive (comparatively speaking)  which lead a lot of indie developers to adopt Unity. Indie developers are usually tiny teams working on shoe string budgets. And they are usually content with their profits if it is just enough to make another game.

The biggest difference has to be the community of either game engine. Unity has one the largest and helpful communities out there. There are a ton of forums, blogs, books, and video tutorials out there on Unity. And then there is the asset store, a market place that allows developers to sell anything and everything one would need to make a game, wither it be art work, scripts, or even music the asset store has it all. The Unreal engine has something simpler however it is  not as robust as  the Unity asset store.

It is in my opinion that if you want to make video games you should use what make your feel comfortable. If your a experienced C++ developer looking to code games and have a few art friends to make high rez 3D models, and you want this to be a PC only game choose Unreal. If your a one man developer that has some coding experience choose Unity.

 

 

WTF is a Protocol ?

This part of the Swift language is pretty simple to explain. A “Protocol” is what is called a “Interface” in most of the other languages out there. It is basically a set of rules that your struct, class, or enum has to conform to.

You maybe asking your self “why would I ever need this weird construct ? I know whats what. I don’t need these things if I am doing it all myself. ” Well thing is that it keeps you honest, and it keeps you on track.

More importantly it opens the door to things like delegates. More on this in my next blog post.