Configure (base) Spacemacs

I love using Spacemacs. I like how extensible Emacs is, but prefer the modal editing nature of Vi(m), and Spacemacs provides the best of both worlds through the use of Evil. Tinkering with my editor configuration to get the perfect setup is fun, and there are a few ways this can be achieved: Use base Emacs with customizationsUse the full Spacemacs distributionCustomize the base Spacemacs distribution Using base Emacs (1) and adding our own packages and configurations is doable but it takes a lot of work. Full Spacemacs (2) offers everything the distribution has to offer, but I find there…

0 Comments

XOR Logic Gate – Neural Networks

We have previously discussed OR logic gates and the importance of bias units in AND gates. Here, we will introduce the XOR gate and show why logistic regression can't model the non-linearity required for this particular problem. As always, the full code for these examples can be found in my GitHub repository here. XOR gates output True if either of the inputs are True, but not both. It acts like a more specific version of the OR gate: Input 1Input 2Output000011101110 If we visualize the data space we'll have a clearer sense of what causes the issue. As you can…

0 Comments

AND Logic Gate – Importance of bias units

Previously, we talked about simple OR gates and now we'll continue that discussion with AND gates, and specifically the role of bias units. We often neglect to consider the role bias plays in our models. We know that we should include bias units, but why? Here, I'll walk through a short example using an AND gate to highlight the importance of the bias unit. Bias units allow us to offset the model in the same way that an intercept allows us to offset a regression line. Imagine a simple AND gate. It will only fire if both inputs are true:…

0 Comments

OR Logic Gate using Theano

Theano is a powerful Python library that provides some useful tools for machine learning, such as GPU training and symbolic differentiation of the cost function during gradient descent. It can be a bit challenging to understand how Theano works, so before jumping into more complex non-linear models, we can get to grips with Theano by implementing something simple like an OR gate. An OR gate receives 2 inputs and will output true if either of the inputs are true. So, there are 3 cases where an OR gate will output a true value: Input 1Input 2Output000011101111 We can also represent…

0 Comments

Multiple Regression using Python

Whenever I do any machine learning I either manually implement models in MATLAB or use Python libraries like scikit-learn where all of the work is done for me. However, I wanted to learn how to manually implement some of these things in Python so I figured I'd document this learning process over a series of posts. Lets start with something simple: ordinary least squares multiple regression The goal of multiple regression is predict the value of some outcome from a series of input variables. Here, I'll be using the Los Angeles Heart Data Setting up the data Lets import some…

0 Comments