Writing a neural network with Base R

For this example, we will use Base R to create a very simple neural network from scratch to better understand exactly what is happening at each step. In order to complete this task we will do the following:

  • Define the activation function for the neurons in our model
  • Create a function that shows the line after every iteration of learning the weights
  • Make some test data and plot these data values
  • Update weights using the results of the previous attempt

We will use the following steps to do so:

  1. First, we code the Heaviside (binary) step activation function to start. We will recall that this function evaluates the input and if this value is greater than zero, then the output value of the function is 1

Get Hands-On Deep Learning with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.