less than 1 minute read

Missing animation

  • Generate the dataset as described.
  • Label the data to indicate which points belong to the inner and outer groups.
  • Create and train the neural network.
  • Animate the learning process to show how the network’s decision boundary evolves.

The data is generated by two uniform distribution. The angles are drawn from $U(0, 2\pi)$ while the radii for the inner circle are drawn from $U(0, r_1)$ the outer radii are drawn from $U(r_2, r_3)$, with $r_1 < r_2 <r_3$. \(x = r\cos(\alpha)\) \(y = r\sin(\alpha)\)

The neural network sequence is given by a tensorflow keras model with sixteen neurons in two layers using the rectifier activation function and a sigmoid for the output neuron. This sequence is chosen to account for the non-linearity of the two distinct groups.

model = Sequential(
    [
        Dense(16, input_dim=2, activation="relu"),
        Dense(16, activation="relu"),
        Dense(1, activation="sigmoid"),
    ]
)