From cc345ccd2298054022e4af5a00caa3567b68d9e8 Mon Sep 17 00:00:00 2001 From: AlbertDominguez Date: Tue, 20 Aug 2024 10:49:00 +0200 Subject: [PATCH] fix latex display --- .gitignore | 2 +- solution.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 8a02456..0f5a4a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ .ipynb_checkpoints/ -.mnist \ No newline at end of file +mnist_data diff --git a/solution.py b/solution.py index 37c2c92..7149ecc 100644 --- a/solution.py +++ b/solution.py @@ -56,7 +56,7 @@ * `x`: the input of the perceptron, a `numpy` array of shape `(n,)` * `w`: the weights of the perceptron, a `numpy` array of shape `(n,)` * `b`: a single scalar value for the bias -* `f`: a nonlinear function $f: \mathbb{R}\mapsto\left{0, 1\right}$ +* `f`: a nonlinear function $f: \mathbb{R}\mapsto\{0, 1\}$ Test your perceptron function on 2D inputs (i.e., `n=2`) and plot the result. Change the weights, bias, and the function $f$ and see how the output of the perceptron changes. """ @@ -179,7 +179,7 @@ def plot_xor_data(): #### Hint -A single layer in a multilayer perceptron can be described by the equation $y = f(x^\intercal w + b)$, where $f$ denotes a non-linear function, $b$ denotes the bias (a constant offset vector) and $w$ denotes a vector of weights. Since we are only interested in boolean outputs ($\left{0,1\right}$), a good choice for $f$ is the threshold function. Think about which kind of logical operations you can implement with a single perceptron, then see how you can combine them to create an XOR. It might help to write down the equation for a two layer perceptron network. +A single layer in a multilayer perceptron can be described by the equation $y = f(x^\intercal w + b)$, where $f$ denotes a non-linear function, $b$ denotes the bias (a constant offset vector) and $w$ denotes a vector of weights. Since we are only interested in boolean outputs ($\{0,1\}$), a good choice for $f$ is the threshold function. Think about which kind of logical operations you can implement with a single perceptron, then see how you can combine them to create an XOR. It might help to write down the equation for a two layer perceptron network. """ # %% tags=["task"] @@ -1136,7 +1136,5 @@ def predict(model, test_dataloader, device): You reached the end, congratulations! In this last part, you have been introduced to CNNs as well as trained one on the infamous MNIST dataset for digit classification. After 10 epochs, your model should achieve a training, validation, and test accuracy of more than 95%. We will use this checkpoint to discuss why we use training, validation, and testing datasets in practice. - -time: 65 working + 20 discussion """