diff --git a/doc/LectureNotes/_build/.doctrees/environment.pickle b/doc/LectureNotes/_build/.doctrees/environment.pickle
index b80b16b8f..1e49cad6e 100644
Binary files a/doc/LectureNotes/_build/.doctrees/environment.pickle and b/doc/LectureNotes/_build/.doctrees/environment.pickle differ
diff --git a/doc/LectureNotes/_build/.doctrees/exercisesweek43.doctree b/doc/LectureNotes/_build/.doctrees/exercisesweek43.doctree
new file mode 100644
index 000000000..675ddfade
Binary files /dev/null and b/doc/LectureNotes/_build/.doctrees/exercisesweek43.doctree differ
diff --git a/doc/LectureNotes/_build/.doctrees/intro.doctree b/doc/LectureNotes/_build/.doctrees/intro.doctree
index f3aa1e84d..e75534081 100644
Binary files a/doc/LectureNotes/_build/.doctrees/intro.doctree and b/doc/LectureNotes/_build/.doctrees/intro.doctree differ
diff --git a/doc/LectureNotes/_build/.doctrees/week43.doctree b/doc/LectureNotes/_build/.doctrees/week43.doctree
new file mode 100644
index 000000000..ccf5b709d
Binary files /dev/null and b/doc/LectureNotes/_build/.doctrees/week43.doctree differ
diff --git a/doc/LectureNotes/_build/html/_sources/exercisesweek43.ipynb b/doc/LectureNotes/_build/html/_sources/exercisesweek43.ipynb
new file mode 100644
index 000000000..737d0d60c
--- /dev/null
+++ b/doc/LectureNotes/_build/html/_sources/exercisesweek43.ipynb
@@ -0,0 +1,617 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "860d70d8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "119c0988",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Exercises week 43 \n",
+ "**October 20-24, 2025**\n",
+ "\n",
+ "Date: **Deadline Friday October 24 at midnight**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "909887eb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Overarching aims of the exercises weeks 43 and 44\n",
+ "\n",
+ "The aim of the exercises this week is to gain some confidence with\n",
+ "ways to visualize the results of a classification problem. We will\n",
+ "target three ways of setting up the analysis. The first and simplest\n",
+ "one is the\n",
+ "1. so-called confusion matrix, and the next is the\n",
+ "\n",
+ "2. ROC curve and finally the\n",
+ "\n",
+ "3. Cumulative gain curve.\n",
+ "\n",
+ "We will use Logistic Regression as method for the classification in\n",
+ "this exercise. You can compare these results with those obtained with\n",
+ "your neural network code from project 2 without a hidden layer.\n",
+ "\n",
+ "In these exercises we will use binary and multi-class data sets\n",
+ "(the Iris data set from week 41).\n",
+ "\n",
+ "The underlying mathematics is described here."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1e1cb4fb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Confusion Matrix\n",
+ "\n",
+ "A **confusion matrix** summarizes a classifier’s performance by\n",
+ "tabulating predictions versus true labels. For binary classification,\n",
+ "it is a $2\\times2$ table whose entries are counts of outcomes:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7b090385",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{array}{l|cc} & \\text{Predicted Positive} & \\text{Predicted Negative} \\\\ \\hline \\text{Actual Positive} & TP & FN \\\\ \\text{Actual Negative} & FP & TN \\end{array}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1e14904b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Here TP (true positives) is the number of cases correctly predicted as\n",
+ "positive, FP (false positives) is the number incorrectly predicted as\n",
+ "positive, TN (true negatives) is correctly predicted negative, and FN\n",
+ "(false negatives) is incorrectly predicted negative . In other words,\n",
+ "“positive” means class 1 and “negative” means class 0; for example, TP\n",
+ "occurs when the prediction and actual are both positive. Formally:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e93ea290",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\text{TPR} = \\frac{\\text{TP}}{\\text{TP} + \\text{FN}}, \\quad \\text{FPR} = \\frac{\\text{FP}}{\\text{FP} + \\text{TN}},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c80bea5b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where TPR and FPR are the true and false positive rates defined below.\n",
+ "\n",
+ "In multiclass classification with $K$ classes, the confusion matrix\n",
+ "generalizes to a $K\\times K$ table. Entry $N_{ij}$ in the table is\n",
+ "the count of instances whose true class is $i$ and whose predicted\n",
+ "class is $j$. For example, a three-class confusion matrix can be written\n",
+ "as:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a0f68f5f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{array}{c|ccc} & \\text{Pred Class 1} & \\text{Pred Class 2} & \\text{Pred Class 3} \\\\ \\hline \\text{Act Class 1} & N_{11} & N_{12} & N_{13} \\\\ \\text{Act Class 2} & N_{21} & N_{22} & N_{23} \\\\ \\text{Act Class 3} & N_{31} & N_{32} & N_{33} \\end{array}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "869669b2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Here the diagonal entries $N_{ii}$ are the true positives for each\n",
+ "class, and off-diagonal entries are misclassifications. This matrix\n",
+ "allows computation of per-class metrics: e.g. for class $i$,\n",
+ "$\\mathrm{TP}_i=N_{ii}$, $\\mathrm{FN}_i=\\sum_{j\\neq i}N_{ij}$,\n",
+ "$\\mathrm{FP}_i=\\sum_{j\\neq i}N_{ji}$, and $\\mathrm{TN}_i$ is the sum of\n",
+ "all remaining entries.\n",
+ "\n",
+ "As defined above, TPR and FPR come from the binary case. In binary\n",
+ "terms with $P$ actual positives and $N$ actual negatives, one has"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2abd82a7",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\text{TPR} = \\frac{TP}{P} = \\frac{TP}{TP+FN}, \\quad \\text{FPR} =\n",
+ "\\frac{FP}{N} = \\frac{FP}{FP+TN},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2f79325c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "as used in standard confusion-matrix\n",
+ "formulations. These rates will be used in constructing ROC curves."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0ce65a47",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### ROC Curve\n",
+ "\n",
+ "The Receiver Operating Characteristic (ROC) curve plots the trade-off\n",
+ "between true positives and false positives as a discrimination\n",
+ "threshold varies. Specifically, for a binary classifier that outputs\n",
+ "a score or probability, one varies the threshold $t$ for declaring\n",
+ "**positive**, and computes at each $t$ the true positive rate\n",
+ "$\\mathrm{TPR}(t)$ and false positive rate $\\mathrm{FPR}(t)$ using the\n",
+ "confusion matrix at that threshold. The ROC curve is then the graph\n",
+ "of TPR versus FPR. By definition,"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d750fdff",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\mathrm{TPR} = \\frac{TP}{TP+FN}, \\qquad \\mathrm{FPR} = \\frac{FP}{FP+TN},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "561bfb2c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $TP,FP,TN,FN$ are counts determined by threshold $t$. A perfect\n",
+ "classifier would reach the point (FPR=0, TPR=1) at some threshold.\n",
+ "\n",
+ "Formally, the ROC curve is obtained by plotting\n",
+ "$(\\mathrm{FPR}(t),\\mathrm{TPR}(t))$ for all $t\\in[0,1]$ (or as $t$\n",
+ "sweeps through the sorted scores). The Area Under the ROC Curve (AUC)\n",
+ "quantifies the average performance over all thresholds. It can be\n",
+ "interpreted probabilistically: $\\mathrm{AUC} =\n",
+ "\\Pr\\bigl(s(X^+)>s(X^-)\\bigr)$, the probability that a random positive\n",
+ "instance $X^+$ receives a higher score $s$ than a random negative\n",
+ "instance $X^-$ . Equivalently, the AUC is the integral under the ROC\n",
+ "curve:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5ca722fe",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\mathrm{AUC} \\;=\\; \\int_{0}^{1} \\mathrm{TPR}(f)\\,df,\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "30080a86",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $f$ ranges over FPR (or fraction of negatives). A model that guesses at random yields a diagonal ROC (AUC=0.5), whereas a perfect model yields AUC=1.0."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9e627156",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Cumulative Gain\n",
+ "\n",
+ "The cumulative gain curve (or gains chart) evaluates how many\n",
+ "positives are captured as one targets an increasing fraction of the\n",
+ "population, sorted by model confidence. To construct it, sort all\n",
+ "instances by decreasing predicted probability of the positive class.\n",
+ "Then, for the top $\\alpha$ fraction of instances, compute the fraction\n",
+ "of all actual positives that fall in this subset. In formula form, if\n",
+ "$P$ is the total number of positive instances and $P(\\alpha)$ is the\n",
+ "number of positives among the top $\\alpha$ of the data, the cumulative\n",
+ "gain at level $\\alpha$ is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3e9132ef",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\mathrm{Gain}(\\alpha) \\;=\\; \\frac{P(\\alpha)}{P}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "75be6f5c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "For example, cutting off at the top 10% of predictions yields a gain\n",
+ "equal to (positives in top 10%) divided by (total positives) .\n",
+ "Plotting $\\mathrm{Gain}(\\alpha)$ versus $\\alpha$ (often in percent)\n",
+ "gives the gain curve. The baseline (random) curve is the diagonal\n",
+ "$\\mathrm{Gain}(\\alpha)=\\alpha$, while an ideal model has a steep climb\n",
+ "toward 1.\n",
+ "\n",
+ "A related measure is the {\\em lift}, often called the gain ratio. It is the ratio of the model’s capture rate to that of random selection. Equivalently,"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e5525570",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\mathrm{Lift}(\\alpha) \\;=\\; \\frac{\\mathrm{Gain}(\\alpha)}{\\alpha}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "18ff8dc2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "A lift $>1$ indicates better-than-random targeting. In practice, gain\n",
+ "and lift charts (used e.g.\\ in marketing or imbalanced classification)\n",
+ "show how many positives can be “gained” by focusing on a fraction of\n",
+ "the population ."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c3d3fde8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Other measures: Precision, Recall, and the F$_1$ Measure\n",
+ "\n",
+ "Precision and recall (sensitivity) quantify binary classification\n",
+ "accuracy in terms of positive predictions. They are defined from the\n",
+ "confusion matrix as:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f1f14c8e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\text{Precision} = \\frac{TP}{TP + FP}, \\qquad \\text{Recall} = \\frac{TP}{TP + FN}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "422cc743",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Precision is the fraction of predicted positives that are correct, and\n",
+ "recall is the fraction of actual positives that are correctly\n",
+ "identified . A high-precision classifier makes few false-positive\n",
+ "errors, while a high-recall classifier makes few false-negative\n",
+ "errors.\n",
+ "\n",
+ "The F$_1$ score (balanced F-measure) combines precision and recall into a single metric via their harmonic mean. The usual formula is:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "621a2e8b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "F_1 =2\\frac{\\text{Precision}\\times\\text{Recall}}{\\text{Precision} + \\text{Recall}}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "62eee54a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "This can be shown to equal"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7a6a2e7a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\frac{2\\,TP}{2\\,TP + FP + FN}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b96c9ff4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "The F$_1$ score ranges from 0 (worst) to 1 (best), and balances the\n",
+ "trade-off between precision and recall.\n",
+ "\n",
+ "For multi-class classification, one computes per-class\n",
+ "precision/recall/F$_1$ (treating each class as “positive” in a\n",
+ "one-vs-rest manner) and then averages. Common averaging methods are:\n",
+ "\n",
+ "Micro-averaging: Sum all true positives, false positives, and false negatives across classes, then compute precision/recall/F$_1$ from these totals.\n",
+ "Macro-averaging: Compute the F$1$ score $F{1,i}$ for each class $i$ separately, then take the unweighted mean: $F_{1,\\mathrm{macro}} = \\frac{1}{K}\\sum_{i=1}^K F_{1,i}$ . This treats all classes equally regardless of size.\n",
+ "Weighted-averaging: Like macro-average, but weight each class’s $F_{1,i}$ by its support $n_i$ (true count): $F_{1,\\mathrm{weighted}} = \\frac{1}{N}\\sum_{i=1}^K n_i F_{1,i}$, where $N=\\sum_i n_i$. This accounts for class imbalance by giving more weight to larger classes .\n",
+ "\n",
+ "Each of these averages has different use-cases. Micro-average is\n",
+ "dominated by common classes, macro-average highlights performance on\n",
+ "rare classes, and weighted-average is a compromise. These formulas\n",
+ "and concepts allow rigorous evaluation of classifier performance in\n",
+ "both binary and multi-class settings."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9274bf3f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Exercises\n",
+ "\n",
+ "Here is a simple code example which uses the Logistic regression machinery from **scikit-learn**.\n",
+ "At the end it sets up the confusion matrix and the ROC and cumulative gain curves.\n",
+ "Feel free to use these functionalities (we don't expect you to write your own code for say the confusion matrix)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "be9ff0b9",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "%matplotlib inline\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "from sklearn.model_selection import train_test_split \n",
+ "# from sklearn.datasets import fill in the data set\n",
+ "from sklearn.linear_model import LogisticRegression\n",
+ "\n",
+ "# Load the data, fill inn\n",
+ "mydata.data = ?\n",
+ "\n",
+ "X_train, X_test, y_train, y_test = train_test_split(mydata.data,cancer.target,random_state=0)\n",
+ "print(X_train.shape)\n",
+ "print(X_test.shape)\n",
+ "# Logistic Regression\n",
+ "# define which type of problem, binary or multiclass\n",
+ "logreg = LogisticRegression(solver='lbfgs')\n",
+ "logreg.fit(X_train, y_train)\n",
+ "\n",
+ "from sklearn.preprocessing import LabelEncoder\n",
+ "from sklearn.model_selection import cross_validate\n",
+ "#Cross validation\n",
+ "accuracy = cross_validate(logreg,X_test,y_test,cv=10)['test_score']\n",
+ "print(accuracy)\n",
+ "print(\"Test set accuracy with Logistic Regression: {:.2f}\".format(logreg.score(X_test,y_test)))\n",
+ "\n",
+ "import scikitplot as skplt\n",
+ "y_pred = logreg.predict(X_test)\n",
+ "skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)\n",
+ "plt.show()\n",
+ "y_probas = logreg.predict_proba(X_test)\n",
+ "skplt.metrics.plot_roc(y_test, y_probas)\n",
+ "plt.show()\n",
+ "skplt.metrics.plot_cumulative_gain(y_test, y_probas)\n",
+ "plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "51760b3e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Exercise a)\n",
+ "\n",
+ "Convince yourself about the mathematics for the confusion matrix, the ROC and the cumlative gain curves for both a binary and a multiclass classification problem."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c1d42f5f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Exercise b)\n",
+ "\n",
+ "Use a binary classification data available from **scikit-learn**. As an example you can use\n",
+ "the MNIST data set and just specialize to two numbers. To do so you can use the following code lines"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "d20bb8be",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from sklearn.datasets import load_digits\n",
+ "digits = load_digits(n_class=2) # Load only two classes, e.g., 0 and 1\n",
+ "X, y = digits.data, digits.target"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "828ea1cd",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Alternatively, you can use the _make$\\_$classification_\n",
+ "functionality. This function generates a random $n$-class classification\n",
+ "dataset, which can be configured for binary classification by setting\n",
+ "n_classes=2. You can also control the number of samples, features,\n",
+ "informative features, redundant features, and more."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "d271f0ba",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from sklearn.datasets import make_classification\n",
+ "X, y = make_classification(n_samples=1000, n_features=20, n_informative=10, n_redundant=5, n_classes=2, random_state=42)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0068b032",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "You can use this option for the multiclass case as well, see the next exercise.\n",
+ "If you prefer to study other binary classification datasets, feel free\n",
+ "to replace the above suggestions with your own dataset.\n",
+ "\n",
+ "Make plots of the confusion matrix, the ROC curve and the cumulative gain curve."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c45f5b41",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Exercise c) week 43\n",
+ "\n",
+ "As a multiclass problem, we will use the Iris data set discussed in\n",
+ "the exercises from weeks 41 and 42. This is a three-class data set and\n",
+ "you can set it up using **scikit-learn**,"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "3b045d56",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from sklearn.datasets import load_iris\n",
+ "iris = load_iris()\n",
+ "X = iris.data # Features\n",
+ "y = iris.target # Target labels"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "14cc859c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Make plots of the confusion matrix, the ROC curve and the cumulative\n",
+ "gain curve for this (or other) multiclass data set."
+ ]
+ }
+ ],
+ "metadata": {},
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/doc/LectureNotes/_build/html/_sources/week43.ipynb b/doc/LectureNotes/_build/html/_sources/week43.ipynb
new file mode 100644
index 000000000..8d5235416
--- /dev/null
+++ b/doc/LectureNotes/_build/html/_sources/week43.ipynb
@@ -0,0 +1,5948 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "b10156d4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f85baa2f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations\n",
+ "**Morten Hjorth-Jensen**, Department of Physics, University of Oslo, Norway\n",
+ "\n",
+ "Date: **October 20, 2025**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "543fad4a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Plans for week 43\n",
+ "\n",
+ "**Material for the lecture on Monday October 20, 2025.**\n",
+ "\n",
+ "1. Reminder from last week, see also lecture notes from week 42 at as well as those from week 41, see see . \n",
+ "\n",
+ "2. Building our own Feed-forward Neural Network.\n",
+ "\n",
+ "3. Coding examples using Tensorflow/Keras and Pytorch examples. The Pytorch examples are adapted from Rashcka's text, see chapters 11-13.. \n",
+ "\n",
+ "4. Start discussions on how to use neural networks for solving differential equations (ordinary and partial ones). This topic continues next week as well.\n",
+ "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "72acb4e9",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Exercises and lab session week 43\n",
+ "**Lab sessions on Tuesday and Wednesday.**\n",
+ "\n",
+ "1. Work on writing your own neural network code and discussions of project 2. If you didn't get time to do the exercises from the two last weeks, we recommend doing so as these exercises give you the basic elements of a neural network code.\n",
+ "\n",
+ "2. The exercises this week are tailored to the optional part of project 2, and deal with studying ways to display results from classification problems"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "361768dc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Using Automatic differentiation\n",
+ "\n",
+ "In our discussions of ordinary differential equations and neural network codes\n",
+ "we will also study the usage of Autograd, see for example in computing gradients for deep learning. For the documentation of Autograd and examples see the Autograd documentation at and the lecture slides from week 41, see ."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3e058671",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Back propagation and automatic differentiation\n",
+ "\n",
+ "For more details on the back propagation algorithm and automatic differentiation see\n",
+ "1. \n",
+ "\n",
+ "2. \n",
+ "\n",
+ "3. Slides 12-44 at "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8cbbf2bf",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Lecture Monday October 20"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "78e2de21",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the back propagation algorithm and algorithm for a feed forward NN, initalizations\n",
+ "This is a reminder from last week.\n",
+ "\n",
+ "**The architecture (our model).**\n",
+ "\n",
+ "1. Set up your inputs and outputs (scalars, vectors, matrices or higher-order arrays)\n",
+ "\n",
+ "2. Define the number of hidden layers and hidden nodes\n",
+ "\n",
+ "3. Define activation functions for hidden layers and output layers\n",
+ "\n",
+ "4. Define optimizer (plan learning rate, momentum, ADAgrad, RMSprop, ADAM etc) and array of initial learning rates\n",
+ "\n",
+ "5. Define cost function and possible regularization terms with hyperparameters\n",
+ "\n",
+ "6. Initialize weights and biases\n",
+ "\n",
+ "7. Fix number of iterations for the feed forward part and back propagation part"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "41a3dc23",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the back propagation algorithm, part 1\n",
+ "\n",
+ "Let us write this out in the form of an algorithm.\n",
+ "\n",
+ "**First**, we set up the input data $\\boldsymbol{x}$ and the activations\n",
+ "$\\boldsymbol{z}_1$ of the input layer and compute the activation function and\n",
+ "the pertinent outputs $\\boldsymbol{a}^1$.\n",
+ "\n",
+ "**Secondly**, we perform then the feed forward till we reach the output\n",
+ "layer and compute all $\\boldsymbol{z}_l$ of the input layer and compute the\n",
+ "activation function and the pertinent outputs $\\boldsymbol{a}^l$ for\n",
+ "$l=1,2,3,\\dots,L$.\n",
+ "\n",
+ "**Notation**: The first hidden layer has $l=1$ as label and the final output layer has $l=L$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0e4ac2c0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the back propagation algorithm, part 2\n",
+ "\n",
+ "Thereafter we compute the ouput error $\\boldsymbol{\\delta}^L$ by computing all"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e9fd2f83",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\delta_j^L = \\sigma'(z_j^L)\\frac{\\partial {\\cal C}}{\\partial (a_j^L)}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "16e2b900",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Then we compute the back propagate error for each $l=L-1,L-2,\\dots,1$ as"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f9f4b9d8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\delta_j^l = \\sum_k \\delta_k^{l+1}w_{kj}^{l+1}\\sigma'(z_j^l).\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "01be6441",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the Back propagation algorithm, part 3\n",
+ "\n",
+ "Finally, we update the weights and the biases using gradient descent\n",
+ "for each $l=L-1,L-2,\\dots,1$ (the first hidden layer) and update the weights and biases\n",
+ "according to the rules"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ce898b85",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "w_{ij}^l\\leftarrow = w_{ij}^l- \\eta \\delta_j^la_i^{l-1},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4e2e7314",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "b_j^l \\leftarrow b_j^l-\\eta \\frac{\\partial {\\cal C}}{\\partial b_j^l}=b_j^l-\\eta \\delta_j^l,\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b7114295",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $\\eta$ being the learning rate."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "69dfa048",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Updating the gradients\n",
+ "\n",
+ "With the back propagate error for each $l=L-1,L-2,\\dots,1$ as"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6efa469c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\delta_j^l = \\sum_k \\delta_k^{l+1}w_{kj}^{l+1}\\sigma'(z_j^l),\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "076e4937",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "we update the weights and the biases using gradient descent for each $l=L-1,L-2,\\dots,1$ and update the weights and biases according to the rules"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1072f5a1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "w_{ij}^l\\leftarrow = w_{ij}^l- \\eta \\delta_j^la_i^{l-1},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f77a7074",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "b_j^l \\leftarrow b_j^l-\\eta \\frac{\\partial {\\cal C}}{\\partial b_j^l}=b_j^l-\\eta \\delta_j^l,\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f12effab",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Activation functions\n",
+ "\n",
+ "A property that characterizes a neural network, other than its\n",
+ "connectivity, is the choice of activation function(s). The following\n",
+ "restrictions are imposed on an activation function for an FFNN to\n",
+ "fulfill the universal approximation theorem\n",
+ "\n",
+ " * Non-constant\n",
+ "\n",
+ " * Bounded\n",
+ "\n",
+ " * Monotonically-increasing\n",
+ "\n",
+ " * Continuous"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "31eb54b1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Activation functions, examples\n",
+ "\n",
+ "Typical examples are the logistic *Sigmoid*"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7a549168",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\sigma(x) = \\frac{1}{1 + e^{-x}},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ce35ae73",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "and the *hyperbolic tangent* function"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d6cdfc89",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\sigma(x) = \\tanh(x)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ddd59bb0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The RELU function family\n",
+ "\n",
+ "The ReLU activation function suffers from a problem known as the dying\n",
+ "ReLUs: during training, some neurons effectively die, meaning they\n",
+ "stop outputting anything other than 0.\n",
+ "\n",
+ "In some cases, you may find that half of your network’s neurons are\n",
+ "dead, especially if you used a large learning rate. During training,\n",
+ "if a neuron’s weights get updated such that the weighted sum of the\n",
+ "neuron’s inputs is negative, it will start outputting 0. When this\n",
+ "happen, the neuron is unlikely to come back to life since the gradient\n",
+ "of the ReLU function is 0 when its input is negative."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f2a78e55",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## ELU function\n",
+ "\n",
+ "To solve this problem, nowadays practitioners use a variant of the\n",
+ "ReLU function, such as the leaky ReLU discussed above or the so-called\n",
+ "exponential linear unit (ELU) function"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "cde73faf",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "ELU(z) = \\left\\{\\begin{array}{cc} \\alpha\\left( \\exp{(z)}-1\\right) & z < 0,\\\\ z & z \\ge 0.\\end{array}\\right.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "08048672",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Which activation function should we use?\n",
+ "\n",
+ "In general it seems that the ELU activation function is better than\n",
+ "the leaky ReLU function (and its variants), which is better than\n",
+ "ReLU. ReLU performs better than $\\tanh$ which in turn performs better\n",
+ "than the logistic function.\n",
+ "\n",
+ "If runtime performance is an issue, then you may opt for the leaky\n",
+ "ReLU function over the ELU function If you don’t want to tweak yet\n",
+ "another hyperparameter, you may just use the default $\\alpha$ of\n",
+ "$0.01$ for the leaky ReLU, and $1$ for ELU. If you have spare time and\n",
+ "computing power, you can use cross-validation or bootstrap to evaluate\n",
+ "other activation functions."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a7085280",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## More on activation functions, output layers\n",
+ "\n",
+ "In most cases you can use the ReLU activation function in the hidden\n",
+ "layers (or one of its variants).\n",
+ "\n",
+ "It is a bit faster to compute than other activation functions, and the\n",
+ "gradient descent optimization does in general not get stuck.\n",
+ "\n",
+ "**For the output layer:**\n",
+ "\n",
+ "* For classification the softmax activation function is generally a good choice for classification tasks (when the classes are mutually exclusive).\n",
+ "\n",
+ "* For regression tasks, you can simply use no activation function at all."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "291e4fb2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Building neural networks in Tensorflow and Keras\n",
+ "\n",
+ "Now we want to build on the experience gained from our neural network implementation in NumPy and scikit-learn\n",
+ "and use it to construct a neural network in Tensorflow. Once we have constructed a neural network in NumPy\n",
+ "and Tensorflow, building one in Keras is really quite trivial, though the performance may suffer. \n",
+ "\n",
+ "In our previous example we used only one hidden layer, and in this we will use two. From this it should be quite\n",
+ "clear how to build one using an arbitrary number of hidden layers, using data structures such as Python lists or\n",
+ "NumPy arrays."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a8c5f4c2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Tensorflow\n",
+ "\n",
+ "Tensorflow is an open source library machine learning library\n",
+ "developed by the Google Brain team for internal use. It was released\n",
+ "under the Apache 2.0 open source license in November 9, 2015.\n",
+ "\n",
+ "Tensorflow is a computational framework that allows you to construct\n",
+ "machine learning models at different levels of abstraction, from\n",
+ "high-level, object-oriented APIs like Keras, down to the C++ kernels\n",
+ "that Tensorflow is built upon. The higher levels of abstraction are\n",
+ "simpler to use, but less flexible, and our choice of implementation\n",
+ "should reflect the problems we are trying to solve.\n",
+ "\n",
+ "[Tensorflow uses](https://www.tensorflow.org/guide/graphs) so-called graphs to represent your computation\n",
+ "in terms of the dependencies between individual operations, such that you first build a Tensorflow *graph*\n",
+ "to represent your model, and then create a Tensorflow *session* to run the graph.\n",
+ "\n",
+ "In this guide we will analyze the same data as we did in our NumPy and\n",
+ "scikit-learn tutorial, gathered from the MNIST database of images. We\n",
+ "will give an introduction to the lower level Python Application\n",
+ "Program Interfaces (APIs), and see how we use them to build our graph.\n",
+ "Then we will build (effectively) the same graph in Keras, to see just\n",
+ "how simple solving a machine learning problem can be.\n",
+ "\n",
+ "To install tensorflow on Unix/Linux systems, use pip as"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "9a0aac03",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "pip3 install tensorflow"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ca0c7865",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "and/or if you use **anaconda**, just write (or install from the graphical user interface)\n",
+ "(current release of CPU-only TensorFlow)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "d0c581f7",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "conda create -n tf tensorflow\n",
+ "conda activate tf"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fe086bc9",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "To install the current release of GPU TensorFlow"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "f551fad9",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "conda create -n tf-gpu tensorflow-gpu\n",
+ "conda activate tf-gpu"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "58152cef",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Using Keras\n",
+ "\n",
+ "Keras is a high level [neural network](https://en.wikipedia.org/wiki/Application_programming_interface)\n",
+ "that supports Tensorflow, CTNK and Theano as backends. \n",
+ "If you have Anaconda installed you may run the following command"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "579b6a4a",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "conda install keras"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5da15206",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "You can look up the [instructions here](https://keras.io/) for more information.\n",
+ "\n",
+ "We will to a large extent use **keras** in this course."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "cc970d32",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Collect and pre-process data\n",
+ "\n",
+ "Let us look again at the MINST data set."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "a4f2c8a8",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "%matplotlib inline\n",
+ "\n",
+ "# import necessary packages\n",
+ "import numpy as np\n",
+ "import matplotlib.pyplot as plt\n",
+ "import tensorflow as tf\n",
+ "from sklearn import datasets\n",
+ "\n",
+ "\n",
+ "# ensure the same random numbers appear every time\n",
+ "np.random.seed(0)\n",
+ "\n",
+ "# display images in notebook\n",
+ "%matplotlib inline\n",
+ "plt.rcParams['figure.figsize'] = (12,12)\n",
+ "\n",
+ "\n",
+ "# download MNIST dataset\n",
+ "digits = datasets.load_digits()\n",
+ "\n",
+ "# define inputs and labels\n",
+ "inputs = digits.images\n",
+ "labels = digits.target\n",
+ "\n",
+ "print(\"inputs = (n_inputs, pixel_width, pixel_height) = \" + str(inputs.shape))\n",
+ "print(\"labels = (n_inputs) = \" + str(labels.shape))\n",
+ "\n",
+ "\n",
+ "# flatten the image\n",
+ "# the value -1 means dimension is inferred from the remaining dimensions: 8x8 = 64\n",
+ "n_inputs = len(inputs)\n",
+ "inputs = inputs.reshape(n_inputs, -1)\n",
+ "print(\"X = (n_inputs, n_features) = \" + str(inputs.shape))\n",
+ "\n",
+ "\n",
+ "# choose some random images to display\n",
+ "indices = np.arange(n_inputs)\n",
+ "random_indices = np.random.choice(indices, size=5)\n",
+ "\n",
+ "for i, image in enumerate(digits.images[random_indices]):\n",
+ " plt.subplot(1, 5, i+1)\n",
+ " plt.axis('off')\n",
+ " plt.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest')\n",
+ " plt.title(\"Label: %d\" % digits.target[random_indices[i]])\n",
+ "plt.show()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "d0c06f34",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from tensorflow.keras.layers import Input\n",
+ "from tensorflow.keras.models import Sequential #This allows appending layers to existing models\n",
+ "from tensorflow.keras.layers import Dense #This allows defining the characteristics of a particular layer\n",
+ "from tensorflow.keras import optimizers #This allows using whichever optimiser we want (sgd,adam,RMSprop)\n",
+ "from tensorflow.keras import regularizers #This allows using whichever regularizer we want (l1,l2,l1_l2)\n",
+ "from tensorflow.keras.utils import to_categorical #This allows using categorical cross entropy as the cost function\n",
+ "\n",
+ "from sklearn.model_selection import train_test_split\n",
+ "\n",
+ "# one-hot representation of labels\n",
+ "labels = to_categorical(labels)\n",
+ "\n",
+ "# split into train and test data\n",
+ "train_size = 0.8\n",
+ "test_size = 1 - train_size\n",
+ "X_train, X_test, Y_train, Y_test = train_test_split(inputs, labels, train_size=train_size,\n",
+ " test_size=test_size)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "8272ca95",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "\n",
+ "epochs = 100\n",
+ "batch_size = 100\n",
+ "n_neurons_layer1 = 100\n",
+ "n_neurons_layer2 = 50\n",
+ "n_categories = 10\n",
+ "eta_vals = np.logspace(-5, 1, 7)\n",
+ "lmbd_vals = np.logspace(-5, 1, 7)\n",
+ "def create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories, eta, lmbd):\n",
+ " model = Sequential()\n",
+ " model.add(Dense(n_neurons_layer1, activation='sigmoid', kernel_regularizer=regularizers.l2(lmbd)))\n",
+ " model.add(Dense(n_neurons_layer2, activation='sigmoid', kernel_regularizer=regularizers.l2(lmbd)))\n",
+ " model.add(Dense(n_categories, activation='softmax'))\n",
+ " \n",
+ " sgd = optimizers.SGD(learning_rate=eta)\n",
+ " model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])\n",
+ " \n",
+ " return model"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "616613a7",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "DNN_keras = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object)\n",
+ " \n",
+ "for i, eta in enumerate(eta_vals):\n",
+ " for j, lmbd in enumerate(lmbd_vals):\n",
+ " DNN = create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories,\n",
+ " eta=eta, lmbd=lmbd)\n",
+ " DNN.fit(X_train, Y_train, epochs=epochs, batch_size=batch_size, verbose=0)\n",
+ " scores = DNN.evaluate(X_test, Y_test)\n",
+ " \n",
+ " DNN_keras[i][j] = DNN\n",
+ " \n",
+ " print(\"Learning rate = \", eta)\n",
+ " print(\"Lambda = \", lmbd)\n",
+ " print(\"Test accuracy: %.3f\" % scores[1])\n",
+ " print()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "f57a7b70",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "# optional\n",
+ "# visual representation of grid search\n",
+ "# uses seaborn heatmap, could probably do this in matplotlib\n",
+ "import seaborn as sns\n",
+ "\n",
+ "sns.set()\n",
+ "\n",
+ "train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n",
+ "test_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n",
+ "\n",
+ "for i in range(len(eta_vals)):\n",
+ " for j in range(len(lmbd_vals)):\n",
+ " DNN = DNN_keras[i][j]\n",
+ "\n",
+ " train_accuracy[i][j] = DNN.evaluate(X_train, Y_train)[1]\n",
+ " test_accuracy[i][j] = DNN.evaluate(X_test, Y_test)[1]\n",
+ "\n",
+ " \n",
+ "fig, ax = plt.subplots(figsize = (10, 10))\n",
+ "sns.heatmap(train_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n",
+ "ax.set_title(\"Training Accuracy\")\n",
+ "ax.set_ylabel(\"$\\eta$\")\n",
+ "ax.set_xlabel(\"$\\lambda$\")\n",
+ "plt.show()\n",
+ "\n",
+ "fig, ax = plt.subplots(figsize = (10, 10))\n",
+ "sns.heatmap(test_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n",
+ "ax.set_title(\"Test Accuracy\")\n",
+ "ax.set_ylabel(\"$\\eta$\")\n",
+ "ax.set_xlabel(\"$\\lambda$\")\n",
+ "plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a61b50a8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Using Pytorch with the full MNIST data set"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "d220a7ad",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import torch\n",
+ "import torch.nn as nn\n",
+ "import torch.optim as optim\n",
+ "import torchvision\n",
+ "import torchvision.transforms as transforms\n",
+ "\n",
+ "# Device configuration: use GPU if available\n",
+ "device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
+ "\n",
+ "# MNIST dataset (downloads if not already present)\n",
+ "transform = transforms.Compose([\n",
+ " transforms.ToTensor(),\n",
+ " transforms.Normalize((0.5,), (0.5,)) # normalize to mean=0.5, std=0.5 (approx. [-1,1] pixel range)\n",
+ "])\n",
+ "train_dataset = torchvision.datasets.MNIST(root='./data', train=True, download=True, transform=transform)\n",
+ "test_dataset = torchvision.datasets.MNIST(root='./data', train=False, download=True, transform=transform)\n",
+ "\n",
+ "train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=64, shuffle=True)\n",
+ "test_loader = torch.utils.data.DataLoader(test_dataset, batch_size=64, shuffle=False)\n",
+ "\n",
+ "\n",
+ "class NeuralNet(nn.Module):\n",
+ " def __init__(self):\n",
+ " super(NeuralNet, self).__init__()\n",
+ " self.fc1 = nn.Linear(28*28, 100) # first hidden layer (784 -> 100)\n",
+ " self.fc2 = nn.Linear(100, 100) # second hidden layer (100 -> 100)\n",
+ " self.fc3 = nn.Linear(100, 10) # output layer (100 -> 10 classes)\n",
+ " def forward(self, x):\n",
+ " x = x.view(x.size(0), -1) # flatten images into vectors of size 784\n",
+ " x = torch.relu(self.fc1(x)) # hidden layer 1 + ReLU activation\n",
+ " x = torch.relu(self.fc2(x)) # hidden layer 2 + ReLU activation\n",
+ " x = self.fc3(x) # output layer (logits for 10 classes)\n",
+ " return x\n",
+ "\n",
+ "model = NeuralNet().to(device)\n",
+ "\n",
+ "\n",
+ "criterion = nn.CrossEntropyLoss()\n",
+ "optimizer = optim.SGD(model.parameters(), lr=0.01, weight_decay=1e-4)\n",
+ "\n",
+ "num_epochs = 10\n",
+ "for epoch in range(num_epochs):\n",
+ " model.train() # set model to training mode\n",
+ " running_loss = 0.0\n",
+ " for images, labels in train_loader:\n",
+ " # Move data to device (GPU if available, else CPU)\n",
+ " images, labels = images.to(device), labels.to(device)\n",
+ "\n",
+ " optimizer.zero_grad() # reset gradients to zero\n",
+ " outputs = model(images) # forward pass: compute predictions\n",
+ " loss = criterion(outputs, labels) # compute cross-entropy loss\n",
+ " loss.backward() # backpropagate to compute gradients\n",
+ " optimizer.step() # update weights using SGD step \n",
+ "\n",
+ " running_loss += loss.item()\n",
+ " # Compute average loss over all batches in this epoch\n",
+ " avg_loss = running_loss / len(train_loader)\n",
+ " print(f\"Epoch {epoch+1}/{num_epochs}, Loss: {avg_loss:.4f}\")\n",
+ "\n",
+ "#Evaluation on the Test Set\n",
+ "\n",
+ "\n",
+ "\n",
+ "model.eval() # set model to evaluation mode \n",
+ "correct = 0\n",
+ "total = 0\n",
+ "with torch.no_grad(): # disable gradient calculation for evaluation \n",
+ " for images, labels in test_loader:\n",
+ " images, labels = images.to(device), labels.to(device)\n",
+ " outputs = model(images)\n",
+ " _, predicted = torch.max(outputs, dim=1) # class with highest score\n",
+ " total += labels.size(0)\n",
+ " correct += (predicted == labels).sum().item()\n",
+ "\n",
+ "accuracy = 100 * correct / total\n",
+ "print(f\"Test Accuracy: {accuracy:.2f}%\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d87d7514",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## And a similar example using Tensorflow with Keras"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "c6df6115",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "\n",
+ "import tensorflow as tf\n",
+ "from tensorflow import keras\n",
+ "from tensorflow.keras import layers, regularizers\n",
+ "\n",
+ "# Check for GPU (TensorFlow will use it automatically if available)\n",
+ "gpus = tf.config.list_physical_devices('GPU')\n",
+ "print(f\"GPUs available: {gpus}\")\n",
+ "\n",
+ "# 1) Load and preprocess MNIST\n",
+ "(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()\n",
+ "# Normalize to [0, 1]\n",
+ "x_train = (x_train.astype(\"float32\") / 255.0)\n",
+ "x_test = (x_test.astype(\"float32\") / 255.0)\n",
+ "\n",
+ "# 2) Build the model: 784 -> 100 -> 100 -> 10\n",
+ "l2_reg = 1e-4 # L2 regularization strength\n",
+ "\n",
+ "model = keras.Sequential([\n",
+ " layers.Input(shape=(28, 28)),\n",
+ " layers.Flatten(),\n",
+ " layers.Dense(100, activation=\"relu\",\n",
+ " kernel_regularizer=regularizers.l2(l2_reg)),\n",
+ " layers.Dense(100, activation=\"relu\",\n",
+ " kernel_regularizer=regularizers.l2(l2_reg)),\n",
+ " layers.Dense(10, activation=\"softmax\") # output probabilities for 10 classes\n",
+ "])\n",
+ "\n",
+ "# 3) Compile with SGD + weight decay via L2 regularizers\n",
+ "model.compile(\n",
+ " optimizer=keras.optimizers.SGD(learning_rate=0.01),\n",
+ " loss=\"sparse_categorical_crossentropy\",\n",
+ " metrics=[\"accuracy\"],\n",
+ ")\n",
+ "\n",
+ "model.summary()\n",
+ "\n",
+ "# 4) Train\n",
+ "history = model.fit(\n",
+ " x_train, y_train,\n",
+ " epochs=10,\n",
+ " batch_size=64,\n",
+ " validation_split=0.1, # optional: monitor validation during training\n",
+ " verbose=1\n",
+ ")\n",
+ "\n",
+ "# 5) Evaluate on test set\n",
+ "test_loss, test_acc = model.evaluate(x_test, y_test, verbose=0)\n",
+ "print(f\"Test accuracy: {test_acc:.4f}, Test loss: {test_loss:.4f}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5fd4d319",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Building our own neural network code\n",
+ "\n",
+ "Here we present a flexible object oriented codebase\n",
+ "for a feed forward neural network, along with a demonstration of how\n",
+ "to use it. Before we get into the details of the neural network, we\n",
+ "will first present some implementations of various schedulers, cost\n",
+ "functions and activation functions that can be used together with the\n",
+ "neural network.\n",
+ "\n",
+ "The codes here were developed by Eric Reber and Gregor Kajda during spring 2023."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "64134feb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Learning rate methods\n",
+ "\n",
+ "The code below shows object oriented implementations of the Constant,\n",
+ "Momentum, Adagrad, AdagradMomentum, RMS prop and Adam schedulers. All\n",
+ "of the classes belong to the shared abstract Scheduler class, and\n",
+ "share the update_change() and reset() methods allowing for any of the\n",
+ "schedulers to be seamlessly used during the training stage, as will\n",
+ "later be shown in the fit() method of the neural\n",
+ "network. Update_change() only has one parameter, the gradient\n",
+ "($δ^l_ja^{l−1}_k$), and returns the change which will be subtracted\n",
+ "from the weights. The reset() function takes no parameters, and resets\n",
+ "the desired variables. For Constant and Momentum, reset does nothing."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "643f7a82",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "\n",
+ "class Scheduler:\n",
+ " \"\"\"\n",
+ " Abstract class for Schedulers\n",
+ " \"\"\"\n",
+ "\n",
+ " def __init__(self, eta):\n",
+ " self.eta = eta\n",
+ "\n",
+ " # should be overwritten\n",
+ " def update_change(self, gradient):\n",
+ " raise NotImplementedError\n",
+ "\n",
+ " # overwritten if needed\n",
+ " def reset(self):\n",
+ " pass\n",
+ "\n",
+ "\n",
+ "class Constant(Scheduler):\n",
+ " def __init__(self, eta):\n",
+ " super().__init__(eta)\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " return self.eta * gradient\n",
+ " \n",
+ " def reset(self):\n",
+ " pass\n",
+ "\n",
+ "\n",
+ "class Momentum(Scheduler):\n",
+ " def __init__(self, eta: float, momentum: float):\n",
+ " super().__init__(eta)\n",
+ " self.momentum = momentum\n",
+ " self.change = 0\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " self.change = self.momentum * self.change + self.eta * gradient\n",
+ " return self.change\n",
+ "\n",
+ " def reset(self):\n",
+ " pass\n",
+ "\n",
+ "\n",
+ "class Adagrad(Scheduler):\n",
+ " def __init__(self, eta):\n",
+ " super().__init__(eta)\n",
+ " self.G_t = None\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " delta = 1e-8 # avoid division ny zero\n",
+ "\n",
+ " if self.G_t is None:\n",
+ " self.G_t = np.zeros((gradient.shape[0], gradient.shape[0]))\n",
+ "\n",
+ " self.G_t += gradient @ gradient.T\n",
+ "\n",
+ " G_t_inverse = 1 / (\n",
+ " delta + np.sqrt(np.reshape(np.diagonal(self.G_t), (self.G_t.shape[0], 1)))\n",
+ " )\n",
+ " return self.eta * gradient * G_t_inverse\n",
+ "\n",
+ " def reset(self):\n",
+ " self.G_t = None\n",
+ "\n",
+ "\n",
+ "class AdagradMomentum(Scheduler):\n",
+ " def __init__(self, eta, momentum):\n",
+ " super().__init__(eta)\n",
+ " self.G_t = None\n",
+ " self.momentum = momentum\n",
+ " self.change = 0\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " delta = 1e-8 # avoid division ny zero\n",
+ "\n",
+ " if self.G_t is None:\n",
+ " self.G_t = np.zeros((gradient.shape[0], gradient.shape[0]))\n",
+ "\n",
+ " self.G_t += gradient @ gradient.T\n",
+ "\n",
+ " G_t_inverse = 1 / (\n",
+ " delta + np.sqrt(np.reshape(np.diagonal(self.G_t), (self.G_t.shape[0], 1)))\n",
+ " )\n",
+ " self.change = self.change * self.momentum + self.eta * gradient * G_t_inverse\n",
+ " return self.change\n",
+ "\n",
+ " def reset(self):\n",
+ " self.G_t = None\n",
+ "\n",
+ "\n",
+ "class RMS_prop(Scheduler):\n",
+ " def __init__(self, eta, rho):\n",
+ " super().__init__(eta)\n",
+ " self.rho = rho\n",
+ " self.second = 0.0\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " delta = 1e-8 # avoid division ny zero\n",
+ " self.second = self.rho * self.second + (1 - self.rho) * gradient * gradient\n",
+ " return self.eta * gradient / (np.sqrt(self.second + delta))\n",
+ "\n",
+ " def reset(self):\n",
+ " self.second = 0.0\n",
+ "\n",
+ "\n",
+ "class Adam(Scheduler):\n",
+ " def __init__(self, eta, rho, rho2):\n",
+ " super().__init__(eta)\n",
+ " self.rho = rho\n",
+ " self.rho2 = rho2\n",
+ " self.moment = 0\n",
+ " self.second = 0\n",
+ " self.n_epochs = 1\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " delta = 1e-8 # avoid division ny zero\n",
+ "\n",
+ " self.moment = self.rho * self.moment + (1 - self.rho) * gradient\n",
+ " self.second = self.rho2 * self.second + (1 - self.rho2) * gradient * gradient\n",
+ "\n",
+ " moment_corrected = self.moment / (1 - self.rho**self.n_epochs)\n",
+ " second_corrected = self.second / (1 - self.rho2**self.n_epochs)\n",
+ "\n",
+ " return self.eta * moment_corrected / (np.sqrt(second_corrected + delta))\n",
+ "\n",
+ " def reset(self):\n",
+ " self.n_epochs += 1\n",
+ " self.moment = 0\n",
+ " self.second = 0"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "dfa32b7e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Usage of the above learning rate schedulers\n",
+ "\n",
+ "To initalize a scheduler, simply create the object and pass in the\n",
+ "necessary parameters such as the learning rate and the momentum as\n",
+ "shown below. As the Scheduler class is an abstract class it should not\n",
+ "called directly, and will raise an error upon usage."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "id": "4b88b24e",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "momentum_scheduler = Momentum(eta=1e-3, momentum=0.9)\n",
+ "adam_scheduler = Adam(eta=1e-3, rho=0.9, rho2=0.999)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2eea0e52",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Here is a small example for how a segment of code using schedulers\n",
+ "could look. Switching out the schedulers is simple."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "id": "090bee3c",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "weights = np.ones((3,3))\n",
+ "print(f\"Before scheduler:\\n{weights=}\")\n",
+ "\n",
+ "epochs = 10\n",
+ "for e in range(epochs):\n",
+ " gradient = np.random.rand(3, 3)\n",
+ " change = adam_scheduler.update_change(gradient)\n",
+ " weights = weights - change\n",
+ " adam_scheduler.reset()\n",
+ "\n",
+ "print(f\"\\nAfter scheduler:\\n{weights=}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e0eee286",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Cost functions\n",
+ "\n",
+ "Here we discuss cost functions that can be used when creating the\n",
+ "neural network. Every cost function takes the target vector as its\n",
+ "parameter, and returns a function valued only at $x$ such that it may\n",
+ "easily be differentiated."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "id": "191224bb",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "\n",
+ "def CostOLS(target):\n",
+ " \n",
+ " def func(X):\n",
+ " return (1.0 / target.shape[0]) * np.sum((target - X) ** 2)\n",
+ "\n",
+ " return func\n",
+ "\n",
+ "\n",
+ "def CostLogReg(target):\n",
+ "\n",
+ " def func(X):\n",
+ " \n",
+ " return -(1.0 / target.shape[0]) * np.sum(\n",
+ " (target * np.log(X + 10e-10)) + ((1 - target) * np.log(1 - X + 10e-10))\n",
+ " )\n",
+ "\n",
+ " return func\n",
+ "\n",
+ "\n",
+ "def CostCrossEntropy(target):\n",
+ " \n",
+ " def func(X):\n",
+ " return -(1.0 / target.size) * np.sum(target * np.log(X + 10e-10))\n",
+ "\n",
+ " return func"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7f4a0238",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Below we give a short example of how these cost function may be used\n",
+ "to obtain results if you wish to test them out on your own using\n",
+ "AutoGrad's automatics differentiation."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "id": "d822b656",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from autograd import grad\n",
+ "\n",
+ "target = np.array([[1, 2, 3]]).T\n",
+ "a = np.array([[4, 5, 6]]).T\n",
+ "\n",
+ "cost_func = CostCrossEntropy\n",
+ "cost_func_derivative = grad(cost_func(target))\n",
+ "\n",
+ "valued_at_a = cost_func_derivative(a)\n",
+ "print(f\"Derivative of cost function {cost_func.__name__} valued at a:\\n{valued_at_a}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7ff32a3b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Activation functions\n",
+ "\n",
+ "Finally, before we look at the neural network, we will look at the\n",
+ "activation functions which can be specified between the hidden layers\n",
+ "and as the output function. Each function can be valued for any given\n",
+ "vector or matrix X, and can be differentiated via derivate()."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "id": "90045474",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import elementwise_grad\n",
+ "\n",
+ "def identity(X):\n",
+ " return X\n",
+ "\n",
+ "\n",
+ "def sigmoid(X):\n",
+ " try:\n",
+ " return 1.0 / (1 + np.exp(-X))\n",
+ " except FloatingPointError:\n",
+ " return np.where(X > np.zeros(X.shape), np.ones(X.shape), np.zeros(X.shape))\n",
+ "\n",
+ "\n",
+ "def softmax(X):\n",
+ " X = X - np.max(X, axis=-1, keepdims=True)\n",
+ " delta = 10e-10\n",
+ " return np.exp(X) / (np.sum(np.exp(X), axis=-1, keepdims=True) + delta)\n",
+ "\n",
+ "\n",
+ "def RELU(X):\n",
+ " return np.where(X > np.zeros(X.shape), X, np.zeros(X.shape))\n",
+ "\n",
+ "\n",
+ "def LRELU(X):\n",
+ " delta = 10e-4\n",
+ " return np.where(X > np.zeros(X.shape), X, delta * X)\n",
+ "\n",
+ "\n",
+ "def derivate(func):\n",
+ " if func.__name__ == \"RELU\":\n",
+ "\n",
+ " def func(X):\n",
+ " return np.where(X > 0, 1, 0)\n",
+ "\n",
+ " return func\n",
+ "\n",
+ " elif func.__name__ == \"LRELU\":\n",
+ "\n",
+ " def func(X):\n",
+ " delta = 10e-4\n",
+ " return np.where(X > 0, 1, delta)\n",
+ "\n",
+ " return func\n",
+ "\n",
+ " else:\n",
+ " return elementwise_grad(func)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "eec681dc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Below follows a short demonstration of how to use an activation\n",
+ "function. The derivative of the activation function will be important\n",
+ "when calculating the output delta term during backpropagation. Note\n",
+ "that derivate() can also be used for cost functions for a more\n",
+ "generalized approach."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "id": "a36d4506",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "z = np.array([[4, 5, 6]]).T\n",
+ "print(f\"Input to activation function:\\n{z}\")\n",
+ "\n",
+ "act_func = sigmoid\n",
+ "a = act_func(z)\n",
+ "print(f\"\\nOutput from {act_func.__name__} activation function:\\n{a}\")\n",
+ "\n",
+ "act_func_derivative = derivate(act_func)\n",
+ "valued_at_z = act_func_derivative(a)\n",
+ "print(f\"\\nDerivative of {act_func.__name__} activation function valued at z:\\n{valued_at_z}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d2358581",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### The Neural Network\n",
+ "\n",
+ "Now that we have gotten a good understanding of the implementation of\n",
+ "some important components, we can take a look at an object oriented\n",
+ "implementation of a feed forward neural network. The feed forward\n",
+ "neural network has been implemented as a class named FFNN, which can\n",
+ "be initiated as a regressor or classifier dependant on the choice of\n",
+ "cost function. The FFNN can have any number of input nodes, hidden\n",
+ "layers with any amount of hidden nodes, and any amount of output nodes\n",
+ "meaning it can perform multiclass classification as well as binary\n",
+ "classification and regression problems. Although there is a lot of\n",
+ "code present, it makes for an easy to use and generalizeable interface\n",
+ "for creating many types of neural networks as will be demonstrated\n",
+ "below."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "id": "9dd0b112",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import math\n",
+ "import autograd.numpy as np\n",
+ "import sys\n",
+ "import warnings\n",
+ "from autograd import grad, elementwise_grad\n",
+ "from random import random, seed\n",
+ "from copy import deepcopy, copy\n",
+ "from typing import Tuple, Callable\n",
+ "from sklearn.utils import resample\n",
+ "\n",
+ "warnings.simplefilter(\"error\")\n",
+ "\n",
+ "\n",
+ "class FFNN:\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Feed Forward Neural Network with interface enabling flexible design of a\n",
+ " nerual networks architecture and the specification of activation function\n",
+ " in the hidden layers and output layer respectively. This model can be used\n",
+ " for both regression and classification problems, depending on the output function.\n",
+ "\n",
+ " Attributes:\n",
+ " ------------\n",
+ " I dimensions (tuple[int]): A list of positive integers, which specifies the\n",
+ " number of nodes in each of the networks layers. The first integer in the array\n",
+ " defines the number of nodes in the input layer, the second integer defines number\n",
+ " of nodes in the first hidden layer and so on until the last number, which\n",
+ " specifies the number of nodes in the output layer.\n",
+ " II hidden_func (Callable): The activation function for the hidden layers\n",
+ " III output_func (Callable): The activation function for the output layer\n",
+ " IV cost_func (Callable): Our cost function\n",
+ " V seed (int): Sets random seed, makes results reproducible\n",
+ " \"\"\"\n",
+ "\n",
+ " def __init__(\n",
+ " self,\n",
+ " dimensions: tuple[int],\n",
+ " hidden_func: Callable = sigmoid,\n",
+ " output_func: Callable = lambda x: x,\n",
+ " cost_func: Callable = CostOLS,\n",
+ " seed: int = None,\n",
+ " ):\n",
+ " self.dimensions = dimensions\n",
+ " self.hidden_func = hidden_func\n",
+ " self.output_func = output_func\n",
+ " self.cost_func = cost_func\n",
+ " self.seed = seed\n",
+ " self.weights = list()\n",
+ " self.schedulers_weight = list()\n",
+ " self.schedulers_bias = list()\n",
+ " self.a_matrices = list()\n",
+ " self.z_matrices = list()\n",
+ " self.classification = None\n",
+ "\n",
+ " self.reset_weights()\n",
+ " self._set_classification()\n",
+ "\n",
+ " def fit(\n",
+ " self,\n",
+ " X: np.ndarray,\n",
+ " t: np.ndarray,\n",
+ " scheduler: Scheduler,\n",
+ " batches: int = 1,\n",
+ " epochs: int = 100,\n",
+ " lam: float = 0,\n",
+ " X_val: np.ndarray = None,\n",
+ " t_val: np.ndarray = None,\n",
+ " ):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " This function performs the training the neural network by performing the feedforward and backpropagation\n",
+ " algorithm to update the networks weights.\n",
+ "\n",
+ " Parameters:\n",
+ " ------------\n",
+ " I X (np.ndarray) : training data\n",
+ " II t (np.ndarray) : target data\n",
+ " III scheduler (Scheduler) : specified scheduler (algorithm for optimization of gradient descent)\n",
+ " IV scheduler_args (list[int]) : list of all arguments necessary for scheduler\n",
+ "\n",
+ " Optional Parameters:\n",
+ " ------------\n",
+ " V batches (int) : number of batches the datasets are split into, default equal to 1\n",
+ " VI epochs (int) : number of iterations used to train the network, default equal to 100\n",
+ " VII lam (float) : regularization hyperparameter lambda\n",
+ " VIII X_val (np.ndarray) : validation set\n",
+ " IX t_val (np.ndarray) : validation target set\n",
+ "\n",
+ " Returns:\n",
+ " ------------\n",
+ " I scores (dict) : A dictionary containing the performance metrics of the model.\n",
+ " The number of the metrics depends on the parameters passed to the fit-function.\n",
+ "\n",
+ " \"\"\"\n",
+ "\n",
+ " # setup \n",
+ " if self.seed is not None:\n",
+ " np.random.seed(self.seed)\n",
+ "\n",
+ " val_set = False\n",
+ " if X_val is not None and t_val is not None:\n",
+ " val_set = True\n",
+ "\n",
+ " # creating arrays for score metrics\n",
+ " train_errors = np.empty(epochs)\n",
+ " train_errors.fill(np.nan)\n",
+ " val_errors = np.empty(epochs)\n",
+ " val_errors.fill(np.nan)\n",
+ "\n",
+ " train_accs = np.empty(epochs)\n",
+ " train_accs.fill(np.nan)\n",
+ " val_accs = np.empty(epochs)\n",
+ " val_accs.fill(np.nan)\n",
+ "\n",
+ " self.schedulers_weight = list()\n",
+ " self.schedulers_bias = list()\n",
+ "\n",
+ " batch_size = X.shape[0] // batches\n",
+ "\n",
+ " X, t = resample(X, t)\n",
+ "\n",
+ " # this function returns a function valued only at X\n",
+ " cost_function_train = self.cost_func(t)\n",
+ " if val_set:\n",
+ " cost_function_val = self.cost_func(t_val)\n",
+ "\n",
+ " # create schedulers for each weight matrix\n",
+ " for i in range(len(self.weights)):\n",
+ " self.schedulers_weight.append(copy(scheduler))\n",
+ " self.schedulers_bias.append(copy(scheduler))\n",
+ "\n",
+ " print(f\"{scheduler.__class__.__name__}: Eta={scheduler.eta}, Lambda={lam}\")\n",
+ "\n",
+ " try:\n",
+ " for e in range(epochs):\n",
+ " for i in range(batches):\n",
+ " # allows for minibatch gradient descent\n",
+ " if i == batches - 1:\n",
+ " # If the for loop has reached the last batch, take all thats left\n",
+ " X_batch = X[i * batch_size :, :]\n",
+ " t_batch = t[i * batch_size :, :]\n",
+ " else:\n",
+ " X_batch = X[i * batch_size : (i + 1) * batch_size, :]\n",
+ " t_batch = t[i * batch_size : (i + 1) * batch_size, :]\n",
+ "\n",
+ " self._feedforward(X_batch)\n",
+ " self._backpropagate(X_batch, t_batch, lam)\n",
+ "\n",
+ " # reset schedulers for each epoch (some schedulers pass in this call)\n",
+ " for scheduler in self.schedulers_weight:\n",
+ " scheduler.reset()\n",
+ "\n",
+ " for scheduler in self.schedulers_bias:\n",
+ " scheduler.reset()\n",
+ "\n",
+ " # computing performance metrics\n",
+ " pred_train = self.predict(X)\n",
+ " train_error = cost_function_train(pred_train)\n",
+ "\n",
+ " train_errors[e] = train_error\n",
+ " if val_set:\n",
+ " \n",
+ " pred_val = self.predict(X_val)\n",
+ " val_error = cost_function_val(pred_val)\n",
+ " val_errors[e] = val_error\n",
+ "\n",
+ " if self.classification:\n",
+ " train_acc = self._accuracy(self.predict(X), t)\n",
+ " train_accs[e] = train_acc\n",
+ " if val_set:\n",
+ " val_acc = self._accuracy(pred_val, t_val)\n",
+ " val_accs[e] = val_acc\n",
+ "\n",
+ " # printing progress bar\n",
+ " progression = e / epochs\n",
+ " print_length = self._progress_bar(\n",
+ " progression,\n",
+ " train_error=train_errors[e],\n",
+ " train_acc=train_accs[e],\n",
+ " val_error=val_errors[e],\n",
+ " val_acc=val_accs[e],\n",
+ " )\n",
+ " except KeyboardInterrupt:\n",
+ " # allows for stopping training at any point and seeing the result\n",
+ " pass\n",
+ "\n",
+ " # visualization of training progression (similiar to tensorflow progression bar)\n",
+ " sys.stdout.write(\"\\r\" + \" \" * print_length)\n",
+ " sys.stdout.flush()\n",
+ " self._progress_bar(\n",
+ " 1,\n",
+ " train_error=train_errors[e],\n",
+ " train_acc=train_accs[e],\n",
+ " val_error=val_errors[e],\n",
+ " val_acc=val_accs[e],\n",
+ " )\n",
+ " sys.stdout.write(\"\")\n",
+ "\n",
+ " # return performance metrics for the entire run\n",
+ " scores = dict()\n",
+ "\n",
+ " scores[\"train_errors\"] = train_errors\n",
+ "\n",
+ " if val_set:\n",
+ " scores[\"val_errors\"] = val_errors\n",
+ "\n",
+ " if self.classification:\n",
+ " scores[\"train_accs\"] = train_accs\n",
+ "\n",
+ " if val_set:\n",
+ " scores[\"val_accs\"] = val_accs\n",
+ "\n",
+ " return scores\n",
+ "\n",
+ " def predict(self, X: np.ndarray, *, threshold=0.5):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Performs prediction after training of the network has been finished.\n",
+ "\n",
+ " Parameters:\n",
+ " ------------\n",
+ " I X (np.ndarray): The design matrix, with n rows of p features each\n",
+ "\n",
+ " Optional Parameters:\n",
+ " ------------\n",
+ " II threshold (float) : sets minimal value for a prediction to be predicted as the positive class\n",
+ " in classification problems\n",
+ "\n",
+ " Returns:\n",
+ " ------------\n",
+ " I z (np.ndarray): A prediction vector (row) for each row in our design matrix\n",
+ " This vector is thresholded if regression=False, meaning that classification results\n",
+ " in a vector of 1s and 0s, while regressions in an array of decimal numbers\n",
+ "\n",
+ " \"\"\"\n",
+ "\n",
+ " predict = self._feedforward(X)\n",
+ "\n",
+ " if self.classification:\n",
+ " return np.where(predict > threshold, 1, 0)\n",
+ " else:\n",
+ " return predict\n",
+ "\n",
+ " def reset_weights(self):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Resets/Reinitializes the weights in order to train the network for a new problem.\n",
+ "\n",
+ " \"\"\"\n",
+ " if self.seed is not None:\n",
+ " np.random.seed(self.seed)\n",
+ "\n",
+ " self.weights = list()\n",
+ " for i in range(len(self.dimensions) - 1):\n",
+ " weight_array = np.random.randn(\n",
+ " self.dimensions[i] + 1, self.dimensions[i + 1]\n",
+ " )\n",
+ " weight_array[0, :] = np.random.randn(self.dimensions[i + 1]) * 0.01\n",
+ "\n",
+ " self.weights.append(weight_array)\n",
+ "\n",
+ " def _feedforward(self, X: np.ndarray):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Calculates the activation of each layer starting at the input and ending at the output.\n",
+ " Each following activation is calculated from a weighted sum of each of the preceeding\n",
+ " activations (except in the case of the input layer).\n",
+ "\n",
+ " Parameters:\n",
+ " ------------\n",
+ " I X (np.ndarray): The design matrix, with n rows of p features each\n",
+ "\n",
+ " Returns:\n",
+ " ------------\n",
+ " I z (np.ndarray): A prediction vector (row) for each row in our design matrix\n",
+ " \"\"\"\n",
+ "\n",
+ " # reset matrices\n",
+ " self.a_matrices = list()\n",
+ " self.z_matrices = list()\n",
+ "\n",
+ " # if X is just a vector, make it into a matrix\n",
+ " if len(X.shape) == 1:\n",
+ " X = X.reshape((1, X.shape[0]))\n",
+ "\n",
+ " # Add a coloumn of zeros as the first coloumn of the design matrix, in order\n",
+ " # to add bias to our data\n",
+ " bias = np.ones((X.shape[0], 1)) * 0.01\n",
+ " X = np.hstack([bias, X])\n",
+ "\n",
+ " # a^0, the nodes in the input layer (one a^0 for each row in X - where the\n",
+ " # exponent indicates layer number).\n",
+ " a = X\n",
+ " self.a_matrices.append(a)\n",
+ " self.z_matrices.append(a)\n",
+ "\n",
+ " # The feed forward algorithm\n",
+ " for i in range(len(self.weights)):\n",
+ " if i < len(self.weights) - 1:\n",
+ " z = a @ self.weights[i]\n",
+ " self.z_matrices.append(z)\n",
+ " a = self.hidden_func(z)\n",
+ " # bias column again added to the data here\n",
+ " bias = np.ones((a.shape[0], 1)) * 0.01\n",
+ " a = np.hstack([bias, a])\n",
+ " self.a_matrices.append(a)\n",
+ " else:\n",
+ " try:\n",
+ " # a^L, the nodes in our output layers\n",
+ " z = a @ self.weights[i]\n",
+ " a = self.output_func(z)\n",
+ " self.a_matrices.append(a)\n",
+ " self.z_matrices.append(z)\n",
+ " except Exception as OverflowError:\n",
+ " print(\n",
+ " \"OverflowError in fit() in FFNN\\nHOW TO DEBUG ERROR: Consider lowering your learning rate or scheduler specific parameters such as momentum, or check if your input values need scaling\"\n",
+ " )\n",
+ "\n",
+ " # this will be a^L\n",
+ " return a\n",
+ "\n",
+ " def _backpropagate(self, X, t, lam):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Performs the backpropagation algorithm. In other words, this method\n",
+ " calculates the gradient of all the layers starting at the\n",
+ " output layer, and moving from right to left accumulates the gradient until\n",
+ " the input layer is reached. Each layers respective weights are updated while\n",
+ " the algorithm propagates backwards from the output layer (auto-differentation in reverse mode).\n",
+ "\n",
+ " Parameters:\n",
+ " ------------\n",
+ " I X (np.ndarray): The design matrix, with n rows of p features each.\n",
+ " II t (np.ndarray): The target vector, with n rows of p targets.\n",
+ " III lam (float32): regularization parameter used to punish the weights in case of overfitting\n",
+ "\n",
+ " Returns:\n",
+ " ------------\n",
+ " No return value.\n",
+ "\n",
+ " \"\"\"\n",
+ " out_derivative = derivate(self.output_func)\n",
+ " hidden_derivative = derivate(self.hidden_func)\n",
+ "\n",
+ " for i in range(len(self.weights) - 1, -1, -1):\n",
+ " # delta terms for output\n",
+ " if i == len(self.weights) - 1:\n",
+ " # for multi-class classification\n",
+ " if (\n",
+ " self.output_func.__name__ == \"softmax\"\n",
+ " ):\n",
+ " delta_matrix = self.a_matrices[i + 1] - t\n",
+ " # for single class classification\n",
+ " else:\n",
+ " cost_func_derivative = grad(self.cost_func(t))\n",
+ " delta_matrix = out_derivative(\n",
+ " self.z_matrices[i + 1]\n",
+ " ) * cost_func_derivative(self.a_matrices[i + 1])\n",
+ "\n",
+ " # delta terms for hidden layer\n",
+ " else:\n",
+ " delta_matrix = (\n",
+ " self.weights[i + 1][1:, :] @ delta_matrix.T\n",
+ " ).T * hidden_derivative(self.z_matrices[i + 1])\n",
+ "\n",
+ " # calculate gradient\n",
+ " gradient_weights = self.a_matrices[i][:, 1:].T @ delta_matrix\n",
+ " gradient_bias = np.sum(delta_matrix, axis=0).reshape(\n",
+ " 1, delta_matrix.shape[1]\n",
+ " )\n",
+ "\n",
+ " # regularization term\n",
+ " gradient_weights += self.weights[i][1:, :] * lam\n",
+ "\n",
+ " # use scheduler\n",
+ " update_matrix = np.vstack(\n",
+ " [\n",
+ " self.schedulers_bias[i].update_change(gradient_bias),\n",
+ " self.schedulers_weight[i].update_change(gradient_weights),\n",
+ " ]\n",
+ " )\n",
+ "\n",
+ " # update weights and bias\n",
+ " self.weights[i] -= update_matrix\n",
+ "\n",
+ " def _accuracy(self, prediction: np.ndarray, target: np.ndarray):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Calculates accuracy of given prediction to target\n",
+ "\n",
+ " Parameters:\n",
+ " ------------\n",
+ " I prediction (np.ndarray): vector of predicitons output network\n",
+ " (1s and 0s in case of classification, and real numbers in case of regression)\n",
+ " II target (np.ndarray): vector of true values (What the network ideally should predict)\n",
+ "\n",
+ " Returns:\n",
+ " ------------\n",
+ " A floating point number representing the percentage of correctly classified instances.\n",
+ " \"\"\"\n",
+ " assert prediction.size == target.size\n",
+ " return np.average((target == prediction))\n",
+ " def _set_classification(self):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Decides if FFNN acts as classifier (True) og regressor (False),\n",
+ " sets self.classification during init()\n",
+ " \"\"\"\n",
+ " self.classification = False\n",
+ " if (\n",
+ " self.cost_func.__name__ == \"CostLogReg\"\n",
+ " or self.cost_func.__name__ == \"CostCrossEntropy\"\n",
+ " ):\n",
+ " self.classification = True\n",
+ "\n",
+ " def _progress_bar(self, progression, **kwargs):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Displays progress of training\n",
+ " \"\"\"\n",
+ " print_length = 40\n",
+ " num_equals = int(progression * print_length)\n",
+ " num_not = print_length - num_equals\n",
+ " arrow = \">\" if num_equals > 0 else \"\"\n",
+ " bar = \"[\" + \"=\" * (num_equals - 1) + arrow + \"-\" * num_not + \"]\"\n",
+ " perc_print = self._format(progression * 100, decimals=5)\n",
+ " line = f\" {bar} {perc_print}% \"\n",
+ "\n",
+ " for key in kwargs:\n",
+ " if not np.isnan(kwargs[key]):\n",
+ " value = self._format(kwargs[key], decimals=4)\n",
+ " line += f\"| {key}: {value} \"\n",
+ " sys.stdout.write(\"\\r\" + line)\n",
+ " sys.stdout.flush()\n",
+ " return len(line)\n",
+ "\n",
+ " def _format(self, value, decimals=4):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Formats decimal numbers for progress bar\n",
+ " \"\"\"\n",
+ " if value > 0:\n",
+ " v = value\n",
+ " elif value < 0:\n",
+ " v = -10 * value\n",
+ " else:\n",
+ " v = 1\n",
+ " n = 1 + math.floor(math.log10(v))\n",
+ " if n >= decimals - 1:\n",
+ " return str(round(value))\n",
+ " return f\"{value:.{decimals-n-1}f}\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b5aaa66b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Before we make a model, we will quickly generate a dataset we can use\n",
+ "for our linear regression problem as shown below"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "id": "35f13536",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from sklearn.model_selection import train_test_split\n",
+ "\n",
+ "def SkrankeFunction(x, y):\n",
+ " return np.ravel(0 + 1*x + 2*y + 3*x**2 + 4*x*y + 5*y**2)\n",
+ "\n",
+ "def create_X(x, y, n):\n",
+ " if len(x.shape) > 1:\n",
+ " x = np.ravel(x)\n",
+ " y = np.ravel(y)\n",
+ "\n",
+ " N = len(x)\n",
+ " l = int((n + 1) * (n + 2) / 2) # Number of elements in beta\n",
+ " X = np.ones((N, l))\n",
+ "\n",
+ " for i in range(1, n + 1):\n",
+ " q = int((i) * (i + 1) / 2)\n",
+ " for k in range(i + 1):\n",
+ " X[:, q + k] = (x ** (i - k)) * (y**k)\n",
+ "\n",
+ " return X\n",
+ "\n",
+ "step=0.5\n",
+ "x = np.arange(0, 1, step)\n",
+ "y = np.arange(0, 1, step)\n",
+ "x, y = np.meshgrid(x, y)\n",
+ "target = SkrankeFunction(x, y)\n",
+ "target = target.reshape(target.shape[0], 1)\n",
+ "\n",
+ "poly_degree=3\n",
+ "X = create_X(x, y, poly_degree)\n",
+ "\n",
+ "X_train, X_test, t_train, t_test = train_test_split(X, target)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "12780998",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Now that we have our dataset ready for the regression, we can create\n",
+ "our regressor. Note that with the seed parameter, we can make sure our\n",
+ "results stay the same every time we run the neural network. For\n",
+ "inititialization, we simply specify the dimensions (we wish the amount\n",
+ "of input nodes to be equal to the datapoints, and the output to\n",
+ "predict one value)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "id": "3de4263c",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "input_nodes = X_train.shape[1]\n",
+ "output_nodes = 1\n",
+ "\n",
+ "linear_regression = FFNN((input_nodes, output_nodes), output_func=identity, cost_func=CostOLS, seed=2023)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e3ca1fb5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "We then fit our model with our training data using the scheduler of our choice."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "id": "714229a9",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "linear_regression.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "\n",
+ "scheduler = Constant(eta=1e-3)\n",
+ "scores = linear_regression.fit(X_train, t_train, scheduler)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2240c6b8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Due to the progress bar we can see the MSE (train_error) throughout\n",
+ "the FFNN's training. Note that the fit() function has some optional\n",
+ "parameters with defualt arguments. For example, the regularization\n",
+ "hyperparameter can be left ignored if not needed, and equally the FFNN\n",
+ "will by default run for 100 epochs. These can easily be changed, such\n",
+ "as for example:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "id": "96f9f1ab",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "linear_regression.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "\n",
+ "scores = linear_regression.fit(X_train, t_train, scheduler, lam=1e-4, epochs=1000)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "21af3f64",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "We see that given more epochs to train on, the regressor reaches a lower MSE.\n",
+ "\n",
+ "Let us then switch to a binary classification. We use a binary\n",
+ "classification dataset, and follow a similar setup to the regression\n",
+ "case."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "id": "98f0055d",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from sklearn.datasets import load_breast_cancer\n",
+ "from sklearn.preprocessing import MinMaxScaler\n",
+ "\n",
+ "wisconsin = load_breast_cancer()\n",
+ "X = wisconsin.data\n",
+ "target = wisconsin.target\n",
+ "target = target.reshape(target.shape[0], 1)\n",
+ "\n",
+ "X_train, X_val, t_train, t_val = train_test_split(X, target)\n",
+ "\n",
+ "scaler = MinMaxScaler()\n",
+ "scaler.fit(X_train)\n",
+ "X_train = scaler.transform(X_train)\n",
+ "X_val = scaler.transform(X_val)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "id": "fbd2675f",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "input_nodes = X_train.shape[1]\n",
+ "output_nodes = 1\n",
+ "\n",
+ "logistic_regression = FFNN((input_nodes, output_nodes), output_func=sigmoid, cost_func=CostLogReg, seed=2023)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "64ed3461",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "We will now make use of our validation data by passing it into our fit function as a keyword argument"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "id": "1cdc9d23",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "logistic_regression.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "\n",
+ "scheduler = Adam(eta=1e-3, rho=0.9, rho2=0.999)\n",
+ "scores = logistic_regression.fit(X_train, t_train, scheduler, epochs=1000, X_val=X_val, t_val=t_val)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "13e2f881",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Finally, we will create a neural network with 2 hidden layers with activation functions."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "id": "c28f2181",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "input_nodes = X_train.shape[1]\n",
+ "hidden_nodes1 = 100\n",
+ "hidden_nodes2 = 30\n",
+ "output_nodes = 1\n",
+ "\n",
+ "dims = (input_nodes, hidden_nodes1, hidden_nodes2, output_nodes)\n",
+ "\n",
+ "neural_network = FFNN(dims, hidden_func=RELU, output_func=sigmoid, cost_func=CostLogReg, seed=2023)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "id": "3150b724",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "neural_network.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "\n",
+ "scheduler = Adam(eta=1e-4, rho=0.9, rho2=0.999)\n",
+ "scores = neural_network.fit(X_train, t_train, scheduler, epochs=1000, X_val=X_val, t_val=t_val)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "17aebab2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Multiclass classification\n",
+ "\n",
+ "Finally, we will demonstrate the use case of multiclass classification\n",
+ "using our FFNN with the famous MNIST dataset, which contain images of\n",
+ "digits between the range of 0 to 9."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "id": "997c5001",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from sklearn.datasets import load_digits\n",
+ "\n",
+ "def onehot(target: np.ndarray):\n",
+ " onehot = np.zeros((target.size, target.max() + 1))\n",
+ " onehot[np.arange(target.size), target] = 1\n",
+ " return onehot\n",
+ "\n",
+ "digits = load_digits()\n",
+ "\n",
+ "X = digits.data\n",
+ "target = digits.target\n",
+ "target = onehot(target)\n",
+ "\n",
+ "input_nodes = 64\n",
+ "hidden_nodes1 = 100\n",
+ "hidden_nodes2 = 30\n",
+ "output_nodes = 10\n",
+ "\n",
+ "dims = (input_nodes, hidden_nodes1, hidden_nodes2, output_nodes)\n",
+ "\n",
+ "multiclass = FFNN(dims, hidden_func=LRELU, output_func=softmax, cost_func=CostCrossEntropy)\n",
+ "\n",
+ "multiclass.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "\n",
+ "scheduler = Adam(eta=1e-4, rho=0.9, rho2=0.999)\n",
+ "scores = multiclass.fit(X, target, scheduler, epochs=1000)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "43d805bc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Testing the XOR gate and other gates\n",
+ "\n",
+ "Let us now use our code to test the XOR gate."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "id": "4bbaf697",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "X = np.array([ [0, 0], [0, 1], [1, 0],[1, 1]],dtype=np.float64)\n",
+ "\n",
+ "# The XOR gate\n",
+ "yXOR = np.array( [[ 0], [1] ,[1], [0]])\n",
+ "\n",
+ "input_nodes = X.shape[1]\n",
+ "output_nodes = 1\n",
+ "\n",
+ "logistic_regression = FFNN((input_nodes, output_nodes), output_func=sigmoid, cost_func=CostLogReg, seed=2023)\n",
+ "logistic_regression.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "scheduler = Adam(eta=1e-1, rho=0.9, rho2=0.999)\n",
+ "scores = logistic_regression.fit(X, yXOR, scheduler, epochs=1000)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "31e852a7",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Not bad, but the results depend strongly on the learning reate. Try different learning rates."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9792c0c3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Solving differential equations with Deep Learning\n",
+ "\n",
+ "The Universal Approximation Theorem states that a neural network can\n",
+ "approximate any function at a single hidden layer along with one input\n",
+ "and output layer to any given precision.\n",
+ "\n",
+ "**Book on solving differential equations with ML methods.**\n",
+ "\n",
+ "[An Introduction to Neural Network Methods for Differential Equations](https://www.springer.com/gp/book/9789401798150), by Yadav and Kumar.\n",
+ "\n",
+ "**Physics informed neural networks.**\n",
+ "\n",
+ "[Scientific Machine Learning Through Physics–Informed Neural Networks: Where we are and What’s Next](https://link.springer.com/article/10.1007/s10915-022-01939-z), by Cuomo et al\n",
+ "\n",
+ "**Thanks to Kristine Baluka Hein.**\n",
+ "\n",
+ "The lectures on differential equations were developed by Kristine Baluka Hein, now PhD student at IFI.\n",
+ "A great thanks to Kristine."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9214a407",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Ordinary Differential Equations first\n",
+ "\n",
+ "An ordinary differential equation (ODE) is an equation involving functions having one variable.\n",
+ "\n",
+ "In general, an ordinary differential equation looks like"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "40a78c33",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{ode} \\tag{1}\n",
+ "f\\left(x, \\, g(x), \\, g'(x), \\, g''(x), \\, \\dots \\, , \\, g^{(n)}(x)\\right) = 0\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "42dae561",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $g(x)$ is the function to find, and $g^{(n)}(x)$ is the $n$-th derivative of $g(x)$.\n",
+ "\n",
+ "The $f\\left(x, g(x), g'(x), g''(x), \\, \\dots \\, , g^{(n)}(x)\\right)$ is just a way to write that there is an expression involving $x$ and $g(x), \\ g'(x), \\ g''(x), \\, \\dots \\, , \\text{ and } g^{(n)}(x)$ on the left side of the equality sign in ([1](#ode)).\n",
+ "The highest order of derivative, that is the value of $n$, determines to the order of the equation.\n",
+ "The equation is referred to as a $n$-th order ODE.\n",
+ "Along with ([1](#ode)), some additional conditions of the function $g(x)$ are typically given\n",
+ "for the solution to be unique."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b4bf5f2e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The trial solution\n",
+ "\n",
+ "Let the trial solution $g_t(x)$ be"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1f4f3eba",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation}\n",
+ "\tg_t(x) = h_1(x) + h_2(x,N(x,P))\n",
+ "\\label{_auto1} \\tag{2}\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d799a47c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $h_1(x)$ is a function that makes $g_t(x)$ satisfy a given set\n",
+ "of conditions, $N(x,P)$ a neural network with weights and biases\n",
+ "described by $P$ and $h_2(x, N(x,P))$ some expression involving the\n",
+ "neural network. The role of the function $h_2(x, N(x,P))$, is to\n",
+ "ensure that the output from $N(x,P)$ is zero when $g_t(x)$ is\n",
+ "evaluated at the values of $x$ where the given conditions must be\n",
+ "satisfied. The function $h_1(x)$ should alone make $g_t(x)$ satisfy\n",
+ "the conditions.\n",
+ "\n",
+ "But what about the network $N(x,P)$?\n",
+ "\n",
+ "As described previously, an optimization method could be used to minimize the parameters of a neural network, that being its weights and biases, through backward propagation."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "abb02959",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Minimization process\n",
+ "\n",
+ "For the minimization to be defined, we need to have a cost function at hand to minimize.\n",
+ "\n",
+ "It is given that $f\\left(x, \\, g(x), \\, g'(x), \\, g''(x), \\, \\dots \\, , \\, g^{(n)}(x)\\right)$ should be equal to zero in ([1](#ode)).\n",
+ "We can choose to consider the mean squared error as the cost function for an input $x$.\n",
+ "Since we are looking at one input, the cost function is just $f$ squared.\n",
+ "The cost function $c\\left(x, P \\right)$ can therefore be expressed as"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6468ecf8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "C\\left(x, P\\right) = \\big(f\\left(x, \\, g(x), \\, g'(x), \\, g''(x), \\, \\dots \\, , \\, g^{(n)}(x)\\right)\\big)^2\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e7441b12",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "If $N$ inputs are given as a vector $\\boldsymbol{x}$ with elements $x_i$ for $i = 1,\\dots,N$,\n",
+ "the cost function becomes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0ffd1c29",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{cost} \\tag{3}\n",
+ "\tC\\left(\\boldsymbol{x}, P\\right) = \\frac{1}{N} \\sum_{i=1}^N \\big(f\\left(x_i, \\, g(x_i), \\, g'(x_i), \\, g''(x_i), \\, \\dots \\, , \\, g^{(n)}(x_i)\\right)\\big)^2\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e55c8d3e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "The neural net should then find the parameters $P$ that minimizes the cost function in\n",
+ "([3](#cost)) for a set of $N$ training samples $x_i$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8a940e88",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Minimizing the cost function using gradient descent and automatic differentiation\n",
+ "\n",
+ "To perform the minimization using gradient descent, the gradient of $C\\left(\\boldsymbol{x}, P\\right)$ is needed.\n",
+ "It might happen so that finding an analytical expression of the gradient of $C(\\boldsymbol{x}, P)$ from ([3](#cost)) gets too messy, depending on which cost function one desires to use.\n",
+ "\n",
+ "Luckily, there exists libraries that makes the job for us through automatic differentiation.\n",
+ "Automatic differentiation is a method of finding the derivatives numerically with very high precision."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "547613c0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Example: Exponential decay\n",
+ "\n",
+ "An exponential decay of a quantity $g(x)$ is described by the equation"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "826651d6",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{solve_expdec} \\tag{4}\n",
+ " g'(x) = -\\gamma g(x)\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "870b960b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $g(0) = g_0$ for some chosen initial value $g_0$.\n",
+ "\n",
+ "The analytical solution of ([4](#solve_expdec)) is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5a8fd1e3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation}\n",
+ " g(x) = g_0 \\exp\\left(-\\gamma x\\right)\n",
+ "\\label{_auto2} \\tag{5}\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "55b4f286",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Having an analytical solution at hand, it is possible to use it to compare how well a neural network finds a solution of ([4](#solve_expdec))."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7e4f689b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The function to solve for\n",
+ "\n",
+ "The program will use a neural network to solve"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "01e8e999",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{solveode} \\tag{6}\n",
+ "g'(x) = -\\gamma g(x)\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7ccea9f1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $g(0) = g_0$ with $\\gamma$ and $g_0$ being some chosen values.\n",
+ "\n",
+ "In this example, $\\gamma = 2$ and $g_0 = 10$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "47fde776",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The trial solution\n",
+ "To begin with, a trial solution $g_t(t)$ must be chosen. A general trial solution for ordinary differential equations could be"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f7a8f626",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "g_t(x, P) = h_1(x) + h_2(x, N(x, P))\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "66551df0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $h_1(x)$ ensuring that $g_t(x)$ satisfies some conditions and $h_2(x,N(x, P))$ an expression involving $x$ and the output from the neural network $N(x,P)$ with $P $ being the collection of the weights and biases for each layer. For now, it is assumed that the network consists of one input layer, one hidden layer, and one output layer."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c354ef4e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setup of Network\n",
+ "\n",
+ "In this network, there are no weights and bias at the input layer, so $P = \\{ P_{\\text{hidden}}, P_{\\text{output}} \\}$.\n",
+ "If there are $N_{\\text{hidden} }$ neurons in the hidden layer, then $P_{\\text{hidden}}$ is a $N_{\\text{hidden} } \\times (1 + N_{\\text{input}})$ matrix, given that there are $N_{\\text{input}}$ neurons in the input layer.\n",
+ "\n",
+ "The first column in $P_{\\text{hidden} }$ represents the bias for each neuron in the hidden layer and the second column represents the weights for each neuron in the hidden layer from the input layer.\n",
+ "If there are $N_{\\text{output} }$ neurons in the output layer, then $P_{\\text{output}} $ is a $N_{\\text{output} } \\times (1 + N_{\\text{hidden} })$ matrix.\n",
+ "\n",
+ "Its first column represents the bias of each neuron and the remaining columns represents the weights to each neuron.\n",
+ "\n",
+ "It is given that $g(0) = g_0$. The trial solution must fulfill this condition to be a proper solution of ([6](#solveode)). A possible way to ensure that $g_t(0, P) = g_0$, is to let $F(N(x,P)) = x \\cdot N(x,P)$ and $A(x) = g_0$. This gives the following trial solution:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a574c0b7",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{trial} \\tag{7}\n",
+ "g_t(x, P) = g_0 + x \\cdot N(x, P)\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "22f440c8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Reformulating the problem\n",
+ "\n",
+ "We wish that our neural network manages to minimize a given cost function.\n",
+ "\n",
+ "A reformulation of out equation, ([6](#solveode)), must therefore be done,\n",
+ "such that it describes the problem a neural network can solve for.\n",
+ "\n",
+ "The neural network must find the set of weights and biases $P$ such that the trial solution in ([7](#trial)) satisfies ([6](#solveode)).\n",
+ "\n",
+ "The trial solution"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0ff80a83",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "g_t(x, P) = g_0 + x \\cdot N(x, P)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6829edab",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "has been chosen such that it already solves the condition $g(0) = g_0$. What remains, is to find $P$ such that"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "381c61e2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{nnmin} \\tag{8}\n",
+ "g_t'(x, P) = - \\gamma g_t(x, P)\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ac36a03d",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "is fulfilled as *best as possible*."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2899becc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## More technicalities\n",
+ "\n",
+ "The left hand side and right hand side of ([8](#nnmin)) must be computed separately, and then the neural network must choose weights and biases, contained in $P$, such that the sides are equal as best as possible.\n",
+ "This means that the absolute or squared difference between the sides must be as close to zero, ideally equal to zero.\n",
+ "In this case, the difference squared shows to be an appropriate measurement of how erroneous the trial solution is with respect to $P$ of the neural network.\n",
+ "\n",
+ "This gives the following cost function our neural network must solve for:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d52c8124",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\min_{P}\\Big\\{ \\big(g_t'(x, P) - ( -\\gamma g_t(x, P) \\big)^2 \\Big\\}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3f8f684e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "(the notation $\\min_{P}\\{ f(x, P) \\}$ means that we desire to find $P$ that yields the minimum of $f(x, P)$)\n",
+ "\n",
+ "or, in terms of weights and biases for the hidden and output layer in our network:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "92cc16c9",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\min_{P_{\\text{hidden} }, \\ P_{\\text{output} }}\\Big\\{ \\big(g_t'(x, \\{ P_{\\text{hidden} }, P_{\\text{output} }\\}) - ( -\\gamma g_t(x, \\{ P_{\\text{hidden} }, P_{\\text{output} }\\}) \\big)^2 \\Big\\}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "628e0dfc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "for an input value $x$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e54b4c6e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## More details\n",
+ "\n",
+ "If the neural network evaluates $g_t(x, P)$ at more values for $x$, say $N$ values $x_i$ for $i = 1, \\dots, N$, then the *total* error to minimize becomes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "80dc48dd",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{min} \\tag{9}\n",
+ "\\min_{P}\\Big\\{\\frac{1}{N} \\sum_{i=1}^N \\big(g_t'(x_i, P) - ( -\\gamma g_t(x_i, P) \\big)^2 \\Big\\}\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e57a1d70",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Letting $\\boldsymbol{x}$ be a vector with elements $x_i$ and $C(\\boldsymbol{x}, P) = \\frac{1}{N} \\sum_i \\big(g_t'(x_i, P) - ( -\\gamma g_t(x_i, P) \\big)^2$ denote the cost function, the minimization problem that our network must solve, becomes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8ad67e57",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\min_{P} C(\\boldsymbol{x}, P)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4eed66ce",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "In terms of $P_{\\text{hidden} }$ and $P_{\\text{output} }$, this could also be expressed as\n",
+ "\n",
+ "$$\n",
+ "\\min_{P_{\\text{hidden} }, \\ P_{\\text{output} }} C(\\boldsymbol{x}, \\{P_{\\text{hidden} }, P_{\\text{output} }\\})\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9d652c56",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## A possible implementation of a neural network\n",
+ "\n",
+ "For simplicity, it is assumed that the input is an array $\\boldsymbol{x} = (x_1, \\dots, x_N)$ with $N$ elements. It is at these points the neural network should find $P$ such that it fulfills ([9](#min)).\n",
+ "\n",
+ "First, the neural network must feed forward the inputs.\n",
+ "This means that $\\boldsymbol{x}s$ must be passed through an input layer, a hidden layer and a output layer. The input layer in this case, does not need to process the data any further.\n",
+ "The input layer will consist of $N_{\\text{input} }$ neurons, passing its element to each neuron in the hidden layer. The number of neurons in the hidden layer will be $N_{\\text{hidden} }$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9a5a1ad7",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Technicalities\n",
+ "\n",
+ "For the $i$-th in the hidden layer with weight $w_i^{\\text{hidden} }$ and bias $b_i^{\\text{hidden} }$, the weighting from the $j$-th neuron at the input layer is:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ed15e067",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "z_{i,j}^{\\text{hidden}} &= b_i^{\\text{hidden}} + w_i^{\\text{hidden}}x_j \\\\\n",
+ "&=\n",
+ "\\begin{pmatrix}\n",
+ "b_i^{\\text{hidden}} & w_i^{\\text{hidden}}\n",
+ "\\end{pmatrix}\n",
+ "\\begin{pmatrix}\n",
+ "1 \\\\\n",
+ "x_j\n",
+ "\\end{pmatrix}\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "827ac223",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Final technicalities I\n",
+ "\n",
+ "The result after weighting the inputs at the $i$-th hidden neuron can be written as a vector:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a0a7b13f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "\\boldsymbol{z}_{i}^{\\text{hidden}} &= \\Big( b_i^{\\text{hidden}} + w_i^{\\text{hidden}}x_1 , \\ b_i^{\\text{hidden}} + w_i^{\\text{hidden}} x_2, \\ \\dots \\, , \\ b_i^{\\text{hidden}} + w_i^{\\text{hidden}} x_N\\Big) \\\\\n",
+ "&=\n",
+ "\\begin{pmatrix}\n",
+ " b_i^{\\text{hidden}} & w_i^{\\text{hidden}}\n",
+ "\\end{pmatrix}\n",
+ "\\begin{pmatrix}\n",
+ "1 & 1 & \\dots & 1 \\\\\n",
+ "x_1 & x_2 & \\dots & x_N\n",
+ "\\end{pmatrix} \\\\\n",
+ "&= \\boldsymbol{p}_{i, \\text{hidden}}^T X\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0879010a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Final technicalities II\n",
+ "\n",
+ "The vector $\\boldsymbol{p}_{i, \\text{hidden}}^T$ constitutes each row in $P_{\\text{hidden} }$, which contains the weights for the neural network to minimize according to ([9](#min)).\n",
+ "\n",
+ "After having found $\\boldsymbol{z}_{i}^{\\text{hidden}} $ for every $i$-th neuron within the hidden layer, the vector will be sent to an activation function $a_i(\\boldsymbol{z})$.\n",
+ "\n",
+ "In this example, the sigmoid function has been chosen to be the activation function for each hidden neuron:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "66ac91b3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "f(z) = \\frac{1}{1 + \\exp{(-z)}}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "470c74b5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "It is possible to use other activations functions for the hidden layer also.\n",
+ "\n",
+ "The output $\\boldsymbol{x}_i^{\\text{hidden}}$ from each $i$-th hidden neuron is:\n",
+ "\n",
+ "$$\n",
+ "\\boldsymbol{x}_i^{\\text{hidden} } = f\\big( \\boldsymbol{z}_{i}^{\\text{hidden}} \\big)\n",
+ "$$\n",
+ "\n",
+ "The outputs $\\boldsymbol{x}_i^{\\text{hidden} } $ are then sent to the output layer.\n",
+ "\n",
+ "The output layer consists of one neuron in this case, and combines the\n",
+ "output from each of the neurons in the hidden layers. The output layer\n",
+ "combines the results from the hidden layer using some weights $w_i^{\\text{output}}$\n",
+ "and biases $b_i^{\\text{output}}$. In this case,\n",
+ "it is assumes that the number of neurons in the output layer is one."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bf5e6967",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Final technicalities III\n",
+ "\n",
+ "The procedure of weighting the output neuron $j$ in the hidden layer to the $i$-th neuron in the output layer is similar as for the hidden layer described previously."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "766b88f8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "z_{1,j}^{\\text{output}} & =\n",
+ "\\begin{pmatrix}\n",
+ "b_1^{\\text{output}} & \\boldsymbol{w}_1^{\\text{output}}\n",
+ "\\end{pmatrix}\n",
+ "\\begin{pmatrix}\n",
+ "1 \\\\\n",
+ "\\boldsymbol{x}_j^{\\text{hidden}}\n",
+ "\\end{pmatrix}\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5c114139",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Final technicalities IV\n",
+ "\n",
+ "Expressing $z_{1,j}^{\\text{output}}$ as a vector gives the following way of weighting the inputs from the hidden layer:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "45596281",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\boldsymbol{z}_{1}^{\\text{output}} =\n",
+ "\\begin{pmatrix}\n",
+ "b_1^{\\text{output}} & \\boldsymbol{w}_1^{\\text{output}}\n",
+ "\\end{pmatrix}\n",
+ "\\begin{pmatrix}\n",
+ "1 & 1 & \\dots & 1 \\\\\n",
+ "\\boldsymbol{x}_1^{\\text{hidden}} & \\boldsymbol{x}_2^{\\text{hidden}} & \\dots & \\boldsymbol{x}_N^{\\text{hidden}}\n",
+ "\\end{pmatrix}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2c1378fb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "In this case we seek a continuous range of values since we are approximating a function. This means that after computing $\\boldsymbol{z}_{1}^{\\text{output}}$ the neural network has finished its feed forward step, and $\\boldsymbol{z}_{1}^{\\text{output}}$ is the final output of the network."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "66a732e1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Back propagation\n",
+ "\n",
+ "The next step is to decide how the parameters should be changed such that they minimize the cost function.\n",
+ "\n",
+ "The chosen cost function for this problem is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fdf81225",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "C(\\boldsymbol{x}, P) = \\frac{1}{N} \\sum_i \\big(g_t'(x_i, P) - ( -\\gamma g_t(x_i, P) \\big)^2\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9bb52111",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "In order to minimize the cost function, an optimization method must be chosen.\n",
+ "\n",
+ "Here, gradient descent with a constant step size has been chosen."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f3e495b4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Gradient descent\n",
+ "\n",
+ "The idea of the gradient descent algorithm is to update parameters in\n",
+ "a direction where the cost function decreases goes to a minimum.\n",
+ "\n",
+ "In general, the update of some parameters $\\boldsymbol{\\omega}$ given a cost\n",
+ "function defined by some weights $\\boldsymbol{\\omega}$, $C(\\boldsymbol{x},\n",
+ "\\boldsymbol{\\omega})$, goes as follows:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "adc904df",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\boldsymbol{\\omega}_{\\text{new} } = \\boldsymbol{\\omega} - \\lambda \\nabla_{\\boldsymbol{\\omega}} C(\\boldsymbol{x}, \\boldsymbol{\\omega})\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2d01b1b5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "for a number of iterations or until $ \\big|\\big| \\boldsymbol{\\omega}_{\\text{new} } - \\boldsymbol{\\omega} \\big|\\big|$ becomes smaller than some given tolerance.\n",
+ "\n",
+ "The value of $\\lambda$ decides how large steps the algorithm must take\n",
+ "in the direction of $ \\nabla_{\\boldsymbol{\\omega}} C(\\boldsymbol{x}, \\boldsymbol{\\omega})$.\n",
+ "The notation $\\nabla_{\\boldsymbol{\\omega}}$ express the gradient with respect\n",
+ "to the elements in $\\boldsymbol{\\omega}$.\n",
+ "\n",
+ "In our case, we have to minimize the cost function $C(\\boldsymbol{x}, P)$ with\n",
+ "respect to the two sets of weights and biases, that is for the hidden\n",
+ "layer $P_{\\text{hidden} }$ and for the output layer $P_{\\text{output}\n",
+ "}$ .\n",
+ "\n",
+ "This means that $P_{\\text{hidden} }$ and $P_{\\text{output} }$ is updated by"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5077f4f7",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "P_{\\text{hidden},\\text{new}} &= P_{\\text{hidden}} - \\lambda \\nabla_{P_{\\text{hidden}}} C(\\boldsymbol{x}, P) \\\\\n",
+ "P_{\\text{output},\\text{new}} &= P_{\\text{output}} - \\lambda \\nabla_{P_{\\text{output}}} C(\\boldsymbol{x}, P)\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fb01e943",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The code for solving the ODE"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "id": "6347e101",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import grad, elementwise_grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import pyplot as plt\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "# Assuming one input, hidden, and output layer\n",
+ "def neural_network(params, x):\n",
+ "\n",
+ " # Find the weights (including and biases) for the hidden and output layer.\n",
+ " # Assume that params is a list of parameters for each layer.\n",
+ " # The biases are the first element for each array in params,\n",
+ " # and the weights are the remaning elements in each array in params.\n",
+ "\n",
+ " w_hidden = params[0]\n",
+ " w_output = params[1]\n",
+ "\n",
+ " # Assumes input x being an one-dimensional array\n",
+ " num_values = np.size(x)\n",
+ " x = x.reshape(-1, num_values)\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ "\n",
+ " ## Hidden layer:\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_input = np.concatenate((np.ones((1,num_values)), x_input ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_input)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Include bias:\n",
+ " x_hidden = np.concatenate((np.ones((1,num_values)), x_hidden ), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_hidden)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output\n",
+ "\n",
+ "# The trial solution using the deep neural network:\n",
+ "def g_trial(x,params, g0 = 10):\n",
+ " return g0 + x*neural_network(params,x)\n",
+ "\n",
+ "# The right side of the ODE:\n",
+ "def g(x, g_trial, gamma = 2):\n",
+ " return -gamma*g_trial\n",
+ "\n",
+ "# The cost function:\n",
+ "def cost_function(P, x):\n",
+ "\n",
+ " # Evaluate the trial function with the current parameters P\n",
+ " g_t = g_trial(x,P)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the neural network\n",
+ " d_net_out = elementwise_grad(neural_network,1)(P,x)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the trial function\n",
+ " d_g_t = elementwise_grad(g_trial,0)(x,P)\n",
+ "\n",
+ " # The right side of the ODE\n",
+ " func = g(x, g_t)\n",
+ "\n",
+ " err_sqr = (d_g_t - func)**2\n",
+ " cost_sum = np.sum(err_sqr)\n",
+ "\n",
+ " return cost_sum / np.size(err_sqr)\n",
+ "\n",
+ "# Solve the exponential decay ODE using neural network with one input, hidden, and output layer\n",
+ "def solve_ode_neural_network(x, num_neurons_hidden, num_iter, lmb):\n",
+ " ## Set up initial weights and biases\n",
+ "\n",
+ " # For the hidden layer\n",
+ " p0 = npr.randn(num_neurons_hidden, 2 )\n",
+ "\n",
+ " # For the output layer\n",
+ " p1 = npr.randn(1, num_neurons_hidden + 1 ) # +1 since bias is included\n",
+ "\n",
+ " P = [p0, p1]\n",
+ "\n",
+ " print('Initial cost: %g'%cost_function(P, x))\n",
+ "\n",
+ " ## Start finding the optimal weights using gradient descent\n",
+ "\n",
+ " # Find the Python function that represents the gradient of the cost function\n",
+ " # w.r.t the 0-th input argument -- that is the weights and biases in the hidden and output layer\n",
+ " cost_function_grad = grad(cost_function,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " # Evaluate the gradient at the current weights and biases in P.\n",
+ " # The cost_grad consist now of two arrays;\n",
+ " # one for the gradient w.r.t P_hidden and\n",
+ " # one for the gradient w.r.t P_output\n",
+ " cost_grad = cost_function_grad(P, x)\n",
+ "\n",
+ " P[0] = P[0] - lmb * cost_grad[0]\n",
+ " P[1] = P[1] - lmb * cost_grad[1]\n",
+ "\n",
+ " print('Final cost: %g'%cost_function(P, x))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "def g_analytic(x, gamma = 2, g0 = 10):\n",
+ " return g0*np.exp(-gamma*x)\n",
+ "\n",
+ "# Solve the given problem\n",
+ "if __name__ == '__main__':\n",
+ " # Set seed such that the weight are initialized\n",
+ " # with same weights and biases for every run.\n",
+ " npr.seed(15)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " N = 10\n",
+ " x = np.linspace(0, 1, N)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = 10\n",
+ " num_iter = 10000\n",
+ " lmb = 0.001\n",
+ "\n",
+ " # Use the network\n",
+ " P = solve_ode_neural_network(x, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " # Print the deviation from the trial solution and true solution\n",
+ " res = g_trial(x,P)\n",
+ " res_analytical = g_analytic(x)\n",
+ "\n",
+ " print('Max absolute difference: %g'%np.max(np.abs(res - res_analytical)))\n",
+ "\n",
+ " # Plot the results\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(x, res_analytical)\n",
+ " plt.plot(x, res[0,:])\n",
+ " plt.legend(['analytical','nn'])\n",
+ " plt.xlabel('x')\n",
+ " plt.ylabel('g(x)')\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "59e5acda",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The network with one input layer, specified number of hidden layers, and one output layer\n",
+ "\n",
+ "It is also possible to extend the construction of our network into a more general one, allowing the network to contain more than one hidden layers.\n",
+ "\n",
+ "The number of neurons within each hidden layer are given as a list of integers in the program below."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "id": "f1a60516",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import grad, elementwise_grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import pyplot as plt\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "# The neural network with one input layer and one output layer,\n",
+ "# but with number of hidden layers specified by the user.\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # N_hidden is the number of hidden layers\n",
+ " # deep_params is a list, len() should be used\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consists of\n",
+ " # parameters to all the hidden\n",
+ " # layers AND the output layer.\n",
+ "\n",
+ " # Assumes input x being an one-dimensional array\n",
+ " num_values = np.size(x)\n",
+ " x = x.reshape(-1, num_values)\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ "\n",
+ " # Due to multiple hidden layers, define a variable referencing to the\n",
+ " # output of the previous layer:\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output\n",
+ "\n",
+ "# The trial solution using the deep neural network:\n",
+ "def g_trial_deep(x,params, g0 = 10):\n",
+ " return g0 + x*deep_neural_network(params, x)\n",
+ "\n",
+ "# The right side of the ODE:\n",
+ "def g(x, g_trial, gamma = 2):\n",
+ " return -gamma*g_trial\n",
+ "\n",
+ "# The same cost function as before, but calls deep_neural_network instead.\n",
+ "def cost_function_deep(P, x):\n",
+ "\n",
+ " # Evaluate the trial function with the current parameters P\n",
+ " g_t = g_trial_deep(x,P)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the neural network\n",
+ " d_net_out = elementwise_grad(deep_neural_network,1)(P,x)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the trial function\n",
+ " d_g_t = elementwise_grad(g_trial_deep,0)(x,P)\n",
+ "\n",
+ " # The right side of the ODE\n",
+ " func = g(x, g_t)\n",
+ "\n",
+ " err_sqr = (d_g_t - func)**2\n",
+ " cost_sum = np.sum(err_sqr)\n",
+ "\n",
+ " return cost_sum / np.size(err_sqr)\n",
+ "\n",
+ "# Solve the exponential decay ODE using neural network with one input and one output layer,\n",
+ "# but with specified number of hidden layers from the user.\n",
+ "def solve_ode_deep_neural_network(x, num_neurons, num_iter, lmb):\n",
+ " # num_hidden_neurons is now a list of number of neurons within each hidden layer\n",
+ "\n",
+ " # The number of elements in the list num_hidden_neurons thus represents\n",
+ " # the number of hidden layers.\n",
+ "\n",
+ " # Find the number of hidden layers:\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weights and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 )\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " ## Start finding the optimal weights using gradient descent\n",
+ "\n",
+ " # Find the Python function that represents the gradient of the cost function\n",
+ " # w.r.t the 0-th input argument -- that is the weights and biases in the hidden and output layer\n",
+ " cost_function_deep_grad = grad(cost_function_deep,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " # Evaluate the gradient at the current weights and biases in P.\n",
+ " # The cost_grad consist now of N_hidden + 1 arrays; the gradient w.r.t the weights and biases\n",
+ " # in the hidden layers and output layers evaluated at x.\n",
+ " cost_deep_grad = cost_function_deep_grad(P, x)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_deep_grad[l]\n",
+ "\n",
+ " print('Final cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "def g_analytic(x, gamma = 2, g0 = 10):\n",
+ " return g0*np.exp(-gamma*x)\n",
+ "\n",
+ "# Solve the given problem\n",
+ "if __name__ == '__main__':\n",
+ " npr.seed(15)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " N = 10\n",
+ " x = np.linspace(0, 1, N)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = np.array([10,10])\n",
+ " num_iter = 10000\n",
+ " lmb = 0.001\n",
+ "\n",
+ " P = solve_ode_deep_neural_network(x, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " res = g_trial_deep(x,P)\n",
+ " res_analytical = g_analytic(x)\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of a deep neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(x, res_analytical)\n",
+ " plt.plot(x, res[0,:])\n",
+ " plt.legend(['analytical','dnn'])\n",
+ " plt.ylabel('g(x)')\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "807a375c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Example: Population growth\n",
+ "\n",
+ "A logistic model of population growth assumes that a population converges toward an equilibrium.\n",
+ "The population growth can be modeled by"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d35839bb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{log} \\tag{10}\n",
+ "\tg'(t) = \\alpha g(t)(A - g(t))\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2991d1fe",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $g(t)$ is the population density at time $t$, $\\alpha > 0$ the growth rate and $A > 0$ is the maximum population number in the environment.\n",
+ "Also, at $t = 0$ the population has the size $g(0) = g_0$, where $g_0$ is some chosen constant.\n",
+ "\n",
+ "In this example, similar network as for the exponential decay using Autograd has been used to solve the equation. However, as the implementation might suffer from e.g numerical instability\n",
+ "and high execution time (this might be more apparent in the examples solving PDEs),\n",
+ "using a library like TensorFlow is recommended.\n",
+ "Here, we stay with a more simple approach and implement for comparison, the simple forward Euler method."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ee668a71",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the problem\n",
+ "\n",
+ "Here, we will model a population $g(t)$ in an environment having carrying capacity $A$.\n",
+ "The population follows the model"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "febf10cc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{solveode_population} \\tag{11}\n",
+ "g'(t) = \\alpha g(t)(A - g(t))\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "494194e3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $g(0) = g_0$.\n",
+ "\n",
+ "In this example, we let $\\alpha = 2$, $A = 1$, and $g_0 = 1.2$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5efa7b11",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The trial solution\n",
+ "\n",
+ "We will get a slightly different trial solution, as the boundary conditions are different\n",
+ "compared to the case for exponential decay.\n",
+ "\n",
+ "A possible trial solution satisfying the condition $g(0) = g_0$ could be\n",
+ "\n",
+ "$$\n",
+ "h_1(t) = g_0 + t \\cdot N(t,P)\n",
+ "$$\n",
+ "\n",
+ "with $N(t,P)$ being the output from the neural network with weights and biases for each layer collected in the set $P$.\n",
+ "\n",
+ "The analytical solution is\n",
+ "\n",
+ "$$\n",
+ "g(t) = \\frac{Ag_0}{g_0 + (A - g_0)\\exp(-\\alpha A t)}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "568131dc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The program using Autograd\n",
+ "\n",
+ "The network will be the similar as for the exponential decay example, but with some small modifications for our problem."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "id": "8737e028",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import grad, elementwise_grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import pyplot as plt\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "# Function to get the parameters.\n",
+ "# Done such that one can easily change the paramaters after one's liking.\n",
+ "def get_parameters():\n",
+ " alpha = 2\n",
+ " A = 1\n",
+ " g0 = 1.2\n",
+ " return alpha, A, g0\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # N_hidden is the number of hidden layers\n",
+ " # deep_params is a list, len() should be used\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consists of\n",
+ " # parameters to all the hidden\n",
+ " # layers AND the output layer.\n",
+ "\n",
+ " # Assumes input x being an one-dimensional array\n",
+ " num_values = np.size(x)\n",
+ " x = x.reshape(-1, num_values)\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ "\n",
+ " # Due to multiple hidden layers, define a variable referencing to the\n",
+ " # output of the previous layer:\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "def cost_function_deep(P, x):\n",
+ "\n",
+ " # Evaluate the trial function with the current parameters P\n",
+ " g_t = g_trial_deep(x,P)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the trial function\n",
+ " d_g_t = elementwise_grad(g_trial_deep,0)(x,P)\n",
+ "\n",
+ " # The right side of the ODE\n",
+ " func = f(x, g_t)\n",
+ "\n",
+ " err_sqr = (d_g_t - func)**2\n",
+ " cost_sum = np.sum(err_sqr)\n",
+ "\n",
+ " return cost_sum / np.size(err_sqr)\n",
+ "\n",
+ "# The right side of the ODE:\n",
+ "def f(x, g_trial):\n",
+ " alpha,A, g0 = get_parameters()\n",
+ " return alpha*g_trial*(A - g_trial)\n",
+ "\n",
+ "# The trial solution using the deep neural network:\n",
+ "def g_trial_deep(x, params):\n",
+ " alpha,A, g0 = get_parameters()\n",
+ " return g0 + x*deep_neural_network(params,x)\n",
+ "\n",
+ "# The analytical solution:\n",
+ "def g_analytic(t):\n",
+ " alpha,A, g0 = get_parameters()\n",
+ " return A*g0/(g0 + (A - g0)*np.exp(-alpha*A*t))\n",
+ "\n",
+ "def solve_ode_deep_neural_network(x, num_neurons, num_iter, lmb):\n",
+ " # num_hidden_neurons is now a list of number of neurons within each hidden layer\n",
+ "\n",
+ " # Find the number of hidden layers:\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weigths and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 )\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " ## Start finding the optimal weigths using gradient descent\n",
+ "\n",
+ " # Find the Python function that represents the gradient of the cost function\n",
+ " # w.r.t the 0-th input argument -- that is the weights and biases in the hidden and output layer\n",
+ " cost_function_deep_grad = grad(cost_function_deep,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " # Evaluate the gradient at the current weights and biases in P.\n",
+ " # The cost_grad consist now of N_hidden + 1 arrays; the gradient w.r.t the weights and biases\n",
+ " # in the hidden layers and output layers evaluated at x.\n",
+ " cost_deep_grad = cost_function_deep_grad(P, x)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_deep_grad[l]\n",
+ "\n",
+ " print('Final cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " npr.seed(4155)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nt = 10\n",
+ " T = 1\n",
+ " t = np.linspace(0,T, Nt)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = [100, 50, 25]\n",
+ " num_iter = 1000\n",
+ " lmb = 1e-3\n",
+ "\n",
+ " P = solve_ode_deep_neural_network(t, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " g_dnn_ag = g_trial_deep(t,P)\n",
+ " g_analytical = g_analytic(t)\n",
+ "\n",
+ " # Find the maximum absolute difference between the solutons:\n",
+ " diff_ag = np.max(np.abs(g_dnn_ag - g_analytical))\n",
+ " print(\"The max absolute difference between the solutions is: %g\"%diff_ag)\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(t, g_analytical)\n",
+ " plt.plot(t, g_dnn_ag[0,:])\n",
+ " plt.legend(['analytical','nn'])\n",
+ " plt.xlabel('t')\n",
+ " plt.ylabel('g(t)')\n",
+ "\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0904f64d",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Using forward Euler to solve the ODE\n",
+ "\n",
+ "A straightforward way of solving an ODE numerically, is to use Euler's method.\n",
+ "\n",
+ "Euler's method uses Taylor series to approximate the value at a function $f$ at a step $\\Delta x$ from $x$:\n",
+ "\n",
+ "$$\n",
+ "f(x + \\Delta x) \\approx f(x) + \\Delta x f'(x)\n",
+ "$$\n",
+ "\n",
+ "In our case, using Euler's method to approximate the value of $g$ at a step $\\Delta t$ from $t$ yields"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6f3577a8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ " g(t + \\Delta t) &\\approx g(t) + \\Delta t g'(t) \\\\\n",
+ " &= g(t) + \\Delta t \\big(\\alpha g(t)(A - g(t))\\big)\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "56d4410b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "along with the condition that $g(0) = g_0$.\n",
+ "\n",
+ "Let $t_i = i \\cdot \\Delta t$ where $\\Delta t = \\frac{T}{N_t-1}$ where $T$ is the final time our solver must solve for and $N_t$ the number of values for $t \\in [0, T]$ for $i = 0, \\dots, N_t-1$.\n",
+ "\n",
+ "For $i \\geq 1$, we have that"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "48d2707e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "t_i &= i\\Delta t \\\\\n",
+ "&= (i - 1)\\Delta t + \\Delta t \\\\\n",
+ "&= t_{i-1} + \\Delta t\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "66d99f85",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Now, if $g_i = g(t_i)$ then"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3c9447d9",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation}\n",
+ " \\begin{aligned}\n",
+ " g_i &= g(t_i) \\\\\n",
+ " &= g(t_{i-1} + \\Delta t) \\\\\n",
+ " &\\approx g(t_{i-1}) + \\Delta t \\big(\\alpha g(t_{i-1})(A - g(t_{i-1}))\\big) \\\\\n",
+ " &= g_{i-1} + \\Delta t \\big(\\alpha g_{i-1}(A - g_{i-1})\\big)\n",
+ " \\end{aligned}\n",
+ "\\end{equation} \\label{odenum} \\tag{12}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "724b97f1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "for $i \\geq 1$ and $g_0 = g(t_0) = g(0) = g_0$.\n",
+ "\n",
+ "Equation ([12](#odenum)) could be implemented in the following way,\n",
+ "extending the program that uses the network using Autograd:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "id": "58b0da70",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "# Assume that all function definitions from the example program using Autograd\n",
+ "# are located here.\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " npr.seed(4155)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nt = 10\n",
+ " T = 1\n",
+ " t = np.linspace(0,T, Nt)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = [100,50,25]\n",
+ " num_iter = 1000\n",
+ " lmb = 1e-3\n",
+ "\n",
+ " P = solve_ode_deep_neural_network(t, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " g_dnn_ag = g_trial_deep(t,P)\n",
+ " g_analytical = g_analytic(t)\n",
+ "\n",
+ " # Find the maximum absolute difference between the solutons:\n",
+ " diff_ag = np.max(np.abs(g_dnn_ag - g_analytical))\n",
+ " print(\"The max absolute difference between the solutions is: %g\"%diff_ag)\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(t, g_analytical)\n",
+ " plt.plot(t, g_dnn_ag[0,:])\n",
+ " plt.legend(['analytical','nn'])\n",
+ " plt.xlabel('t')\n",
+ " plt.ylabel('g(t)')\n",
+ "\n",
+ " ## Find an approximation to the funtion using forward Euler\n",
+ "\n",
+ " alpha, A, g0 = get_parameters()\n",
+ " dt = T/(Nt - 1)\n",
+ "\n",
+ " # Perform forward Euler to solve the ODE\n",
+ " g_euler = np.zeros(Nt)\n",
+ " g_euler[0] = g0\n",
+ "\n",
+ " for i in range(1,Nt):\n",
+ " g_euler[i] = g_euler[i-1] + dt*(alpha*g_euler[i-1]*(A - g_euler[i-1]))\n",
+ "\n",
+ " # Print the errors done by each method\n",
+ " diff1 = np.max(np.abs(g_euler - g_analytical))\n",
+ " diff2 = np.max(np.abs(g_dnn_ag[0,:] - g_analytical))\n",
+ "\n",
+ " print('Max absolute difference between Euler method and analytical: %g'%diff1)\n",
+ " print('Max absolute difference between deep neural network and analytical: %g'%diff2)\n",
+ "\n",
+ " # Plot results\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.plot(t,g_euler)\n",
+ " plt.plot(t,g_analytical)\n",
+ " plt.plot(t,g_dnn_ag[0,:])\n",
+ "\n",
+ " plt.legend(['euler','analytical','dnn'])\n",
+ " plt.xlabel('Time t')\n",
+ " plt.ylabel('g(t)')\n",
+ "\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f1230dee",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Example: Solving the one dimensional Poisson equation\n",
+ "\n",
+ "The Poisson equation for $g(x)$ in one dimension is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ba2c6d0a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{poisson} \\tag{13}\n",
+ " -g''(x) = f(x)\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bab1c7d3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $f(x)$ is a given function for $x \\in (0,1)$.\n",
+ "\n",
+ "The conditions that $g(x)$ is chosen to fulfill, are"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "42bfde23",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{align*}\n",
+ " g(0) &= 0 \\\\\n",
+ " g(1) &= 0\n",
+ "\\end{align*}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7b3a2504",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "This equation can be solved numerically using programs where e.g Autograd and TensorFlow are used.\n",
+ "The results from the networks can then be compared to the analytical solution.\n",
+ "In addition, it could be interesting to see how a typical method for numerically solving second order ODEs compares to the neural networks."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a419909c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The specific equation to solve for\n",
+ "\n",
+ "Here, the function $g(x)$ to solve for follows the equation"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "125f8197",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "-g''(x) = f(x),\\qquad x \\in (0,1)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "16376b60",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $f(x)$ is a given function, along with the chosen conditions"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "044c76ec",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{aligned}\n",
+ "g(0) = g(1) = 0\n",
+ "\\end{aligned}\\label{cond} \\tag{14}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0ec4860b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "In this example, we consider the case when $f(x) = (3x + x^2)\\exp(x)$.\n",
+ "\n",
+ "For this case, a possible trial solution satisfying the conditions could be"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "03e27ec0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "g_t(x) = x \\cdot (1-x) \\cdot N(P,x)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "82fdb51f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "The analytical solution for this problem is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "82e39d0e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "g(x) = x(1 - x)\\exp(x)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bf029e6c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Solving the equation using Autograd"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "id": "e10d7641",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import grad, elementwise_grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import pyplot as plt\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # N_hidden is the number of hidden layers\n",
+ " # deep_params is a list, len() should be used\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consists of\n",
+ " # parameters to all the hidden\n",
+ " # layers AND the output layer.\n",
+ "\n",
+ " # Assumes input x being an one-dimensional array\n",
+ " num_values = np.size(x)\n",
+ " x = x.reshape(-1, num_values)\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ "\n",
+ " # Due to multiple hidden layers, define a variable referencing to the\n",
+ " # output of the previous layer:\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output\n",
+ "\n",
+ "\n",
+ "def solve_ode_deep_neural_network(x, num_neurons, num_iter, lmb):\n",
+ " # num_hidden_neurons is now a list of number of neurons within each hidden layer\n",
+ "\n",
+ " # Find the number of hidden layers:\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weigths and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 )\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " ## Start finding the optimal weigths using gradient descent\n",
+ "\n",
+ " # Find the Python function that represents the gradient of the cost function\n",
+ " # w.r.t the 0-th input argument -- that is the weights and biases in the hidden and output layer\n",
+ " cost_function_deep_grad = grad(cost_function_deep,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " # Evaluate the gradient at the current weights and biases in P.\n",
+ " # The cost_grad consist now of N_hidden + 1 arrays; the gradient w.r.t the weights and biases\n",
+ " # in the hidden layers and output layers evaluated at x.\n",
+ " cost_deep_grad = cost_function_deep_grad(P, x)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_deep_grad[l]\n",
+ "\n",
+ " print('Final cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "## Set up the cost function specified for this Poisson equation:\n",
+ "\n",
+ "# The right side of the ODE\n",
+ "def f(x):\n",
+ " return (3*x + x**2)*np.exp(x)\n",
+ "\n",
+ "def cost_function_deep(P, x):\n",
+ "\n",
+ " # Evaluate the trial function with the current parameters P\n",
+ " g_t = g_trial_deep(x,P)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the trial function\n",
+ " d2_g_t = elementwise_grad(elementwise_grad(g_trial_deep,0))(x,P)\n",
+ "\n",
+ " right_side = f(x)\n",
+ "\n",
+ " err_sqr = (-d2_g_t - right_side)**2\n",
+ " cost_sum = np.sum(err_sqr)\n",
+ "\n",
+ " return cost_sum/np.size(err_sqr)\n",
+ "\n",
+ "# The trial solution:\n",
+ "def g_trial_deep(x,P):\n",
+ " return x*(1-x)*deep_neural_network(P,x)\n",
+ "\n",
+ "# The analytic solution;\n",
+ "def g_analytic(x):\n",
+ " return x*(1-x)*np.exp(x)\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " npr.seed(4155)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nx = 10\n",
+ " x = np.linspace(0,1, Nx)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = [200,100]\n",
+ " num_iter = 1000\n",
+ " lmb = 1e-3\n",
+ "\n",
+ " P = solve_ode_deep_neural_network(x, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " g_dnn_ag = g_trial_deep(x,P)\n",
+ " g_analytical = g_analytic(x)\n",
+ "\n",
+ " # Find the maximum absolute difference between the solutons:\n",
+ " max_diff = np.max(np.abs(g_dnn_ag - g_analytical))\n",
+ " print(\"The max absolute difference between the solutions is: %g\"%max_diff)\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(x, g_analytical)\n",
+ " plt.plot(x, g_dnn_ag[0,:])\n",
+ " plt.legend(['analytical','nn'])\n",
+ " plt.xlabel('x')\n",
+ " plt.ylabel('g(x)')\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "82891392",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Comparing with a numerical scheme\n",
+ "\n",
+ "The Poisson equation is possible to solve using Taylor series to approximate the second derivative.\n",
+ "\n",
+ "Using Taylor series, the second derivative can be expressed as\n",
+ "\n",
+ "$$\n",
+ "g''(x) = \\frac{g(x + \\Delta x) - 2g(x) + g(x-\\Delta x)}{\\Delta x^2} + E_{\\Delta x}(x)\n",
+ "$$\n",
+ "\n",
+ "where $\\Delta x$ is a small step size and $E_{\\Delta x}(x)$ being the error term.\n",
+ "\n",
+ "Looking away from the error terms gives an approximation to the second derivative:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ad4ef510",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{approx} \\tag{15}\n",
+ "g''(x) \\approx \\frac{g(x + \\Delta x) - 2g(x) + g(x-\\Delta x)}{\\Delta x^2}\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "eb8ab804",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "If $x_i = i \\Delta x = x_{i-1} + \\Delta x$ and $g_i = g(x_i)$ for $i = 1,\\dots N_x - 2$ with $N_x$ being the number of values for $x$, ([15](#approx)) becomes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f9b7b2a0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "g''(x_i) &\\approx \\frac{g(x_i + \\Delta x) - 2g(x_i) + g(x_i -\\Delta x)}{\\Delta x^2} \\\\\n",
+ "&= \\frac{g_{i+1} - 2g_i + g_{i-1}}{\\Delta x^2}\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6a71c7bb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Since we know from our problem that"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d19780a8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "-g''(x) &= f(x) \\\\\n",
+ "&= (3x + x^2)\\exp(x)\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "00fedc6e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "along with the conditions $g(0) = g(1) = 0$,\n",
+ "the following scheme can be used to find an approximate solution for $g(x)$ numerically:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "28005c86",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation}\n",
+ " \\begin{aligned}\n",
+ " -\\Big( \\frac{g_{i+1} - 2g_i + g_{i-1}}{\\Delta x^2} \\Big) &= f(x_i) \\\\\n",
+ " -g_{i+1} + 2g_i - g_{i-1} &= \\Delta x^2 f(x_i)\n",
+ " \\end{aligned}\n",
+ "\\end{equation} \\label{odesys} \\tag{16}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d562bb0c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "for $i = 1, \\dots, N_x - 2$ where $g_0 = g_{N_x - 1} = 0$ and $f(x_i) = (3x_i + x_i^2)\\exp(x_i)$, which is given for our specific problem.\n",
+ "\n",
+ "The equation can be rewritten into a matrix equation:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bdee81e4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "\\begin{pmatrix}\n",
+ "2 & -1 & 0 & \\dots & 0 \\\\\n",
+ "-1 & 2 & -1 & \\dots & 0 \\\\\n",
+ "\\vdots & & \\ddots & & \\vdots \\\\\n",
+ "0 & \\dots & -1 & 2 & -1 \\\\\n",
+ "0 & \\dots & 0 & -1 & 2\\\\\n",
+ "\\end{pmatrix}\n",
+ "\\begin{pmatrix}\n",
+ "g_1 \\\\\n",
+ "g_2 \\\\\n",
+ "\\vdots \\\\\n",
+ "g_{N_x - 3} \\\\\n",
+ "g_{N_x - 2}\n",
+ "\\end{pmatrix}\n",
+ "&=\n",
+ "\\Delta x^2\n",
+ "\\begin{pmatrix}\n",
+ "f(x_1) \\\\\n",
+ "f(x_2) \\\\\n",
+ "\\vdots \\\\\n",
+ "f(x_{N_x - 3}) \\\\\n",
+ "f(x_{N_x - 2})\n",
+ "\\end{pmatrix} \\\\\n",
+ "\\boldsymbol{A}\\boldsymbol{g} &= \\boldsymbol{f},\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ddf436f5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "which makes it possible to solve for the vector $\\boldsymbol{g}$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "66ae2d44",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the code\n",
+ "\n",
+ "We can then compare the result from this numerical scheme with the output from our network using Autograd:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "id": "17f02a24",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import grad, elementwise_grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import pyplot as plt\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # N_hidden is the number of hidden layers\n",
+ " # deep_params is a list, len() should be used\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consists of\n",
+ " # parameters to all the hidden\n",
+ " # layers AND the output layer.\n",
+ "\n",
+ " # Assumes input x being an one-dimensional array\n",
+ " num_values = np.size(x)\n",
+ " x = x.reshape(-1, num_values)\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ "\n",
+ " # Due to multiple hidden layers, define a variable referencing to the\n",
+ " # output of the previous layer:\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output\n",
+ "\n",
+ "\n",
+ "def solve_ode_deep_neural_network(x, num_neurons, num_iter, lmb):\n",
+ " # num_hidden_neurons is now a list of number of neurons within each hidden layer\n",
+ "\n",
+ " # Find the number of hidden layers:\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weigths and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 )\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " ## Start finding the optimal weigths using gradient descent\n",
+ "\n",
+ " # Find the Python function that represents the gradient of the cost function\n",
+ " # w.r.t the 0-th input argument -- that is the weights and biases in the hidden and output layer\n",
+ " cost_function_deep_grad = grad(cost_function_deep,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " # Evaluate the gradient at the current weights and biases in P.\n",
+ " # The cost_grad consist now of N_hidden + 1 arrays; the gradient w.r.t the weights and biases\n",
+ " # in the hidden layers and output layers evaluated at x.\n",
+ " cost_deep_grad = cost_function_deep_grad(P, x)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_deep_grad[l]\n",
+ "\n",
+ " print('Final cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "## Set up the cost function specified for this Poisson equation:\n",
+ "\n",
+ "# The right side of the ODE\n",
+ "def f(x):\n",
+ " return (3*x + x**2)*np.exp(x)\n",
+ "\n",
+ "def cost_function_deep(P, x):\n",
+ "\n",
+ " # Evaluate the trial function with the current parameters P\n",
+ " g_t = g_trial_deep(x,P)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the trial function\n",
+ " d2_g_t = elementwise_grad(elementwise_grad(g_trial_deep,0))(x,P)\n",
+ "\n",
+ " right_side = f(x)\n",
+ "\n",
+ " err_sqr = (-d2_g_t - right_side)**2\n",
+ " cost_sum = np.sum(err_sqr)\n",
+ "\n",
+ " return cost_sum/np.size(err_sqr)\n",
+ "\n",
+ "# The trial solution:\n",
+ "def g_trial_deep(x,P):\n",
+ " return x*(1-x)*deep_neural_network(P,x)\n",
+ "\n",
+ "# The analytic solution;\n",
+ "def g_analytic(x):\n",
+ " return x*(1-x)*np.exp(x)\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " npr.seed(4155)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nx = 10\n",
+ " x = np.linspace(0,1, Nx)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = [200,100]\n",
+ " num_iter = 1000\n",
+ " lmb = 1e-3\n",
+ "\n",
+ " P = solve_ode_deep_neural_network(x, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " g_dnn_ag = g_trial_deep(x,P)\n",
+ " g_analytical = g_analytic(x)\n",
+ "\n",
+ " # Find the maximum absolute difference between the solutons:\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(x, g_analytical)\n",
+ " plt.plot(x, g_dnn_ag[0,:])\n",
+ " plt.legend(['analytical','nn'])\n",
+ " plt.xlabel('x')\n",
+ " plt.ylabel('g(x)')\n",
+ "\n",
+ " ## Perform the computation using the numerical scheme\n",
+ "\n",
+ " dx = 1/(Nx - 1)\n",
+ "\n",
+ " # Set up the matrix A\n",
+ " A = np.zeros((Nx-2,Nx-2))\n",
+ "\n",
+ " A[0,0] = 2\n",
+ " A[0,1] = -1\n",
+ "\n",
+ " for i in range(1,Nx-3):\n",
+ " A[i,i-1] = -1\n",
+ " A[i,i] = 2\n",
+ " A[i,i+1] = -1\n",
+ "\n",
+ " A[Nx - 3, Nx - 4] = -1\n",
+ " A[Nx - 3, Nx - 3] = 2\n",
+ "\n",
+ " # Set up the vector f\n",
+ " f_vec = dx**2 * f(x[1:-1])\n",
+ "\n",
+ " # Solve the equation\n",
+ " g_res = np.linalg.solve(A,f_vec)\n",
+ "\n",
+ " g_vec = np.zeros(Nx)\n",
+ " g_vec[1:-1] = g_res\n",
+ "\n",
+ " # Print the differences between each method\n",
+ " max_diff1 = np.max(np.abs(g_dnn_ag - g_analytical))\n",
+ " max_diff2 = np.max(np.abs(g_vec - g_analytical))\n",
+ " print(\"The max absolute difference between the analytical solution and DNN Autograd: %g\"%max_diff1)\n",
+ " print(\"The max absolute difference between the analytical solution and numerical scheme: %g\"%max_diff2)\n",
+ "\n",
+ " # Plot the results\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.plot(x,g_vec)\n",
+ " plt.plot(x,g_analytical)\n",
+ " plt.plot(x,g_dnn_ag[0,:])\n",
+ "\n",
+ " plt.legend(['numerical scheme','analytical','dnn'])\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "51ee4433",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Partial Differential Equations\n",
+ "\n",
+ "A partial differential equation (PDE) has a solution here the function\n",
+ "is defined by multiple variables. The equation may involve all kinds\n",
+ "of combinations of which variables the function is differentiated with\n",
+ "respect to.\n",
+ "\n",
+ "In general, a partial differential equation for a function $g(x_1,\\dots,x_N)$ with $N$ variables may be expressed as"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1ec16aab",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{PDE} \\tag{17}\n",
+ " f\\left(x_1, \\, \\dots \\, , x_N, \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_1}, \\dots , \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_N}, \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_1\\partial x_2}, \\, \\dots \\, , \\frac{\\partial^n g(x_1,\\dots,x_N) }{\\partial x_N^n} \\right) = 0\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "64fd215d",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $f$ is an expression involving all kinds of possible mixed derivatives of $g(x_1,\\dots,x_N)$ up to an order $n$. In order for the solution to be unique, some additional conditions must also be given."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3efab799",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Type of problem\n",
+ "\n",
+ "The problem our network must solve for, is similar to the ODE case.\n",
+ "We must have a trial solution $g_t$ at hand.\n",
+ "\n",
+ "For instance, the trial solution could be expressed as"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "80e6d77c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{align*}\n",
+ " g_t(x_1,\\dots,x_N) = h_1(x_1,\\dots,x_N) + h_2(x_1,\\dots,x_N,N(x_1,\\dots,x_N,P))\n",
+ "\\end{align*}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f08a42bd",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $h_1(x_1,\\dots,x_N)$ is a function that ensures $g_t(x_1,\\dots,x_N)$ satisfies some given conditions.\n",
+ "The neural network $N(x_1,\\dots,x_N,P)$ has weights and biases described by $P$ and $h_2(x_1,\\dots,x_N,N(x_1,\\dots,x_N,P))$ is an expression using the output from the neural network in some way.\n",
+ "\n",
+ "The role of the function $h_2(x_1,\\dots,x_N,N(x_1,\\dots,x_N,P))$, is to ensure that the output of $N(x_1,\\dots,x_N,P)$ is zero when $g_t(x_1,\\dots,x_N)$ is evaluated at the values of $x_1,\\dots,x_N$ where the given conditions must be satisfied. The function $h_1(x_1,\\dots,x_N)$ should alone make $g_t(x_1,\\dots,x_N)$ satisfy the conditions."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "af035b50",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Network requirements\n",
+ "\n",
+ "The network tries then the minimize the cost function following the\n",
+ "same ideas as described for the ODE case, but now with more than one\n",
+ "variables to consider. The concept still remains the same; find a set\n",
+ "of parameters $P$ such that the expression $f$ in ([17](#PDE)) is as\n",
+ "close to zero as possible.\n",
+ "\n",
+ "As for the ODE case, the cost function is the mean squared error that\n",
+ "the network must try to minimize. The cost function for the network to\n",
+ "minimize is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ee147dfb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "C\\left(x_1, \\dots, x_N, P\\right) = \\left( f\\left(x_1, \\, \\dots \\, , x_N, \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_1}, \\dots , \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_N}, \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_1\\partial x_2}, \\, \\dots \\, , \\frac{\\partial^n g(x_1,\\dots,x_N) }{\\partial x_N^n} \\right) \\right)^2\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "850e95ed",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## More details\n",
+ "\n",
+ "If we let $\\boldsymbol{x} = \\big( x_1, \\dots, x_N \\big)$ be an array containing the values for $x_1, \\dots, x_N$ respectively, the cost function can be reformulated into the following:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "96f9cca4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "C\\left(\\boldsymbol{x}, P\\right) = f\\left( \\left( \\boldsymbol{x}, \\frac{\\partial g(\\boldsymbol{x}) }{\\partial x_1}, \\dots , \\frac{\\partial g(\\boldsymbol{x}) }{\\partial x_N}, \\frac{\\partial g(\\boldsymbol{x}) }{\\partial x_1\\partial x_2}, \\, \\dots \\, , \\frac{\\partial^n g(\\boldsymbol{x}) }{\\partial x_N^n} \\right) \\right)^2\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "70394cae",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "If we also have $M$ different sets of values for $x_1, \\dots, x_N$, that is $\\boldsymbol{x}_i = \\big(x_1^{(i)}, \\dots, x_N^{(i)}\\big)$ for $i = 1,\\dots,M$ being the rows in matrix $X$, the cost function can be generalized into"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d06e6c30",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "C\\left(X, P \\right) = \\sum_{i=1}^M f\\left( \\left( \\boldsymbol{x}_i, \\frac{\\partial g(\\boldsymbol{x}_i) }{\\partial x_1}, \\dots , \\frac{\\partial g(\\boldsymbol{x}_i) }{\\partial x_N}, \\frac{\\partial g(\\boldsymbol{x}_i) }{\\partial x_1\\partial x_2}, \\, \\dots \\, , \\frac{\\partial^n g(\\boldsymbol{x}_i) }{\\partial x_N^n} \\right) \\right)^2.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b4972f88",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Example: The diffusion equation\n",
+ "\n",
+ "In one spatial dimension, the equation reads"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3d35cbd3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\frac{\\partial g(x,t)}{\\partial t} = \\frac{\\partial^2 g(x,t)}{\\partial x^2}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "984bf645",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where a possible choice of conditions are"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9d58d0ec",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{align*}\n",
+ "g(0,t) &= 0 ,\\qquad t \\geq 0 \\\\\n",
+ "g(1,t) &= 0, \\qquad t \\geq 0 \\\\\n",
+ "g(x,0) &= u(x),\\qquad x\\in [0,1]\n",
+ "\\end{align*}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "99cf8f47",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $u(x)$ being some given function."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "777ad3a8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Defining the problem\n",
+ "\n",
+ "For this case, we want to find $g(x,t)$ such that"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7182b747",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation}\n",
+ " \\frac{\\partial g(x,t)}{\\partial t} = \\frac{\\partial^2 g(x,t)}{\\partial x^2}\n",
+ "\\end{equation} \\label{diffonedim} \\tag{18}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3c40d528",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "and"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7cb1e15a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{align*}\n",
+ "g(0,t) &= 0 ,\\qquad t \\geq 0 \\\\\n",
+ "g(1,t) &= 0, \\qquad t \\geq 0 \\\\\n",
+ "g(x,0) &= u(x),\\qquad x\\in [0,1]\n",
+ "\\end{align*}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5c4bcdb5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $u(x) = \\sin(\\pi x)$.\n",
+ "\n",
+ "First, let us set up the deep neural network.\n",
+ "The deep neural network will follow the same structure as discussed in the examples solving the ODEs.\n",
+ "First, we will look into how Autograd could be used in a network tailored to solve for bivariate functions."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c84ff432",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the network using Autograd\n",
+ "\n",
+ "The only change to do here, is to extend our network such that\n",
+ "functions of multiple parameters are correctly handled. In this case\n",
+ "we have two variables in our function to solve for, that is time $t$\n",
+ "and position $x$. The variables will be represented by a\n",
+ "one-dimensional array in the program. The program will evaluate the\n",
+ "network at each possible pair $(x,t)$, given an array for the desired\n",
+ "$x$-values and $t$-values to approximate the solution at."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "id": "ba62ab4c",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # x is now a point and a 1D numpy array; make it a column vector\n",
+ " num_coordinates = np.size(x,0)\n",
+ " x = x.reshape(num_coordinates,-1)\n",
+ "\n",
+ " num_points = np.size(x,1)\n",
+ "\n",
+ " # N_hidden is the number of hidden layers\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consist of parameters to all the hidden layers AND the output layer\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output[0][0]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7fd9e6dc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the network using Autograd; The trial solution\n",
+ "\n",
+ "The cost function must then iterate through the given arrays\n",
+ "containing values for $x$ and $t$, defines a point $(x,t)$ the deep\n",
+ "neural network and the trial solution is evaluated at, and then finds\n",
+ "the Jacobian of the trial solution.\n",
+ "\n",
+ "A possible trial solution for this PDE is\n",
+ "\n",
+ "$$\n",
+ "g_t(x,t) = h_1(x,t) + x(1-x)tN(x,t,P)\n",
+ "$$\n",
+ "\n",
+ "with $A(x,t)$ being a function ensuring that $g_t(x,t)$ satisfies our given conditions, and $N(x,t,P)$ being the output from the deep neural network using weights and biases for each layer from $P$.\n",
+ "\n",
+ "To fulfill the conditions, $A(x,t)$ could be:\n",
+ "\n",
+ "$$\n",
+ "h_1(x,t) = (1-t)\\Big(u(x) - \\big((1-x)u(0) + x u(1)\\big)\\Big) = (1-t)u(x) = (1-t)\\sin(\\pi x)\n",
+ "$$\n",
+ "since $(0) = u(1) = 0$ and $u(x) = \\sin(\\pi x)$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6c63c928",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Why the jacobian?\n",
+ "\n",
+ "The Jacobian is used because the program must find the derivative of\n",
+ "the trial solution with respect to $x$ and $t$.\n",
+ "\n",
+ "This gives the necessity of computing the Jacobian matrix, as we want\n",
+ "to evaluate the gradient with respect to $x$ and $t$ (note that the\n",
+ "Jacobian of a scalar-valued multivariate function is simply its\n",
+ "gradient).\n",
+ "\n",
+ "In Autograd, the differentiation is by default done with respect to\n",
+ "the first input argument of your Python function. Since the points is\n",
+ "an array representing $x$ and $t$, the Jacobian is calculated using\n",
+ "the values of $x$ and $t$.\n",
+ "\n",
+ "To find the second derivative with respect to $x$ and $t$, the\n",
+ "Jacobian can be found for the second time. The result is a Hessian\n",
+ "matrix, which is the matrix containing all the possible second order\n",
+ "mixed derivatives of $g(x,t)$."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "id": "4192bf3d",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "# Set up the trial function:\n",
+ "def u(x):\n",
+ " return np.sin(np.pi*x)\n",
+ "\n",
+ "def g_trial(point,P):\n",
+ " x,t = point\n",
+ " return (1-t)*u(x) + x*(1-x)*t*deep_neural_network(P,point)\n",
+ "\n",
+ "# The right side of the ODE:\n",
+ "def f(point):\n",
+ " return 0.\n",
+ "\n",
+ "# The cost function:\n",
+ "def cost_function(P, x, t):\n",
+ " cost_sum = 0\n",
+ "\n",
+ " g_t_jacobian_func = jacobian(g_trial)\n",
+ " g_t_hessian_func = hessian(g_trial)\n",
+ "\n",
+ " for x_ in x:\n",
+ " for t_ in t:\n",
+ " point = np.array([x_,t_])\n",
+ "\n",
+ " g_t = g_trial(point,P)\n",
+ " g_t_jacobian = g_t_jacobian_func(point,P)\n",
+ " g_t_hessian = g_t_hessian_func(point,P)\n",
+ "\n",
+ " g_t_dt = g_t_jacobian[1]\n",
+ " g_t_d2x = g_t_hessian[0][0]\n",
+ "\n",
+ " func = f(point)\n",
+ "\n",
+ " err_sqr = ( (g_t_dt - g_t_d2x) - func)**2\n",
+ " cost_sum += err_sqr\n",
+ "\n",
+ " return cost_sum"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "87f8417d",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the network using Autograd; The full program\n",
+ "\n",
+ "Having set up the network, along with the trial solution and cost function, we can now see how the deep neural network performs by comparing the results to the analytical solution.\n",
+ "\n",
+ "The analytical solution of our problem is\n",
+ "\n",
+ "$$\n",
+ "g(x,t) = \\exp(-\\pi^2 t)\\sin(\\pi x)\n",
+ "$$\n",
+ "\n",
+ "A possible way to implement a neural network solving the PDE, is given below.\n",
+ "Be aware, though, that it is fairly slow for the parameters used.\n",
+ "A better result is possible, but requires more iterations, and thus longer time to complete.\n",
+ "\n",
+ "Indeed, the program below is not optimal in its implementation, but rather serves as an example on how to implement and use a neural network to solve a PDE.\n",
+ "Using TensorFlow results in a much better execution time. Try it!"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "id": "1572e93b",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import jacobian,hessian,grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import cm\n",
+ "from matplotlib import pyplot as plt\n",
+ "from mpl_toolkits.mplot3d import axes3d\n",
+ "\n",
+ "## Set up the network\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # x is now a point and a 1D numpy array; make it a column vector\n",
+ " num_coordinates = np.size(x,0)\n",
+ " x = x.reshape(num_coordinates,-1)\n",
+ "\n",
+ " num_points = np.size(x,1)\n",
+ "\n",
+ " # N_hidden is the number of hidden layers\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consist of parameters to all the hidden layers AND the output layer\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output[0][0]\n",
+ "\n",
+ "## Define the trial solution and cost function\n",
+ "def u(x):\n",
+ " return np.sin(np.pi*x)\n",
+ "\n",
+ "def g_trial(point,P):\n",
+ " x,t = point\n",
+ " return (1-t)*u(x) + x*(1-x)*t*deep_neural_network(P,point)\n",
+ "\n",
+ "# The right side of the ODE:\n",
+ "def f(point):\n",
+ " return 0.\n",
+ "\n",
+ "# The cost function:\n",
+ "def cost_function(P, x, t):\n",
+ " cost_sum = 0\n",
+ "\n",
+ " g_t_jacobian_func = jacobian(g_trial)\n",
+ " g_t_hessian_func = hessian(g_trial)\n",
+ "\n",
+ " for x_ in x:\n",
+ " for t_ in t:\n",
+ " point = np.array([x_,t_])\n",
+ "\n",
+ " g_t = g_trial(point,P)\n",
+ " g_t_jacobian = g_t_jacobian_func(point,P)\n",
+ " g_t_hessian = g_t_hessian_func(point,P)\n",
+ "\n",
+ " g_t_dt = g_t_jacobian[1]\n",
+ " g_t_d2x = g_t_hessian[0][0]\n",
+ "\n",
+ " func = f(point)\n",
+ "\n",
+ " err_sqr = ( (g_t_dt - g_t_d2x) - func)**2\n",
+ " cost_sum += err_sqr\n",
+ "\n",
+ " return cost_sum /( np.size(x)*np.size(t) )\n",
+ "\n",
+ "## For comparison, define the analytical solution\n",
+ "def g_analytic(point):\n",
+ " x,t = point\n",
+ " return np.exp(-np.pi**2*t)*np.sin(np.pi*x)\n",
+ "\n",
+ "## Set up a function for training the network to solve for the equation\n",
+ "def solve_pde_deep_neural_network(x,t, num_neurons, num_iter, lmb):\n",
+ " ## Set up initial weigths and biases\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weigths and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 + 1 ) # 2 since we have two points, +1 to include bias\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: ',cost_function(P, x, t))\n",
+ "\n",
+ " cost_function_grad = grad(cost_function,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " cost_grad = cost_function_grad(P, x , t)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_grad[l]\n",
+ "\n",
+ " print('Final cost: ',cost_function(P, x, t))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " ### Use the neural network:\n",
+ " npr.seed(15)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nx = 10; Nt = 10\n",
+ " x = np.linspace(0, 1, Nx)\n",
+ " t = np.linspace(0,1,Nt)\n",
+ "\n",
+ " ## Set up the parameters for the network\n",
+ " num_hidden_neurons = [100, 25]\n",
+ " num_iter = 250\n",
+ " lmb = 0.01\n",
+ "\n",
+ " P = solve_pde_deep_neural_network(x,t, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " ## Store the results\n",
+ " g_dnn_ag = np.zeros((Nx, Nt))\n",
+ " G_analytical = np.zeros((Nx, Nt))\n",
+ " for i,x_ in enumerate(x):\n",
+ " for j, t_ in enumerate(t):\n",
+ " point = np.array([x_, t_])\n",
+ " g_dnn_ag[i,j] = g_trial(point,P)\n",
+ "\n",
+ " G_analytical[i,j] = g_analytic(point)\n",
+ "\n",
+ " # Find the map difference between the analytical and the computed solution\n",
+ " diff_ag = np.abs(g_dnn_ag - G_analytical)\n",
+ " print('Max absolute difference between the analytical solution and the network: %g'%np.max(diff_ag))\n",
+ "\n",
+ " ## Plot the solutions in two dimensions, that being in position and time\n",
+ "\n",
+ " T,X = np.meshgrid(t,x)\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Solution from the deep neural network w/ %d layer'%len(num_hidden_neurons))\n",
+ " s = ax.plot_surface(T,X,g_dnn_ag,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Analytical solution')\n",
+ " s = ax.plot_surface(T,X,G_analytical,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Difference')\n",
+ " s = ax.plot_surface(T,X,diff_ag,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ " ## Take some slices of the 3D plots just to see the solutions at particular times\n",
+ " indx1 = 0\n",
+ " indx2 = int(Nt/2)\n",
+ " indx3 = Nt-1\n",
+ "\n",
+ " t1 = t[indx1]\n",
+ " t2 = t[indx2]\n",
+ " t3 = t[indx3]\n",
+ "\n",
+ " # Slice the results from the DNN\n",
+ " res1 = g_dnn_ag[:,indx1]\n",
+ " res2 = g_dnn_ag[:,indx2]\n",
+ " res3 = g_dnn_ag[:,indx3]\n",
+ "\n",
+ " # Slice the analytical results\n",
+ " res_analytical1 = G_analytical[:,indx1]\n",
+ " res_analytical2 = G_analytical[:,indx2]\n",
+ " res_analytical3 = G_analytical[:,indx3]\n",
+ "\n",
+ " # Plot the slices\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t1)\n",
+ " plt.plot(x, res1)\n",
+ " plt.plot(x,res_analytical1)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t2)\n",
+ " plt.plot(x, res2)\n",
+ " plt.plot(x,res_analytical2)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t3)\n",
+ " plt.plot(x, res3)\n",
+ " plt.plot(x,res_analytical3)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bf7afd74",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Example: Solving the wave equation with Neural Networks\n",
+ "\n",
+ "The wave equation is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fdef78b2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\frac{\\partial^2 g(x,t)}{\\partial t^2} = c^2\\frac{\\partial^2 g(x,t)}{\\partial x^2}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "be570613",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $c$ being the specified wave speed.\n",
+ "\n",
+ "Here, the chosen conditions are"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9f81e04f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{align*}\n",
+ "\tg(0,t) &= 0 \\\\\n",
+ "\tg(1,t) &= 0 \\\\\n",
+ "\tg(x,0) &= u(x) \\\\\n",
+ "\t\\frac{\\partial g(x,t)}{\\partial t} \\Big |_{t = 0} &= v(x)\n",
+ "\\end{align*}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "91171d8b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $\\frac{\\partial g(x,t)}{\\partial t} \\Big |_{t = 0}$ means the derivative of $g(x,t)$ with respect to $t$ is evaluated at $t = 0$, and $u(x)$ and $v(x)$ being given functions."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "dbbbb8a5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The problem to solve for\n",
+ "\n",
+ "The wave equation to solve for, is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3f1be58e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{wave} \\tag{19}\n",
+ "\\frac{\\partial^2 g(x,t)}{\\partial t^2} = c^2 \\frac{\\partial^2 g(x,t)}{\\partial x^2}\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d54c4188",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $c$ is the given wave speed.\n",
+ "The chosen conditions for this equation are"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "952c58e8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{aligned}\n",
+ "g(0,t) &= 0, &t \\geq 0 \\\\\n",
+ "g(1,t) &= 0, &t \\geq 0 \\\\\n",
+ "g(x,0) &= u(x), &x\\in[0,1] \\\\\n",
+ "\\frac{\\partial g(x,t)}{\\partial t}\\Big |_{t = 0} &= v(x), &x \\in [0,1]\n",
+ "\\end{aligned} \\label{condwave} \\tag{20}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a650bae2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "In this example, let $c = 1$ and $u(x) = \\sin(\\pi x)$ and $v(x) = -\\pi\\sin(\\pi x)$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9e0b8996",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The trial solution\n",
+ "Setting up the network is done in similar matter as for the example of solving the diffusion equation.\n",
+ "The only things we have to change, is the trial solution such that it satisfies the conditions from ([20](#condwave)) and the cost function.\n",
+ "\n",
+ "The trial solution becomes slightly different since we have other conditions than in the example of solving the diffusion equation. Here, a possible trial solution $g_t(x,t)$ is\n",
+ "\n",
+ "$$\n",
+ "g_t(x,t) = h_1(x,t) + x(1-x)t^2N(x,t,P)\n",
+ "$$\n",
+ "\n",
+ "where\n",
+ "\n",
+ "$$\n",
+ "h_1(x,t) = (1-t^2)u(x) + tv(x)\n",
+ "$$\n",
+ "\n",
+ "Note that this trial solution satisfies the conditions only if $u(0) = v(0) = u(1) = v(1) = 0$, which is the case in this example."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0f3f1985",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The analytical solution\n",
+ "\n",
+ "The analytical solution for our specific problem, is\n",
+ "\n",
+ "$$\n",
+ "g(x,t) = \\sin(\\pi x)\\cos(\\pi t) - \\sin(\\pi x)\\sin(\\pi t)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fbd35329",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Solving the wave equation - the full program using Autograd"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 40,
+ "id": "6ccf9344",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import hessian,grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import cm\n",
+ "from matplotlib import pyplot as plt\n",
+ "from mpl_toolkits.mplot3d import axes3d\n",
+ "\n",
+ "## Set up the trial function:\n",
+ "def u(x):\n",
+ " return np.sin(np.pi*x)\n",
+ "\n",
+ "def v(x):\n",
+ " return -np.pi*np.sin(np.pi*x)\n",
+ "\n",
+ "def h1(point):\n",
+ " x,t = point\n",
+ " return (1 - t**2)*u(x) + t*v(x)\n",
+ "\n",
+ "def g_trial(point,P):\n",
+ " x,t = point\n",
+ " return h1(point) + x*(1-x)*t**2*deep_neural_network(P,point)\n",
+ "\n",
+ "## Define the cost function\n",
+ "def cost_function(P, x, t):\n",
+ " cost_sum = 0\n",
+ "\n",
+ " g_t_hessian_func = hessian(g_trial)\n",
+ "\n",
+ " for x_ in x:\n",
+ " for t_ in t:\n",
+ " point = np.array([x_,t_])\n",
+ "\n",
+ " g_t_hessian = g_t_hessian_func(point,P)\n",
+ "\n",
+ " g_t_d2x = g_t_hessian[0][0]\n",
+ " g_t_d2t = g_t_hessian[1][1]\n",
+ "\n",
+ " err_sqr = ( (g_t_d2t - g_t_d2x) )**2\n",
+ " cost_sum += err_sqr\n",
+ "\n",
+ " return cost_sum / (np.size(t) * np.size(x))\n",
+ "\n",
+ "## The neural network\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # x is now a point and a 1D numpy array; make it a column vector\n",
+ " num_coordinates = np.size(x,0)\n",
+ " x = x.reshape(num_coordinates,-1)\n",
+ "\n",
+ " num_points = np.size(x,1)\n",
+ "\n",
+ " # N_hidden is the number of hidden layers\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consist of parameters to all the hidden layers AND the output layer\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output[0][0]\n",
+ "\n",
+ "## The analytical solution\n",
+ "def g_analytic(point):\n",
+ " x,t = point\n",
+ " return np.sin(np.pi*x)*np.cos(np.pi*t) - np.sin(np.pi*x)*np.sin(np.pi*t)\n",
+ "\n",
+ "def solve_pde_deep_neural_network(x,t, num_neurons, num_iter, lmb):\n",
+ " ## Set up initial weigths and biases\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weigths and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 + 1 ) # 2 since we have two points, +1 to include bias\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: ',cost_function(P, x, t))\n",
+ "\n",
+ " cost_function_grad = grad(cost_function,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " cost_grad = cost_function_grad(P, x , t)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_grad[l]\n",
+ "\n",
+ "\n",
+ " print('Final cost: ',cost_function(P, x, t))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " ### Use the neural network:\n",
+ " npr.seed(15)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nx = 10; Nt = 10\n",
+ " x = np.linspace(0, 1, Nx)\n",
+ " t = np.linspace(0,1,Nt)\n",
+ "\n",
+ " ## Set up the parameters for the network\n",
+ " num_hidden_neurons = [50,20]\n",
+ " num_iter = 1000\n",
+ " lmb = 0.01\n",
+ "\n",
+ " P = solve_pde_deep_neural_network(x,t, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " ## Store the results\n",
+ " res = np.zeros((Nx, Nt))\n",
+ " res_analytical = np.zeros((Nx, Nt))\n",
+ " for i,x_ in enumerate(x):\n",
+ " for j, t_ in enumerate(t):\n",
+ " point = np.array([x_, t_])\n",
+ " res[i,j] = g_trial(point,P)\n",
+ "\n",
+ " res_analytical[i,j] = g_analytic(point)\n",
+ "\n",
+ " diff = np.abs(res - res_analytical)\n",
+ " print(\"Max difference between analytical and solution from nn: %g\"%np.max(diff))\n",
+ "\n",
+ " ## Plot the solutions in two dimensions, that being in position and time\n",
+ "\n",
+ " T,X = np.meshgrid(t,x)\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Solution from the deep neural network w/ %d layer'%len(num_hidden_neurons))\n",
+ " s = ax.plot_surface(T,X,res,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Analytical solution')\n",
+ " s = ax.plot_surface(T,X,res_analytical,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Difference')\n",
+ " s = ax.plot_surface(T,X,diff,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ " ## Take some slices of the 3D plots just to see the solutions at particular times\n",
+ " indx1 = 0\n",
+ " indx2 = int(Nt/2)\n",
+ " indx3 = Nt-1\n",
+ "\n",
+ " t1 = t[indx1]\n",
+ " t2 = t[indx2]\n",
+ " t3 = t[indx3]\n",
+ "\n",
+ " # Slice the results from the DNN\n",
+ " res1 = res[:,indx1]\n",
+ " res2 = res[:,indx2]\n",
+ " res3 = res[:,indx3]\n",
+ "\n",
+ " # Slice the analytical results\n",
+ " res_analytical1 = res_analytical[:,indx1]\n",
+ " res_analytical2 = res_analytical[:,indx2]\n",
+ " res_analytical3 = res_analytical[:,indx3]\n",
+ "\n",
+ " # Plot the slices\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t1)\n",
+ " plt.plot(x, res1)\n",
+ " plt.plot(x,res_analytical1)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t2)\n",
+ " plt.plot(x, res2)\n",
+ " plt.plot(x,res_analytical2)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t3)\n",
+ " plt.plot(x, res3)\n",
+ " plt.plot(x,res_analytical3)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "988e09cf",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Resources on differential equations and deep learning\n",
+ "\n",
+ "1. [Artificial neural networks for solving ordinary and partial differential equations by I.E. Lagaris et al](https://pdfs.semanticscholar.org/d061/df393e0e8fbfd0ea24976458b7d42419040d.pdf)\n",
+ "\n",
+ "2. [Neural networks for solving differential equations by A. Honchar](https://becominghuman.ai/neural-networks-for-solving-differential-equations-fa230ac5e04c)\n",
+ "\n",
+ "3. [Solving differential equations using neural networks by M.M Chiaramonte and M. Kiener](http://cs229.stanford.edu/proj2013/ChiaramonteKiener-SolvingDifferentialEquationsUsingNeuralNetworks.pdf)\n",
+ "\n",
+ "4. [Introduction to Partial Differential Equations by A. Tveito, R. Winther](https://www.springer.com/us/book/9783540225515)"
+ ]
+ }
+ ],
+ "metadata": {},
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/doc/LectureNotes/_build/html/chapter1.html b/doc/LectureNotes/_build/html/chapter1.html
index 97d9d2466..d8a8b2f91 100644
--- a/doc/LectureNotes/_build/html/chapter1.html
+++ b/doc/LectureNotes/_build/html/chapter1.html
@@ -257,6 +257,9 @@
+Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations
+Exercises week 43
+
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
@@ -932,11 +935,11 @@ document.write(`
next
-
Project 1 on Machine Learning, deadline October 6 (midnight), 2025
+
Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations
diff --git a/doc/LectureNotes/_build/html/exercisesweek43.html b/doc/LectureNotes/_build/html/exercisesweek43.html
new file mode 100644
index 000000000..8d4bd1b6b
--- /dev/null
+++ b/doc/LectureNotes/_build/html/exercisesweek43.html
@@ -0,0 +1,846 @@
+
+
+
+
+
+
+
+
+
+
+ Exercises week 43 — Applied Data Analysis and Machine Learning
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Exercises week 43
+
+
+
+
+
+
Contents
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Exercises week 43
+October 20-24, 2025
+Date: Deadline Friday October 24 at midnight
+
+
+Overarching aims of the exercises weeks 43 and 44
+The aim of the exercises this week is to gain some confidence with
+ways to visualize the results of a classification problem. We will
+target three ways of setting up the analysis. The first and simplest
+one is the
+
+so-called confusion matrix, and the next is the
+ROC curve and finally the
+Cumulative gain curve.
+
+We will use Logistic Regression as method for the classification in
+this exercise. You can compare these results with those obtained with
+your neural network code from project 2 without a hidden layer.
+In these exercises we will use binary and multi-class data sets
+(the Iris data set from week 41).
+The underlying mathematics is described here.
+
+Confusion Matrix
+A confusion matrix summarizes a classifier’s performance by
+tabulating predictions versus true labels. For binary classification,
+it is a \(2\times2\) table whose entries are counts of outcomes:
+
+\[\begin{split}
+\begin{array}{l|cc} & \text{Predicted Positive} & \text{Predicted Negative} \\ \hline \text{Actual Positive} & TP & FN \\ \text{Actual Negative} & FP & TN \end{array}.
+\end{split}\]
+Here TP (true positives) is the number of cases correctly predicted as
+positive, FP (false positives) is the number incorrectly predicted as
+positive, TN (true negatives) is correctly predicted negative, and FN
+(false negatives) is incorrectly predicted negative . In other words,
+“positive” means class 1 and “negative” means class 0; for example, TP
+occurs when the prediction and actual are both positive. Formally:
+
+\[
+\text{TPR} = \frac{\text{TP}}{\text{TP} + \text{FN}}, \quad \text{FPR} = \frac{\text{FP}}{\text{FP} + \text{TN}},
+\]
+where TPR and FPR are the true and false positive rates defined below.
+In multiclass classification with \(K\) classes, the confusion matrix
+generalizes to a \(K\times K\) table. Entry \(N_{ij}\) in the table is
+the count of instances whose true class is \(i\) and whose predicted
+class is \(j\) . For example, a three-class confusion matrix can be written
+as:
+
+\[\begin{split}
+\begin{array}{c|ccc} & \text{Pred Class 1} & \text{Pred Class 2} & \text{Pred Class 3} \\ \hline \text{Act Class 1} & N_{11} & N_{12} & N_{13} \\ \text{Act Class 2} & N_{21} & N_{22} & N_{23} \\ \text{Act Class 3} & N_{31} & N_{32} & N_{33} \end{array}.
+\end{split}\]
+Here the diagonal entries \(N_{ii}\) are the true positives for each
+class, and off-diagonal entries are misclassifications. This matrix
+allows computation of per-class metrics: e.g. for class \(i\) ,
+\(\mathrm{TP}_i=N_{ii}\) , \(\mathrm{FN}_i=\sum_{j\neq i}N_{ij}\) ,
+\(\mathrm{FP}_i=\sum_{j\neq i}N_{ji}\) , and \(\mathrm{TN}_i\) is the sum of
+all remaining entries.
+As defined above, TPR and FPR come from the binary case. In binary
+terms with \(P\) actual positives and \(N\) actual negatives, one has
+
+\[
+\text{TPR} = \frac{TP}{P} = \frac{TP}{TP+FN}, \quad \text{FPR} =
+\frac{FP}{N} = \frac{FP}{FP+TN},
+\]
+as used in standard confusion-matrix
+formulations. These rates will be used in constructing ROC curves.
+
+
+ROC Curve
+The Receiver Operating Characteristic (ROC) curve plots the trade-off
+between true positives and false positives as a discrimination
+threshold varies. Specifically, for a binary classifier that outputs
+a score or probability, one varies the threshold \(t\) for declaring
+positive , and computes at each \(t\) the true positive rate
+\(\mathrm{TPR}(t)\) and false positive rate \(\mathrm{FPR}(t)\) using the
+confusion matrix at that threshold. The ROC curve is then the graph
+of TPR versus FPR. By definition,
+
+\[
+\mathrm{TPR} = \frac{TP}{TP+FN}, \qquad \mathrm{FPR} = \frac{FP}{FP+TN},
+\]
+where \(TP,FP,TN,FN\) are counts determined by threshold \(t\) . A perfect
+classifier would reach the point (FPR=0, TPR=1) at some threshold.
+Formally, the ROC curve is obtained by plotting
+\((\mathrm{FPR}(t),\mathrm{TPR}(t))\) for all \(t\in[0,1]\) (or as \(t\)
+sweeps through the sorted scores). The Area Under the ROC Curve (AUC)
+quantifies the average performance over all thresholds. It can be
+interpreted probabilistically: \(\mathrm{AUC} =
+\Pr\bigl(s(X^+)>s(X^-)\bigr)\) , the probability that a random positive
+instance \(X^+\) receives a higher score \(s\) than a random negative
+instance \(X^-\) . Equivalently, the AUC is the integral under the ROC
+curve:
+
+\[
+\mathrm{AUC} \;=\; \int_{0}^{1} \mathrm{TPR}(f)\,df,
+\]
+where \(f\) ranges over FPR (or fraction of negatives). A model that guesses at random yields a diagonal ROC (AUC=0.5), whereas a perfect model yields AUC=1.0.
+
+
+Cumulative Gain
+The cumulative gain curve (or gains chart) evaluates how many
+positives are captured as one targets an increasing fraction of the
+population, sorted by model confidence. To construct it, sort all
+instances by decreasing predicted probability of the positive class.
+Then, for the top \(\alpha\) fraction of instances, compute the fraction
+of all actual positives that fall in this subset. In formula form, if
+\(P\) is the total number of positive instances and \(P(\alpha)\) is the
+number of positives among the top \(\alpha\) of the data, the cumulative
+gain at level \(\alpha\) is
+
+\[
+\mathrm{Gain}(\alpha) \;=\; \frac{P(\alpha)}{P}.
+\]
+For example, cutting off at the top 10% of predictions yields a gain
+equal to (positives in top 10%) divided by (total positives) .
+Plotting \(\mathrm{Gain}(\alpha)\) versus \(\alpha\) (often in percent)
+gives the gain curve. The baseline (random) curve is the diagonal
+\(\mathrm{Gain}(\alpha)=\alpha\) , while an ideal model has a steep climb
+toward 1.
+A related measure is the {\em lift}, often called the gain ratio. It is the ratio of the model’s capture rate to that of random selection. Equivalently,
+
+\[
+\mathrm{Lift}(\alpha) \;=\; \frac{\mathrm{Gain}(\alpha)}{\alpha}.
+\]
+A lift \(>1\) indicates better-than-random targeting. In practice, gain
+and lift charts (used e.g.\ in marketing or imbalanced classification)
+show how many positives can be “gained” by focusing on a fraction of
+the population .
+
+
+Other measures: Precision, Recall, and the F\(_1\) Measure
+Precision and recall (sensitivity) quantify binary classification
+accuracy in terms of positive predictions. They are defined from the
+confusion matrix as:
+
+\[
+\text{Precision} = \frac{TP}{TP + FP}, \qquad \text{Recall} = \frac{TP}{TP + FN}.
+\]
+Precision is the fraction of predicted positives that are correct, and
+recall is the fraction of actual positives that are correctly
+identified . A high-precision classifier makes few false-positive
+errors, while a high-recall classifier makes few false-negative
+errors.
+The F\(_1\) score (balanced F-measure) combines precision and recall into a single metric via their harmonic mean. The usual formula is:
+
+\[
+F_1 =2\frac{\text{Precision}\times\text{Recall}}{\text{Precision} + \text{Recall}}.
+\]
+This can be shown to equal
+
+\[
+\frac{2\,TP}{2\,TP + FP + FN}.
+\]
+The F\(_1\) score ranges from 0 (worst) to 1 (best), and balances the
+trade-off between precision and recall.
+For multi-class classification, one computes per-class
+precision/recall/F\(_1\) (treating each class as “positive” in a
+one-vs-rest manner) and then averages. Common averaging methods are:
+Micro-averaging: Sum all true positives, false positives, and false negatives across classes, then compute precision/recall/F\(_1\) from these totals.
+Macro-averaging: Compute the F\(1\) score \(F{1,i}\) for each class \(i\) separately, then take the unweighted mean: \(F_{1,\mathrm{macro}} = \frac{1}{K}\sum_{i=1}^K F_{1,i}\) . This treats all classes equally regardless of size.
+Weighted-averaging: Like macro-average, but weight each class’s \(F_{1,i}\) by its support \(n_i\) (true count): \(F_{1,\mathrm{weighted}} = \frac{1}{N}\sum_{i=1}^K n_i F_{1,i}\) , where \(N=\sum_i n_i\) . This accounts for class imbalance by giving more weight to larger classes .
+Each of these averages has different use-cases. Micro-average is
+dominated by common classes, macro-average highlights performance on
+rare classes, and weighted-average is a compromise. These formulas
+and concepts allow rigorous evaluation of classifier performance in
+both binary and multi-class settings.
+
+
+Exercises
+Here is a simple code example which uses the Logistic regression machinery from scikit-learn .
+At the end it sets up the confusion matrix and the ROC and cumulative gain curves.
+Feel free to use these functionalities (we don’t expect you to write your own code for say the confusion matrix).
+
+
+Exercise a)
+Convince yourself about the mathematics for the confusion matrix, the ROC and the cumlative gain curves for both a binary and a multiclass classification problem.
+
+
+Exercise b)
+Use a binary classification data available from scikit-learn . As an example you can use
+the MNIST data set and just specialize to two numbers. To do so you can use the following code lines
+
+Alternatively, you can use the make\(\_\) classification
+functionality. This function generates a random \(n\) -class classification
+dataset, which can be configured for binary classification by setting
+n_classes=2. You can also control the number of samples, features,
+informative features, redundant features, and more.
+
+You can use this option for the multiclass case as well, see the next exercise.
+If you prefer to study other binary classification datasets, feel free
+to replace the above suggestions with your own dataset.
+Make plots of the confusion matrix, the ROC curve and the cumulative gain curve.
+
+
+Exercise c) week 43
+As a multiclass problem, we will use the Iris data set discussed in
+the exercises from weeks 41 and 42. This is a three-class data set and
+you can set it up using scikit-learn ,
+
+Make plots of the confusion matrix, the ROC curve and the cumulative
+gain curve for this (or other) multiclass data set.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/LectureNotes/_build/html/genindex.html b/doc/LectureNotes/_build/html/genindex.html
index 9d1273c53..e62a52710 100644
--- a/doc/LectureNotes/_build/html/genindex.html
+++ b/doc/LectureNotes/_build/html/genindex.html
@@ -254,6 +254,9 @@
+Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations
+Exercises week 43
+
Projects
Projects
Projects
diff --git a/doc/LectureNotes/_build/html/objects.inv b/doc/LectureNotes/_build/html/objects.inv
index 926574896..1b6dac0ca 100644
Binary files a/doc/LectureNotes/_build/html/objects.inv and b/doc/LectureNotes/_build/html/objects.inv differ
diff --git a/doc/LectureNotes/_build/html/project1.html b/doc/LectureNotes/_build/html/project1.html
index f6468fcdc..f859e52a8 100644
--- a/doc/LectureNotes/_build/html/project1.html
+++ b/doc/LectureNotes/_build/html/project1.html
@@ -63,7 +63,7 @@
-
+
@@ -257,6 +257,9 @@
+Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations
+Exercises week 43
+
Projects
@@ -808,12 +811,12 @@ of code developers and contributors keeps increasing.
previous
-
Exercises week 42
+
Exercises week 43
Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations
+
Exercises week 43
+
Projects
Projects
Projects
diff --git a/doc/LectureNotes/_build/html/searchindex.js b/doc/LectureNotes/_build/html/searchindex.js
index b4bfdece5..3b84933cb 100644
--- a/doc/LectureNotes/_build/html/searchindex.js
+++ b/doc/LectureNotes/_build/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({"alltitles": {"1a)": [[18, "a"]], "3a)": [[18, "id1"]], "3b)": [[18, "b"]], "4a)": [[18, "id2"]], "4b)": [[18, "id3"]], "A Classification Tree": [[9, "a-classification-tree"]], "A Frequentist approach to data analysis": [[0, "a-frequentist-approach-to-data-analysis"], [31, "a-frequentist-approach-to-data-analysis"]], "A better approach": [[8, "a-better-approach"]], "A first summary": [[31, "a-first-summary"]], "A more compact expression": [[36, "a-more-compact-expression"], [37, "a-more-compact-expression"]], "A new Cost Function": [[35, "a-new-cost-function"]], "A quick Reminder on Lagrangian Multipliers": [[8, "a-quick-reminder-on-lagrangian-multipliers"]], "A simple example": [[4, "a-simple-example"]], "A soft classifier": [[8, "a-soft-classifier"]], "A top-down perspective on Neural networks": [[1, "a-top-down-perspective-on-neural-networks"], [39, "a-top-down-perspective-on-neural-networks"]], "A way to Read the Bias-Variance Tradeoff": [[35, "a-way-to-read-the-bias-variance-tradeoff"], [36, "a-way-to-read-the-bias-variance-tradeoff"]], "ADAM algorithm, taken from Goodfellow et al": [[34, "adam-algorithm-taken-from-goodfellow-et-al"]], "ADAM optimizer": [[13, "adam-optimizer"], [34, "id2"]], "Accuracy": [[34, "accuracy"]], "Activation functions": [[12, "activation-functions"], [37, "activation-functions"], [39, "activation-functions"], [39, "id3"]], "Activation functions, Logistic and Hyperbolic ones": [[37, "activation-functions-logistic-and-hyperbolic-ones"], [39, "activation-functions-logistic-and-hyperbolic-ones"]], "AdaGrad Properties": [[34, "adagrad-properties"]], "AdaGrad Update Rule Derivation": [[34, "adagrad-update-rule-derivation"]], "AdaGrad algorithm, taken from Goodfellow et al": [[34, "adagrad-algorithm-taken-from-goodfellow-et-al"]], "Adam Optimizer": [[34, "adam-optimizer"]], "Adam vs. AdaGrad and RMSProp": [[34, "adam-vs-adagrad-and-rmsprop"]], "Adam: Bias Correction": [[34, "adam-bias-correction"]], "Adam: Exponential Moving Averages (Moments)": [[34, "adam-exponential-moving-averages-moments"]], "Adam: Update Rule Derivation": [[34, "adam-update-rule-derivation"]], "Adaptive boosting: AdaBoost, Basic Algorithm": [[10, "adaptive-boosting-adaboost-basic-algorithm"]], "Adaptivity Across Dimensions": [[34, "adaptivity-across-dimensions"]], "Adding Neural Networks": [[37, "adding-neural-networks"]], "Adding a hidden layer": [[38, "adding-a-hidden-layer"], [39, "adding-a-hidden-layer"]], "Adding error analysis and training set up": [[31, "adding-error-analysis-and-training-set-up"], [32, "adding-error-analysis-and-training-set-up"]], "Adjust hyperparameters": [[1, "adjust-hyperparameters"], [39, "adjust-hyperparameters"]], "Algorithms and codes for Adagrad, RMSprop and Adam": [[34, "algorithms-and-codes-for-adagrad-rmsprop-and-adam"]], "Algorithms for Setting up Decision Trees": [[9, "algorithms-for-setting-up-decision-trees"]], "An Overview of Ensemble Methods": [[10, "an-overview-of-ensemble-methods"]], "An extrapolation example": [[4, "an-extrapolation-example"]], "An optimization/minimization problem": [[31, "an-optimization-minimization-problem"]], "Analyzing the last results": [[38, "analyzing-the-last-results"], [39, "analyzing-the-last-results"]], "And finally \\boldsymbol{X}\\boldsymbol{X}^T": [[32, "and-finally-boldsymbol-x-boldsymbol-x-t"]], "And finally ADAM": [[34, "and-finally-adam"]], "And what about using neural networks?": [[31, "and-what-about-using-neural-networks"]], "Another Example from Scikit-Learn\u2019s Repository": [[35, "another-example-from-scikit-learn-s-repository"], [36, "another-example-from-scikit-learn-s-repository"]], "Another Example, now with a polynomial fit": [[33, "another-example-now-with-a-polynomial-fit"]], "Another example, the moons again": [[9, "another-example-the-moons-again"]], "Applied Data Analysis and Machine Learning": [[23, null]], "Artificial neurons": [[37, "artificial-neurons"], [38, "artificial-neurons"]], "Assumptions made": [[35, "assumptions-made"]], "Autocorrelation function": [[28, "autocorrelation-function"]], "Automatic differentiation": [[13, "automatic-differentiation"], [38, "automatic-differentiation"]], "Automatic differentiation through examples": [[38, "automatic-differentiation-through-examples"]], "Back to Ridge and LASSO Regression": [[32, "back-to-ridge-and-lasso-regression"], [33, "back-to-ridge-and-lasso-regression"]], "Back to the Cancer Data": [[11, "back-to-the-cancer-data"]], "Background literature": [[25, "background-literature"], [26, "background-literature"]], "Bagging": [[10, "bagging"]], "Bagging Examples": [[10, "bagging-examples"]], "Basic Matrix Features": [[24, "basic-matrix-features"]], "Basic ideas of the Principal Component Analysis (PCA)": [[11, null]], "Basic math of the SVD": [[5, "basic-math-of-the-svd"], [32, "basic-math-of-the-svd"], [33, "basic-math-of-the-svd"]], "Basics": [[7, "basics"], [36, "basics"], [37, "basics"]], "Basics of a tree": [[9, "basics-of-a-tree"]], "Basics of an NN": [[38, "basics-of-an-nn"]], "Batch Normalization": [[1, "batch-normalization"], [39, "batch-normalization"]], "Batches and mini-batches": [[34, "batches-and-mini-batches"]], "Bayes\u2019 Theorem and Ridge and Lasso Regression": [[5, "bayes-theorem-and-ridge-and-lasso-regression"]], "Boosting, a Bird\u2019s Eye View": [[10, "boosting-a-bird-s-eye-view"]], "Bootstrap": [[6, "bootstrap"]], "Bringing it together": [[38, "bringing-it-together"], [39, "bringing-it-together"]], "Bringing it together, first back propagation equation": [[12, "bringing-it-together-first-back-propagation-equation"]], "Building a Feed Forward Neural Network": [[1, null]], "Building a neural network code": [[39, "building-a-neural-network-code"]], "Building a tree, regression": [[9, "building-a-tree-regression"]], "Building neural networks in Tensorflow and Keras": [[1, "building-neural-networks-in-tensorflow-and-keras"], [39, "building-neural-networks-in-tensorflow-and-keras"]], "But none of these can compete with Newton\u2019s method": [[34, "but-none-of-these-can-compete-with-newton-s-method"]], "CNNs in more detail, building convolutional neural networks in Tensorflow and Keras": [[3, "cnns-in-more-detail-building-convolutional-neural-networks-in-tensorflow-and-keras"]], "Cancer Data again now with Decision Trees and other Methods": [[9, "cancer-data-again-now-with-decision-trees-and-other-methods"]], "Chain rule": [[38, "chain-rule"]], "Chain rule, forward and reverse modes": [[38, "chain-rule-forward-and-reverse-modes"]], "Challenge: Choosing a Fixed Learning Rate": [[34, "challenge-choosing-a-fixed-learning-rate"]], "Choose cost function and optimizer": [[1, "choose-cost-function-and-optimizer"], [39, "choose-cost-function-and-optimizer"]], "Class of functions we can approximate": [[38, "class-of-functions-we-can-approximate"]], "Classical PCA Theorem": [[11, "classical-pca-theorem"]], "Classification and Regression, writing our own neural network code": [[26, "classification-and-regression-writing-our-own-neural-network-code"]], "Classification problems": [[36, "classification-problems"], [37, "classification-problems"]], "Clustering and Unsupervised Learning": [[14, null]], "Code Example for Cross-validation and k-fold Cross-validation": [[35, "code-example-for-cross-validation-and-k-fold-cross-validation"], [36, "code-example-for-cross-validation-and-k-fold-cross-validation"]], "Code example": [[38, "code-example"], [39, "code-example"]], "Code example for the Bootstrap method": [[35, "code-example-for-the-bootstrap-method"]], "Code for SVD and Inversion of Matrices": [[5, "code-for-svd-and-inversion-of-matrices"]], "Code with a Number of Minibatches which varies": [[34, "code-with-a-number-of-minibatches-which-varies"]], "Codes and Approaches": [[14, "codes-and-approaches"]], "Codes for the SVD": [[5, "codes-for-the-svd"], [32, "codes-for-the-svd"], [33, "codes-for-the-svd"]], "Coding Setup and Linear Regression": [[15, "coding-setup-and-linear-regression"]], "Collect and pre-process data": [[1, "collect-and-pre-process-data"], [39, "collect-and-pre-process-data"], [39, "id2"]], "Communication channels": [[31, "communication-channels"]], "Compact expressions": [[38, "compact-expressions"], [39, "compact-expressions"]], "Compare Bagging on Trees with Random Forests": [[10, "compare-bagging-on-trees-with-random-forests"]], "Comparing with a numerical scheme": [[2, "comparing-with-a-numerical-scheme"]], "Comparison with OLS": [[33, "comparison-with-ols"]], "Completing the list": [[38, "completing-the-list"], [39, "completing-the-list"]], "Computation of gradients": [[34, "computation-of-gradients"]], "Computing the Gini index": [[9, "computing-the-gini-index"]], "Conditions on convex functions": [[33, "conditions-on-convex-functions"]], "Confidence Intervals": [[35, "confidence-intervals"]], "Conjugate gradient method": [[13, "conjugate-gradient-method"]], "Convergence rates": [[34, "convergence-rates"]], "Convex function": [[33, "convex-function"]], "Convex functions": [[13, "convex-functions"], [33, "convex-functions"]], "Convolution Examples: Polynomial multiplication": [[3, "convolution-examples-polynomial-multiplication"]], "Convolution Examples: Principle of Superposition and Periodic Forces (Fourier Transforms)": [[3, "convolution-examples-principle-of-superposition-and-periodic-forces-fourier-transforms"]], "Convolutional Neural Network": [[12, "convolutional-neural-network"], [37, "convolutional-neural-network"], [38, "convolutional-neural-network"]], "Convolutional Neural Networks": [[3, null]], "Correlation Function and Design/Feature Matrix": [[32, "correlation-function-and-design-feature-matrix"]], "Correlation Matrix": [[11, "correlation-matrix"], [32, "correlation-matrix"]], "Correlation Matrix with Pandas": [[32, "correlation-matrix-with-pandas"]], "Cost functions": [[39, "cost-functions"]], "Counting the number of floating point operations": [[38, "counting-the-number-of-floating-point-operations"]], "Course Format": [[31, "course-format"]], "Course setting": [[27, null]], "Covariance Matrix Examples": [[32, "covariance-matrix-examples"]], "Covariance and Correlation Matrix": [[32, "covariance-and-correlation-matrix"]], "Cross-validation": [[6, "cross-validation"]], "Cross-validation in brief": [[35, "cross-validation-in-brief"], [36, "cross-validation-in-brief"]], "Deadlines for projects (tentative)": [[31, "deadlines-for-projects-tentative"]], "Decision trees, overarching aims": [[9, null]], "Deep Neural Networks": [[34, "deep-neural-networks"]], "Deep learning methods": [[31, "deep-learning-methods"]], "Define model and architecture": [[1, "define-model-and-architecture"], [39, "define-model-and-architecture"]], "Defining intermediate operations": [[38, "defining-intermediate-operations"]], "Defining the cost function": [[1, "defining-the-cost-function"], [39, "defining-the-cost-function"]], "Definitions": [[19, "definitions"], [38, "definitions"], [39, "definitions"]], "Deliverables": [[15, "deliverables"], [16, "deliverables"], [19, "deliverables"], [20, "deliverables"], [25, "deliverables"], [26, "deliverables"]], "Derivation of the AdaGrad Algorithm": [[34, "derivation-of-the-adagrad-algorithm"]], "Derivative of the cost function": [[38, "derivative-of-the-cost-function"], [39, "derivative-of-the-cost-function"]], "Derivatives and the chain rule": [[12, "derivatives-and-the-chain-rule"], [38, "derivatives-and-the-chain-rule"], [39, "derivatives-and-the-chain-rule"]], "Derivatives in terms of z_j^L": [[38, "derivatives-in-terms-of-z-j-l"], [39, "derivatives-in-terms-of-z-j-l"]], "Derivatives of the hidden layer": [[38, "derivatives-of-the-hidden-layer"], [39, "derivatives-of-the-hidden-layer"]], "Derivatives, example 1": [[32, "derivatives-example-1"]], "Deriving OLS from a probability distribution": [[5, "deriving-ols-from-a-probability-distribution"], [35, "deriving-ols-from-a-probability-distribution"]], "Deriving and Implementing Ordinary Least Squares": [[16, "deriving-and-implementing-ordinary-least-squares"]], "Deriving and Implementing Ridge Regression": [[17, "deriving-and-implementing-ridge-regression"]], "Deriving the Lasso Regression Equations": [[32, "deriving-the-lasso-regression-equations"], [33, "deriving-the-lasso-regression-equations"], [33, "id6"]], "Deriving the Ridge Regression Equations": [[32, "deriving-the-ridge-regression-equations"], [33, "deriving-the-ridge-regression-equations"], [33, "id3"]], "Deriving the back propagation code for a multilayer perceptron model": [[12, "deriving-the-back-propagation-code-for-a-multilayer-perceptron-model"]], "Developing a code for doing neural networks with back propagation": [[1, "developing-a-code-for-doing-neural-networks-with-back-propagation"], [39, "developing-a-code-for-doing-neural-networks-with-back-propagation"]], "Diagonalize the sample covariance matrix to obtain the principal components": [[11, "diagonalize-the-sample-covariance-matrix-to-obtain-the-principal-components"]], "Different kernels and Mercer\u2019s theorem": [[8, "different-kernels-and-mercer-s-theorem"]], "Disadvantages": [[9, "disadvantages"]], "Discriminative Modeling": [[31, "discriminative-modeling"]], "Discussing the correlation data": [[37, "discussing-the-correlation-data"]], "Does Logistic Regression do a better Job?": [[37, "does-logistic-regression-do-a-better-job"]], "Domains and probabilities": [[28, "domains-and-probabilities"]], "Dropout": [[1, "dropout"], [39, "dropout"]], "ELU function": [[39, "elu-function"]], "Economy-size SVD": [[32, "economy-size-svd"], [33, "economy-size-svd"]], "Elements of Probability Theory and Statistical Data Analysis": [[28, null]], "Empirical Evidence: Convergence Time and Memory in Practice": [[34, "empirical-evidence-convergence-time-and-memory-in-practice"]], "Ensemble Methods: From a Single Tree to Many Trees and Extreme Boosting, Meet the Jungle of Methods": [[10, null]], "Entropy and the ID3 algorithm": [[9, "entropy-and-the-id3-algorithm"]], "Essential elements of ML": [[31, "essential-elements-of-ml"]], "Evaluate model performance on test data": [[1, "evaluate-model-performance-on-test-data"], [39, "evaluate-model-performance-on-test-data"]], "Example 2": [[32, "example-2"]], "Example 3": [[32, "example-3"]], "Example 4": [[32, "example-4"]], "Example Matrix": [[32, "example-matrix"], [33, "example-matrix"]], "Example code for Bias-Variance tradeoff": [[35, "example-code-for-bias-variance-tradeoff"]], "Example code for Logistic Regression": [[36, "example-code-for-logistic-regression"], [37, "example-code-for-logistic-regression"]], "Example of discriminative modeling, taken from Generative Deep Learning by David Foster": [[31, "example-of-discriminative-modeling-taken-from-generative-deep-learning-by-david-foster"]], "Example of generative modeling, taken from Generative Deep Learning by David Foster": [[31, "example-of-generative-modeling-taken-from-generative-deep-learning-by-david-foster"]], "Example of own Standard scaling": [[32, "example-of-own-standard-scaling"]], "Example relevant for the exercises": [[32, "example-relevant-for-the-exercises"]], "Example: Exponential decay": [[2, "example-exponential-decay"]], "Example: Population growth": [[2, "example-population-growth"]], "Example: The diffusion equation": [[2, "example-the-diffusion-equation"]], "Example: binary classification problem": [[1, "example-binary-classification-problem"], [39, "example-binary-classification-problem"]], "Examples": [[31, "examples"]], "Examples of XOR, OR and AND gates": [[37, "examples-of-xor-or-and-and-gates"]], "Examples of likelihood functions used in logistic regression and neural networks": [[7, "examples-of-likelihood-functions-used-in-logistic-regression-and-neural-networks"]], "Examples of likelihood functions used in logistic regression and nueral networks": [[36, "examples-of-likelihood-functions-used-in-logistic-regression-and-nueral-networks"]], "Exercise 1": [[21, "exercise-1"]], "Exercise 1 - Choice of model and degrees of freedom": [[17, "exercise-1-choice-of-model-and-degrees-of-freedom"]], "Exercise 1 - Finding the derivative of Matrix-Vector expressions": [[16, "exercise-1-finding-the-derivative-of-matrix-vector-expressions"]], "Exercise 1 - Github Setup": [[15, "exercise-1-github-setup"]], "Exercise 1 - Understand the feed forward pass": [[22, "exercise-1-understand-the-feed-forward-pass"]], "Exercise 1, scale your data": [[18, "exercise-1-scale-your-data"]], "Exercise 1: Creating the report document": [[20, "exercise-1-creating-the-report-document"]], "Exercise 1: Expectation values for ordinary least squares expressions": [[19, "exercise-1-expectation-values-for-ordinary-least-squares-expressions"]], "Exercise 1: Including more data": [[38, "exercise-1-including-more-data"]], "Exercise 1: Setting up various Python environments": [[0, "exercise-1-setting-up-various-python-environments"]], "Exercise 2": [[21, "exercise-2"]], "Exercise 2 - Deriving the expression for OLS": [[16, "exercise-2-deriving-the-expression-for-ols"]], "Exercise 2 - Deriving the expression for Ridge Regression": [[17, "exercise-2-deriving-the-expression-for-ridge-regression"]], "Exercise 2 - Gradient with one layer using autograd": [[22, "exercise-2-gradient-with-one-layer-using-autograd"]], "Exercise 2 - Setting up a Github repository": [[15, "exercise-2-setting-up-a-github-repository"]], "Exercise 2, calculate the gradients": [[18, "exercise-2-calculate-the-gradients"]], "Exercise 2: Adding good figures": [[20, "exercise-2-adding-good-figures"]], "Exercise 2: Expectation values for Ridge regression": [[19, "exercise-2-expectation-values-for-ridge-regression"]], "Exercise 2: Extended program": [[38, "exercise-2-extended-program"]], "Exercise 2: making your own data and exploring scikit-learn": [[0, "exercise-2-making-your-own-data-and-exploring-scikit-learn"]], "Exercise 3": [[21, "exercise-3"]], "Exercise 3 - Creating feature matrix and implementing OLS using the analytical expression": [[16, "exercise-3-creating-feature-matrix-and-implementing-ols-using-the-analytical-expression"]], "Exercise 3 - Fitting an OLS model to data": [[15, "exercise-3-fitting-an-ols-model-to-data"]], "Exercise 3 - Gradient with one layer writing backpropagation by hand": [[22, "exercise-3-gradient-with-one-layer-writing-backpropagation-by-hand"]], "Exercise 3 - Scaling data": [[17, "exercise-3-scaling-data"]], "Exercise 3 - Setting up a Python virtual environment": [[15, "exercise-3-setting-up-a-python-virtual-environment"]], "Exercise 3, using the analytical formulae for OLS and Ridge regression to find the optimal paramters \\boldsymbol{\\theta}": [[18, "exercise-3-using-the-analytical-formulae-for-ols-and-ridge-regression-to-find-the-optimal-paramters-boldsymbol-theta"]], "Exercise 3: Deriving the expression for the Bias-Variance Trade-off": [[19, "exercise-3-deriving-the-expression-for-the-bias-variance-trade-off"]], "Exercise 3: Normalizing our data": [[0, "exercise-3-normalizing-our-data"]], "Exercise 3: Writing an abstract and introduction": [[20, "exercise-3-writing-an-abstract-and-introduction"]], "Exercise 4 - Custom activation for each layer": [[21, "exercise-4-custom-activation-for-each-layer"]], "Exercise 4 - Fitting a polynomial": [[16, "exercise-4-fitting-a-polynomial"]], "Exercise 4 - Gradient with two layers writing backpropagation by hand": [[22, "exercise-4-gradient-with-two-layers-writing-backpropagation-by-hand"]], "Exercise 4 - Implementing Ridge Regression": [[17, "exercise-4-implementing-ridge-regression"]], "Exercise 4 - Testing multiple hyperparameters": [[17, "exercise-4-testing-multiple-hyperparameters"]], "Exercise 4 - The train-test split": [[15, "exercise-4-the-train-test-split"]], "Exercise 4, Implementing the simplest form for gradient descent": [[18, "exercise-4-implementing-the-simplest-form-for-gradient-descent"]], "Exercise 4: Adding Ridge Regression": [[0, "exercise-4-adding-ridge-regression"]], "Exercise 4: Computing the Bias and Variance": [[19, "exercise-4-computing-the-bias-and-variance"]], "Exercise 4: Making the code available and presentable": [[20, "exercise-4-making-the-code-available-and-presentable"]], "Exercise 5 - Comparing your code with sklearn": [[16, "exercise-5-comparing-your-code-with-sklearn"]], "Exercise 5 - Gradient with any number of layers writing backpropagation by hand": [[22, "exercise-5-gradient-with-any-number-of-layers-writing-backpropagation-by-hand"]], "Exercise 5 - Processing multiple inputs at once": [[21, "exercise-5-processing-multiple-inputs-at-once"]], "Exercise 5, Ridge regression and a new Synthetic Dataset": [[18, "exercise-5-ridge-regression-and-a-new-synthetic-dataset"]], "Exercise 5: Analytical exercises": [[0, "exercise-5-analytical-exercises"]], "Exercise 5: Interpretation of scaling and metrics": [[19, "exercise-5-interpretation-of-scaling-and-metrics"]], "Exercise 5: Referencing": [[20, "exercise-5-referencing"]], "Exercise 6 - Batched inputs": [[22, "exercise-6-batched-inputs"]], "Exercise 6 - Predicting on real data": [[21, "exercise-6-predicting-on-real-data"]], "Exercise 7 - Training": [[22, "exercise-7-training"]], "Exercise 7 - Training on real data (Optional)": [[21, "exercise-7-training-on-real-data-optional"]], "Exercise 8 (Optional) - Object orientation": [[22, "exercise-8-optional-object-orientation"]], "Exercise: Cross-validation as resampling techniques, adding more complexity": [[6, "exercise-cross-validation-as-resampling-techniques-adding-more-complexity"]], "Exercise: Analysis of real data": [[6, "exercise-analysis-of-real-data"]], "Exercise: Bias-variance trade-off and resampling techniques": [[6, "exercise-bias-variance-trade-off-and-resampling-techniques"]], "Exercise: Lasso Regression on the Franke function with resampling": [[6, "exercise-lasso-regression-on-the-franke-function-with-resampling"]], "Exercise: Ordinary Least Square (OLS) on the Franke function": [[6, "exercise-ordinary-least-square-ols-on-the-franke-function"]], "Exercise: Ridge Regression on the Franke function with resampling": [[6, "exercise-ridge-regression-on-the-franke-function-with-resampling"]], "Exercises": [[0, "exercises"]], "Exercises and Projects": [[6, "exercises-and-projects"]], "Exercises week 34": [[15, null]], "Exercises week 35": [[16, null]], "Exercises week 36": [[17, null]], "Exercises week 37": [[18, null]], "Exercises week 38": [[19, null]], "Exercises week 39": [[20, null]], "Exercises week 41": [[21, null]], "Exercises week 42": [[22, null]], "Expectation value and variance": [[35, "expectation-value-and-variance"]], "Expectation value and variance for \\boldsymbol{\\theta}": [[35, "expectation-value-and-variance-for-boldsymbol-theta"]], "Expectation values": [[28, "expectation-values"]], "Explicit derivatives": [[38, "explicit-derivatives"], [39, "explicit-derivatives"]], "Exploding gradients": [[39, "exploding-gradients"]], "Extending to more predictors": [[36, "extending-to-more-predictors"], [37, "extending-to-more-predictors"]], "Extending to more than one variable": [[33, "extending-to-more-than-one-variable"]], "Extremely useful tools, strongly recommended": [[31, "extremely-useful-tools-strongly-recommended"]], "Feed-forward neural networks": [[12, "feed-forward-neural-networks"], [37, "feed-forward-neural-networks"], [38, "feed-forward-neural-networks"]], "Feed-forward pass": [[1, "feed-forward-pass"], [39, "feed-forward-pass"]], "Final back propagating equation": [[12, "final-back-propagating-equation"], [38, "final-back-propagating-equation"], [39, "final-back-propagating-equation"]], "Final derivatives": [[38, "final-derivatives"]], "Final expression": [[38, "final-expression"], [39, "final-expression"]], "Final expressions for the biases of the hidden layer": [[38, "final-expressions-for-the-biases-of-the-hidden-layer"], [39, "final-expressions-for-the-biases-of-the-hidden-layer"]], "Finding the Limit": [[35, "finding-the-limit"]], "Fine-tuning neural network hyperparameters": [[1, "fine-tuning-neural-network-hyperparameters"], [39, "fine-tuning-neural-network-hyperparameters"]], "First network example, simple percepetron with one input": [[38, "first-network-example-simple-percepetron-with-one-input"]], "Fitting an Equation of State for Dense Nuclear Matter": [[0, "fitting-an-equation-of-state-for-dense-nuclear-matter"]], "Fixing the singularity": [[32, "fixing-the-singularity"], [33, "fixing-the-singularity"]], "Format for electronic delivery of report and programs": [[25, "format-for-electronic-delivery-of-report-and-programs"], [26, "format-for-electronic-delivery-of-report-and-programs"]], "Forward and reverse modes": [[38, "forward-and-reverse-modes"]], "Frequently used scaling functions": [[32, "frequently-used-scaling-functions"], [34, "frequently-used-scaling-functions"]], "From OLS to Ridge and Lasso": [[33, "from-ols-to-ridge-and-lasso"]], "From one to many layers, the universal approximation theorem": [[12, "from-one-to-many-layers-the-universal-approximation-theorem"]], "Full object-oriented implementation": [[39, "full-object-oriented-implementation"]], "Functionality in Scikit-Learn": [[32, "functionality-in-scikit-learn"], [34, "functionality-in-scikit-learn"]], "Further Dimensionality Remarks": [[3, "further-dimensionality-remarks"]], "Further properties (important for our analyses later)": [[5, "further-properties-important-for-our-analyses-later"], [32, "further-properties-important-for-our-analyses-later"], [33, "further-properties-important-for-our-analyses-later"]], "Gaussian Elimination": [[24, "gaussian-elimination"]], "General Features": [[9, "general-features"]], "General linear models and linear algebra": [[31, "general-linear-models-and-linear-algebra"]], "Generalizing the fitting procedure as a linear algebra problem": [[31, "generalizing-the-fitting-procedure-as-a-linear-algebra-problem"], [31, "id1"]], "Generative Adversarial Networks": [[4, "generative-adversarial-networks"]], "Generative Models": [[4, "generative-models"]], "Generative Versus Discriminative Modeling": [[31, "generative-versus-discriminative-modeling"]], "Geometric Interpretation and link with Singular Value Decomposition": [[11, "geometric-interpretation-and-link-with-singular-value-decomposition"]], "Getting serious, the back propagation equations for a neural network": [[38, "getting-serious-the-back-propagation-equations-for-a-neural-network"]], "Getting started with project 1": [[20, "getting-started-with-project-1"]], "Gradient Boosting, Classification Example": [[10, "gradient-boosting-classification-example"]], "Gradient Boosting, Examples of Regression": [[10, "gradient-boosting-examples-of-regression"]], "Gradient Clipping": [[1, "gradient-clipping"], [39, "gradient-clipping"]], "Gradient Descent Example": [[33, "id1"], [34, "id1"]], "Gradient boosting: Basics with Steepest Descent/Functional Gradient Descent": [[10, "gradient-boosting-basics-with-steepest-descent-functional-gradient-descent"]], "Gradient descent": [[2, "gradient-descent"]], "Gradient descent and Ridge": [[33, "gradient-descent-and-ridge"], [34, "gradient-descent-and-ridge"]], "Gradient descent and revisiting Ordinary Least Squares from last week": [[34, "gradient-descent-and-revisiting-ordinary-least-squares-from-last-week"]], "Gradient descent example": [[33, "gradient-descent-example"], [34, "gradient-descent-example"]], "Gradient expressions": [[38, "gradient-expressions"], [39, "gradient-expressions"]], "Grading": [[29, "grading"], [29, "id2"], [31, "grading"]], "Hidden layers": [[39, "hidden-layers"]], "Homogeneous data": [[39, "homogeneous-data"]], "How to take derivatives of Matrix-Vector expressions": [[16, "how-to-take-derivatives-of-matrix-vector-expressions"]], "Hyperplanes and all that": [[8, "hyperplanes-and-all-that"]], "Identifying Terms": [[35, "identifying-terms"]], "Illustration of a single perceptron model and a multi-perceptron model": [[37, "illustration-of-a-single-perceptron-model-and-a-multi-perceptron-model"], [38, "illustration-of-a-single-perceptron-model-and-a-multi-perceptron-model"]], "Important Matrix and vector handling packages": [[24, "important-matrix-and-vector-handling-packages"]], "Important observations": [[38, "important-observations"], [39, "important-observations"]], "Important technicalities: More on Rescaling data": [[32, "important-technicalities-more-on-rescaling-data"]], "Improving gradient descent with momentum": [[34, "improving-gradient-descent-with-momentum"]], "Improving performance": [[1, "improving-performance"], [39, "improving-performance"]], "In general not this simple": [[38, "in-general-not-this-simple"]], "In summary": [[29, "in-summary"]], "Including Stochastic Gradient Descent with Autograd": [[13, "including-stochastic-gradient-descent-with-autograd"], [34, "including-stochastic-gradient-descent-with-autograd"]], "Including more classes": [[36, "including-more-classes"], [37, "including-more-classes"]], "Incremental PCA": [[11, "incremental-pca"]], "Independent and Identically Distributed (iid)": [[35, "independent-and-identically-distributed-iid"]], "Inputs to the activation function": [[38, "inputs-to-the-activation-function"], [39, "inputs-to-the-activation-function"]], "Insights from the paper by Glorot and Bengio": [[39, "insights-from-the-paper-by-glorot-and-bengio"]], "Installing R, C++, cython or Julia": [[31, "installing-r-c-cython-or-julia"]], "Installing R, C++, cython, Numba etc": [[31, "installing-r-c-cython-numba-etc"]], "Instructor information": [[29, "instructor-information"]], "Interpretations and optimizing our parameters": [[31, "interpretations-and-optimizing-our-parameters"], [31, "id2"], [31, "id3"], [32, "interpretations-and-optimizing-our-parameters"], [32, "id1"], [32, "id2"]], "Interpreting the Ridge results": [[32, "interpreting-the-ridge-results"], [33, "interpreting-the-ridge-results"], [33, "id4"]], "Introducing JAX": [[13, "introducing-jax"]], "Introducing the Covariance and Correlation functions": [[11, "introducing-the-covariance-and-correlation-functions"], [32, "introducing-the-covariance-and-correlation-functions"]], "Introduction": [[0, "introduction"], [6, "introduction"], [23, "introduction"], [24, "introduction"]], "Introduction to Neural networks": [[37, "introduction-to-neural-networks"], [38, "introduction-to-neural-networks"]], "Introduction to numerical projects": [[25, "introduction-to-numerical-projects"], [26, "introduction-to-numerical-projects"]], "Is the Logistic activation function (Sigmoid) our choice?": [[39, "is-the-logistic-activation-function-sigmoid-our-choice"]], "Iterative Fitting, Classification and AdaBoost": [[10, "iterative-fitting-classification-and-adaboost"]], "Iterative Fitting, Regression and Squared-error Cost Function": [[10, "iterative-fitting-regression-and-squared-error-cost-function"]], "Kernel PCA": [[11, "kernel-pca"]], "Kernels and non-linearity": [[8, "kernels-and-non-linearity"]], "LU Decomposition, the inverse of a matrix": [[24, "lu-decomposition-the-inverse-of-a-matrix"]], "Lab sessions Tuesday and Wednesday": [[37, "lab-sessions-tuesday-and-wednesday"]], "Lab sessions on Tuesday and Wednesday": [[38, "lab-sessions-on-tuesday-and-wednesday"]], "Lab sessions week 39": [[36, "lab-sessions-week-39"]], "Lasso Regression": [[33, "lasso-regression"]], "Lasso case": [[33, "lasso-case"]], "Layers": [[1, "layers"], [39, "layers"]], "Layers used to build CNNs": [[3, "layers-used-to-build-cnns"]], "Layout of a neural network with three hidden layers": [[38, "layout-of-a-neural-network-with-three-hidden-layers"]], "Layout of a neural network with three hidden layers (last layer = l=L=4, first layer l=0)": [[39, "layout-of-a-neural-network-with-three-hidden-layers-last-layer-l-l-4-first-layer-l-0"]], "Layout of a simple neural network with no hidden layer": [[38, "layout-of-a-simple-neural-network-with-no-hidden-layer"], [39, "layout-of-a-simple-neural-network-with-no-hidden-layer"]], "Layout of a simple neural network with one hidden layer": [[38, "layout-of-a-simple-neural-network-with-one-hidden-layer"], [39, "layout-of-a-simple-neural-network-with-one-hidden-layer"]], "Layout of a simple neural network with two input nodes, one hidden layer and one output node": [[38, "layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node"]], "Layout of a simple neural network with two input nodes, one hidden layer with two hidden noeds and one output node": [[39, "layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-with-two-hidden-noeds-and-one-output-node"]], "Layout of input to first hidden layer l=1 from input layer l=0": [[39, "layout-of-input-to-first-hidden-layer-l-1-from-input-layer-l-0"]], "Learning goals": [[15, "learning-goals"], [16, "learning-goals"], [17, "learning-goals"], [18, "learning-goals"], [19, "learning-goals"], [20, "learning-goals"]], "Learning outcomes": [[23, "learning-outcomes"], [31, "learning-outcomes"]], "Learning rate methods": [[39, "learning-rate-methods"]], "Lecture Monday October 6": [[38, "lecture-monday-october-6"]], "Lecture Monday September 29, 2025": [[37, "lecture-monday-september-29-2025"]], "Lecture October 13, 2025": [[39, "lecture-october-13-2025"]], "Lecture material": [[36, "lecture-material"]], "Lecture material: Writing a code which implements a feed-forward neural network": [[39, "lecture-material-writing-a-code-which-implements-a-feed-forward-neural-network"]], "Lectures and ComputerLab": [[31, "lectures-and-computerlab"]], "Limitations of NNs": [[39, "limitations-of-nns"]], "Limitations of supervised learning with deep networks": [[1, "limitations-of-supervised-learning-with-deep-networks"], [39, "limitations-of-supervised-learning-with-deep-networks"]], "Linear Algebra, Handling of Arrays and more Python Features": [[24, null]], "Linear Regression": [[0, null]], "Linear Regression Problems": [[32, "linear-regression-problems"], [33, "linear-regression-problems"]], "Linear Regression and the SVD": [[33, "linear-regression-and-the-svd"]], "Linear Regression, basic elements": [[0, "linear-regression-basic-elements"]], "Linear classifier": [[36, "linear-classifier"]], "Linking Bayes\u2019 Theorem with Ridge and Lasso Regression": [[5, "linking-bayes-theorem-with-ridge-and-lasso-regression"]], "Linking the regression analysis with a statistical interpretation": [[5, "linking-the-regression-analysis-with-a-statistical-interpretation"], [35, "linking-the-regression-analysis-with-a-statistical-interpretation"]], "Linking with the SVD": [[5, "linking-with-the-svd"], [32, "linking-with-the-svd"]], "Links to relevant courses at the University of Oslo": [[30, "links-to-relevant-courses-at-the-university-of-oslo"]], "Logistic Regression": [[7, null], [7, "id1"], [36, "logistic-regression"]], "Logistic Regression, from last week": [[37, "logistic-regression-from-last-week"]], "Logistic function as the root of problems": [[39, "logistic-function-as-the-root-of-problems"]], "MNIST and GANs": [[4, "mnist-and-gans"]], "Machine Learning": [[31, "machine-learning"]], "Machine learning": [[23, "machine-learning"]], "Main textbooks": [[31, "main-textbooks"]], "Making a tree": [[9, "making-a-tree"]], "Making your own Bootstrap: Changing the Level of the Decision Tree": [[10, "making-your-own-bootstrap-changing-the-level-of-the-decision-tree"]], "Making your own test-train splitting": [[32, "making-your-own-test-train-splitting"]], "Material for exercises week 35": [[32, "material-for-exercises-week-35"]], "Material for lab sessions sessions Tuesday and Wednesday": [[33, "material-for-lab-sessions-sessions-tuesday-and-wednesday"]], "Material for lecture Monday September 2": [[33, "material-for-lecture-monday-september-2"]], "Material for lecture Monday September 8": [[34, "material-for-lecture-monday-september-8"]], "Material for the lab sessions": [[34, "material-for-the-lab-sessions"], [35, "material-for-the-lab-sessions"]], "Material for the lab sessions on Tuesday and Wednesday": [[39, "material-for-the-lab-sessions-on-tuesday-and-wednesday"]], "Material for the lecture on Monday October 6, 2025": [[38, "material-for-the-lecture-on-monday-october-6-2025"]], "Mathematical Interpretation of Ordinary Least Squares": [[5, "mathematical-interpretation-of-ordinary-least-squares"], [32, "mathematical-interpretation-of-ordinary-least-squares"], [33, "mathematical-interpretation-of-ordinary-least-squares"]], "Mathematical model": [[37, "mathematical-model"], [37, "id1"], [37, "id2"], [37, "id3"], [37, "id4"]], "Mathematical optimization of convex functions": [[8, "mathematical-optimization-of-convex-functions"]], "Mathematics of CNNs": [[3, "mathematics-of-cnns"]], "Mathematics of deep learning": [[38, "mathematics-of-deep-learning"], [39, "mathematics-of-deep-learning"]], "Mathematics of deep learning and neural networks": [[38, "mathematics-of-deep-learning-and-neural-networks"]], "Mathematics of the SVD and implications": [[5, "mathematics-of-the-svd-and-implications"], [32, "mathematics-of-the-svd-and-implications"], [33, "mathematics-of-the-svd-and-implications"]], "Matrices in Python": [[31, "matrices-in-python"]], "Matrix multiplication": [[1, "matrix-multiplication"], [39, "matrix-multiplication"]], "Matrix multiplications": [[39, "matrix-multiplications"]], "Matrix-vector notation": [[37, "matrix-vector-notation"]], "Matrix-vector notation and activation": [[12, "matrix-vector-notation-and-activation"], [37, "matrix-vector-notation-and-activation"]], "Maximum Likelihood Estimation (MLE)": [[35, "maximum-likelihood-estimation-mle"]], "Maximum likelihood": [[36, "maximum-likelihood"], [37, "maximum-likelihood"]], "Meet the covariance!": [[28, "meet-the-covariance"]], "Meet the Covariance Matrix": [[5, "meet-the-covariance-matrix"], [32, "meet-the-covariance-matrix"]], "Meet the Hessian Matrix": [[32, "meet-the-hessian-matrix"]], "Meet the Pandas": [[31, "meet-the-pandas"]], "Memory Usage and Scalability": [[34, "memory-usage-and-scalability"]], "Memory constraints": [[34, "memory-constraints"]], "Min-Max Scaling": [[32, "min-max-scaling"]], "Minimizing the cross entropy": [[36, "minimizing-the-cross-entropy"], [37, "minimizing-the-cross-entropy"]], "Momentum based GD": [[13, "momentum-based-gd"], [34, "momentum-based-gd"]], "More classes": [[36, "more-classes"], [37, "more-classes"]], "More complicated Example: The Ising model": [[6, "more-complicated-example-the-ising-model"]], "More complicated function": [[38, "more-complicated-function"]], "More considerations": [[38, "more-considerations"], [39, "more-considerations"]], "More examples on bootstrap and cross-validation and errors": [[35, "more-examples-on-bootstrap-and-cross-validation-and-errors"], [36, "more-examples-on-bootstrap-and-cross-validation-and-errors"]], "More interpretations": [[32, "more-interpretations"], [33, "more-interpretations"], [33, "id5"]], "More limitations": [[39, "more-limitations"]], "More on Dimensionalities": [[3, "more-on-dimensionalities"]], "More on Rescaling data": [[6, "more-on-rescaling-data"]], "More on Steepest descent": [[33, "more-on-steepest-descent"]], "More on activation functions, output layers": [[39, "more-on-activation-functions-output-layers"]], "More on convex functions": [[33, "more-on-convex-functions"]], "More on the general approximation theorem": [[38, "more-on-the-general-approximation-theorem"]], "More preprocessing": [[32, "more-preprocessing"], [34, "more-preprocessing"]], "More top-down perspectives": [[39, "more-top-down-perspectives"]], "Motivation for Adaptive Step Sizes": [[34, "motivation-for-adaptive-step-sizes"]], "Multiclass classification": [[39, "multiclass-classification"]], "Multilayer perceptrons": [[12, "multilayer-perceptrons"], [37, "multilayer-perceptrons"], [38, "multilayer-perceptrons"]], "Multivariable functions": [[38, "multivariable-functions"]], "Network requirements": [[2, "network-requirements"]], "Neural Networks vs CNNs": [[3, "neural-networks-vs-cnns"]], "Neural network types": [[37, "neural-network-types"], [38, "neural-network-types"]], "Neural networks": [[12, null]], "New expression for the derivative": [[38, "new-expression-for-the-derivative"]], "Non-Convex Problems": [[34, "non-convex-problems"]], "Note about SVD Calculations": [[32, "note-about-svd-calculations"], [33, "note-about-svd-calculations"]], "Note on Scikit-Learn": [[33, "note-on-scikit-learn"]], "Numerical experiments and the covariance, central limit theorem": [[28, "numerical-experiments-and-the-covariance-central-limit-theorem"]], "Numpy and arrays": [[24, "numpy-and-arrays"], [31, "numpy-and-arrays"]], "Numpy examples and Important Matrix and vector handling packages": [[31, "numpy-examples-and-important-matrix-and-vector-handling-packages"]], "Optimization and Deep learning": [[36, "optimization-and-deep-learning"], [37, "optimization-and-deep-learning"]], "Optimization and gradient descent, the central part of any Machine Learning algortithm": [[33, "optimization-and-gradient-descent-the-central-part-of-any-machine-learning-algortithm"]], "Optimization, the central part of any Machine Learning algortithm": [[13, null], [36, "optimization-the-central-part-of-any-machine-learning-algortithm"], [37, "optimization-the-central-part-of-any-machine-learning-algortithm"]], "Optimizing our parameters": [[31, "optimizing-our-parameters"]], "Optimizing our parameters, more details": [[31, "optimizing-our-parameters-more-details"]], "Optimizing the cost function": [[1, "optimizing-the-cost-function"], [39, "optimizing-the-cost-function"]], "Optimizing the parameters": [[38, "optimizing-the-parameters"], [39, "optimizing-the-parameters"]], "Optional (Note that you should include at least two of these in the report):": [[26, "optional-note-that-you-should-include-at-least-two-of-these-in-the-report"]], "Organizing our data": [[0, "organizing-our-data"], [31, "organizing-our-data"]], "Other Matrix and Vector Operations": [[24, "other-matrix-and-vector-operations"]], "Other Types of Recurrent Neural Networks": [[4, "other-types-of-recurrent-neural-networks"]], "Other courses on Data science and Machine Learning at UiO": [[31, "other-courses-on-data-science-and-machine-learning-at-uio"]], "Other courses on Data science and Machine Learning at UiO, contn": [[31, "other-courses-on-data-science-and-machine-learning-at-uio-contn"]], "Other ingredients of a neural network": [[38, "other-ingredients-of-a-neural-network"]], "Other measures in classification studies": [[37, "other-measures-in-classification-studies"]], "Other parameters": [[38, "other-parameters"]], "Other popular texts": [[31, "other-popular-texts"]], "Other techniques": [[11, "other-techniques"]], "Other types of networks": [[12, "other-types-of-networks"], [37, "other-types-of-networks"], [38, "other-types-of-networks"]], "Other ways of visualizing the trees": [[9, "other-ways-of-visualizing-the-trees"]], "Our model for the nuclear binding energies": [[31, "our-model-for-the-nuclear-binding-energies"]], "Output layer": [[38, "output-layer"], [39, "output-layer"]], "Overarching aims of the exercises this week": [[21, "overarching-aims-of-the-exercises-this-week"], [22, "overarching-aims-of-the-exercises-this-week"]], "Overarching view of a neural network": [[38, "overarching-view-of-a-neural-network"]], "Overview of first week": [[31, "overview-of-first-week"]], "Overview video on Stochastic Gradient Descent (SGD)": [[34, "overview-video-on-stochastic-gradient-descent-sgd"]], "Own code for Ordinary Least Squares": [[31, "own-code-for-ordinary-least-squares"], [32, "own-code-for-ordinary-least-squares"]], "PCA and scikit-learn": [[11, "pca-and-scikit-learn"]], "Pandas AI": [[31, "pandas-ai"]], "Parameters of neural networks": [[38, "parameters-of-neural-networks"]], "Part a : Ordinary Least Square (OLS) for the Runge function": [[25, "part-a-ordinary-least-square-ols-for-the-runge-function"]], "Part a): Analytical warm-up": [[26, "part-a-analytical-warm-up"]], "Part b): Writing your own Neural Network code": [[26, "part-b-writing-your-own-neural-network-code"]], "Part b: Adding Ridge regression for the Runge function": [[25, "part-b-adding-ridge-regression-for-the-runge-function"]], "Part c): Testing against other software libraries": [[26, "part-c-testing-against-other-software-libraries"]], "Part c: Writing your own gradient descent code": [[25, "part-c-writing-your-own-gradient-descent-code"]], "Part d): Testing different activation functions and depths of the neural network": [[26, "part-d-testing-different-activation-functions-and-depths-of-the-neural-network"]], "Part d: Including momentum and more advanced ways to update the learning the rate": [[25, "part-d-including-momentum-and-more-advanced-ways-to-update-the-learning-the-rate"]], "Part e): Testing different norms": [[26, "part-e-testing-different-norms"]], "Part e: Writing our own code for Lasso regression": [[25, "part-e-writing-our-own-code-for-lasso-regression"]], "Part f): Classification analysis using neural networks": [[26, "part-f-classification-analysis-using-neural-networks"]], "Part f: Stochastic gradient descent": [[25, "part-f-stochastic-gradient-descent"]], "Part g) Critical evaluation of the various algorithms": [[26, "part-g-critical-evaluation-of-the-various-algorithms"]], "Part g: Bias-variance trade-off and resampling techniques": [[25, "part-g-bias-variance-trade-off-and-resampling-techniques"]], "Part h): Cross-validation as resampling techniques, adding more complexity": [[25, "part-h-cross-validation-as-resampling-techniques-adding-more-complexity"]], "Partial Differential Equations": [[2, "partial-differential-equations"]], "Plan for week 39, September 22-26, 2025": [[36, "plan-for-week-39-september-22-26-2025"]], "Plan for week 41, October 6-10": [[38, "plan-for-week-41-october-6-10"]], "Plans for week 35": [[32, "plans-for-week-35"]], "Plans for week 36": [[33, "plans-for-week-36"]], "Plans for week 37, lecture Monday": [[34, "plans-for-week-37-lecture-monday"]], "Plans for week 38, lecture Monday September 15": [[35, "plans-for-week-38-lecture-monday-september-15"]], "Plotting the Histogram": [[35, "plotting-the-histogram"]], "Plotting the mean value for each group": [[36, "plotting-the-mean-value-for-each-group"]], "Practical tips": [[13, "practical-tips"], [34, "practical-tips"]], "Practicalities": [[29, "practicalities"], [29, "id1"]], "Preamble: Note on writing reports, using reference material, AI and other tools": [[25, "preamble-note-on-writing-reports-using-reference-material-ai-and-other-tools"], [26, "preamble-note-on-writing-reports-using-reference-material-ai-and-other-tools"]], "Predicting New Points With A Trained Recurrent Neural Network": [[4, "predicting-new-points-with-a-trained-recurrent-neural-network"]], "Preprocessing our data": [[32, "preprocessing-our-data"]], "Prerequisites": [[31, "prerequisites"]], "Prerequisites and background": [[23, "prerequisites-and-background"]], "Prerequisites: Collect and pre-process data": [[3, "prerequisites-collect-and-pre-process-data"]], "Probability Distribution Functions": [[28, "probability-distribution-functions"]], "Program example for gradient descent with Ridge Regression": [[33, "program-example-for-gradient-descent-with-ridge-regression"], [34, "program-example-for-gradient-descent-with-ridge-regression"]], "Program for stochastic gradient": [[13, "program-for-stochastic-gradient"]], "Project 1 on Machine Learning, deadline October 6 (midnight), 2025": [[25, null]], "Project 2 on Machine Learning, deadline November 10 (Midnight)": [[26, null]], "Properties of PDFs": [[28, "properties-of-pdfs"]], "Pros and cons": [[34, "pros-and-cons"]], "Pros and cons of trees, pros": [[9, "pros-and-cons-of-trees-pros"]], "Python installers": [[23, "python-installers"], [31, "python-installers"]], "RMS prop": [[13, "rms-prop"]], "RMSProp algorithm, taken from Goodfellow et al": [[34, "rmsprop-algorithm-taken-from-goodfellow-et-al"]], "RMSProp: Adaptive Learning Rates": [[34, "rmsprop-adaptive-learning-rates"]], "RMSprop for adaptive learning rate with Stochastic Gradient Descent": [[34, "rmsprop-for-adaptive-learning-rate-with-stochastic-gradient-descent"]], "Random Numbers": [[28, "random-numbers"]], "Random forests": [[10, "random-forests"]], "Randomized PCA": [[11, "randomized-pca"]], "Reading material": [[31, "reading-material"]], "Reading recommendations": [[39, "reading-recommendations"]], "Reading recommendations:": [[32, "reading-recommendations"]], "Reading suggestions week 34": [[31, "reading-suggestions-week-34"]], "Readings and Videos": [[35, "readings-and-videos"]], "Readings and Videos, logistic regression": [[36, "readings-and-videos-logistic-regression"]], "Readings and Videos, resampling methods": [[36, "readings-and-videos-resampling-methods"]], "Readings and Videos:": [[34, "readings-and-videos"], [38, "readings-and-videos"]], "Readings and videos": [[39, "readings-and-videos"]], "Recurrent neural networks": [[12, "recurrent-neural-networks"], [37, "recurrent-neural-networks"], [38, "recurrent-neural-networks"]], "Recurrent neural networks: Overarching view": [[4, null]], "Reducing the number of degrees of freedom, overarching view": [[0, "reducing-the-number-of-degrees-of-freedom-overarching-view"], [32, "reducing-the-number-of-degrees-of-freedom-overarching-view"]], "Reducing the number of operations": [[38, "reducing-the-number-of-operations"]], "Reformulating the problem": [[2, "reformulating-the-problem"]], "Regression Case": [[10, "regression-case"]], "Regression analysis and resampling methods": [[25, "regression-analysis-and-resampling-methods"]], "Regression analysis, overarching aims": [[31, "regression-analysis-overarching-aims"]], "Regression analysis, overarching aims II": [[31, "regression-analysis-overarching-aims-ii"]], "Regularization": [[1, "regularization"], [39, "regularization"]], "Relevance": [[37, "relevance"], [39, "relevance"]], "Reminder about the gradient machinery from project 1": [[26, "reminder-about-the-gradient-machinery-from-project-1"]], "Reminder from last week": [[32, "reminder-from-last-week"]], "Reminder from last week: First network example, simple percepetron with one input": [[39, "reminder-from-last-week-first-network-example-simple-percepetron-with-one-input"]], "Reminder on Newton-Raphson\u2019s method": [[33, "reminder-on-newton-raphson-s-method"]], "Reminder on Statistics": [[6, "reminder-on-statistics"]], "Reminder on books with hands-on material and codes": [[38, "reminder-on-books-with-hands-on-material-and-codes"], [39, "reminder-on-books-with-hands-on-material-and-codes"]], "Reminder on different scaling methods": [[34, "reminder-on-different-scaling-methods"]], "Reminder on the chain rule and gradients": [[38, "reminder-on-the-chain-rule-and-gradients"]], "Replace or not": [[13, "replace-or-not"], [34, "replace-or-not"]], "Required Analysis:": [[26, "required-analysis"]], "Required Technologies": [[23, "required-technologies"]], "Resampling Methods": [[6, null]], "Resampling and the Bias-Variance Trade-off": [[19, "resampling-and-the-bias-variance-trade-off"]], "Resampling approaches can be computationally expensive": [[35, "resampling-approaches-can-be-computationally-expensive"], [36, "resampling-approaches-can-be-computationally-expensive"]], "Resampling methods": [[6, "id1"], [35, "resampling-methods"], [35, "id2"], [36, "resampling-methods"], [36, "id1"]], "Resampling methods: Bootstrap": [[35, "resampling-methods-bootstrap"], [36, "resampling-methods-bootstrap"]], "Resampling methods: Bootstrap approach": [[35, "resampling-methods-bootstrap-approach"]], "Resampling methods: Bootstrap background": [[35, "resampling-methods-bootstrap-background"]], "Resampling methods: Bootstrap steps": [[35, "resampling-methods-bootstrap-steps"]], "Resampling methods: More Bootstrap background": [[35, "resampling-methods-more-bootstrap-background"]], "Residual Error": [[32, "residual-error"], [33, "residual-error"]], "Resources on differential equations and deep learning": [[2, "resources-on-differential-equations-and-deep-learning"]], "Revisiting Ordinary Least Squares": [[33, "revisiting-ordinary-least-squares"]], "Revisiting our Linear Regression Solvers": [[13, "revisiting-our-linear-regression-solvers"]], "Revisiting our Logistic Regression case": [[36, "revisiting-our-logistic-regression-case"], [37, "revisiting-our-logistic-regression-case"]], "Rewriting the Covariance and/or Correlation Matrix": [[32, "rewriting-the-covariance-and-or-correlation-matrix"]], "Rewriting the \\delta-function": [[35, "rewriting-the-delta-function"]], "Rewriting the fitting procedure as a linear algebra problem": [[31, "rewriting-the-fitting-procedure-as-a-linear-algebra-problem"]], "Rewriting the fitting procedure as a linear algebra problem, more details": [[31, "rewriting-the-fitting-procedure-as-a-linear-algebra-problem-more-details"]], "Ridge Regression": [[33, "ridge-regression"]], "Ridge and LASSO Regression": [[32, "ridge-and-lasso-regression"], [33, "ridge-and-lasso-regression"], [33, "id2"]], "Ridge and Lasso Regression": [[5, null], [5, "id1"]], "SGD example": [[34, "sgd-example"]], "SGD vs Full-Batch GD: Convergence Speed and Memory Comparison": [[34, "sgd-vs-full-batch-gd-convergence-speed-and-memory-comparison"]], "SVD analysis": [[33, "svd-analysis"]], "Same code but now with momentum gradient descent": [[13, "same-code-but-now-with-momentum-gradient-descent"], [34, "same-code-but-now-with-momentum-gradient-descent"], [34, "id3"], [34, "id4"]], "Schedule first week": [[31, "schedule-first-week"]], "Schematic Regression Procedure": [[9, "schematic-regression-procedure"]], "Second moment of the gradient": [[34, "second-moment-of-the-gradient"]], "September 15-19": [[19, "september-15-19"]], "Setting up a Multi-layer perceptron model for classification": [[39, "setting-up-a-multi-layer-perceptron-model-for-classification"]], "Setting up the Back propagation algorithm": [[12, "setting-up-the-back-propagation-algorithm"]], "Setting up the Back propagation algorithm, part 3": [[38, "setting-up-the-back-propagation-algorithm-part-3"], [39, "setting-up-the-back-propagation-algorithm-part-3"]], "Setting up the Matrix to be inverted": [[32, "setting-up-the-matrix-to-be-inverted"], [33, "setting-up-the-matrix-to-be-inverted"]], "Setting up the back propagation algorithm": [[38, "setting-up-the-back-propagation-algorithm"]], "Setting up the back propagation algorithm and algorithm for a feed forward NN, initalizations": [[39, "setting-up-the-back-propagation-algorithm-and-algorithm-for-a-feed-forward-nn-initalizations"]], "Setting up the back propagation algorithm, part 1": [[39, "setting-up-the-back-propagation-algorithm-part-1"]], "Setting up the back propagation algorithm, part 2": [[38, "setting-up-the-back-propagation-algorithm-part-2"], [39, "setting-up-the-back-propagation-algorithm-part-2"]], "Setting up the equations for a neural network": [[38, "setting-up-the-equations-for-a-neural-network"], [39, "setting-up-the-equations-for-a-neural-network"]], "Setting up the network using Autograd; The full program": [[2, "setting-up-the-network-using-autograd-the-full-program"]], "Similar (second order function now) problem but now with AdaGrad": [[13, "similar-second-order-function-now-problem-but-now-with-adagrad"], [34, "similar-second-order-function-now-problem-but-now-with-adagrad"]], "Simple Python Code to read in Data and perform Classification": [[9, "simple-python-code-to-read-in-data-and-perform-classification"]], "Simple case": [[32, "simple-case"], [33, "simple-case"]], "Simple code for solving the above problem": [[33, "simple-code-for-solving-the-above-problem"]], "Simple example": [[36, "simple-example"], [38, "simple-example"]], "Simple example code": [[34, "simple-example-code"]], "Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression": [[33, "simple-example-to-illustrate-ordinary-least-squares-ridge-and-lasso-regression"]], "Simple geometric interpretation": [[33, "simple-geometric-interpretation"]], "Simple linear regression model using scikit-learn": [[0, "simple-linear-regression-model-using-scikit-learn"], [31, "simple-linear-regression-model-using-scikit-learn"]], "Simple neural network and the back propagation equations": [[38, "simple-neural-network-and-the-back-propagation-equations"], [39, "simple-neural-network-and-the-back-propagation-equations"]], "Simple one-dimensional second-order polynomial": [[18, "simple-one-dimensional-second-order-polynomial"]], "Simple program": [[33, "simple-program"], [34, "simple-program"]], "Simpler examples first, and automatic differentiation": [[38, "simpler-examples-first-and-automatic-differentiation"]], "Slightly different approach": [[34, "slightly-different-approach"]], "Smarter way of evaluating the above function": [[38, "smarter-way-of-evaluating-the-above-function"]], "Sneaking in automatic differentiation using Autograd": [[34, "sneaking-in-automatic-differentiation-using-autograd"]], "Software and needed installations": [[25, "software-and-needed-installations"], [31, "software-and-needed-installations"]], "Solving Differential Equations with Deep Learning": [[2, null]], "Solving the one dimensional Poisson equation": [[2, "solving-the-one-dimensional-poisson-equation"]], "Solving the wave equation with Neural Networks": [[2, "solving-the-wave-equation-with-neural-networks"]], "Solving using Newton-Raphson\u2019s method": [[36, "solving-using-newton-raphson-s-method"], [37, "solving-using-newton-raphson-s-method"]], "Some famous Matrices": [[24, "some-famous-matrices"]], "Some parallels from real analysis": [[38, "some-parallels-from-real-analysis"]], "Some selected properties": [[36, "some-selected-properties"]], "Some simple problems": [[13, "some-simple-problems"], [33, "some-simple-problems"]], "Some useful matrix and vector expressions": [[32, "some-useful-matrix-and-vector-expressions"]], "Splitting our Data in Training and Test data": [[0, "splitting-our-data-in-training-and-test-data"], [32, "splitting-our-data-in-training-and-test-data"]], "Standard Approach based on the Normal Distribution": [[35, "standard-approach-based-on-the-normal-distribution"]], "Standard steepest descent": [[13, "standard-steepest-descent"]], "Statistical analysis": [[35, "statistical-analysis"], [36, "statistical-analysis"]], "Statistical analysis and optimization of data": [[23, "statistical-analysis-and-optimization-of-data"], [31, "statistical-analysis-and-optimization-of-data"]], "Steepest descent": [[13, "steepest-descent"], [33, "steepest-descent"]], "Stochastic Gradient Descent": [[34, "stochastic-gradient-descent"]], "Stochastic Gradient Descent (SGD)": [[13, "stochastic-gradient-descent-sgd"], [34, "stochastic-gradient-descent-sgd"]], "Stochastic variables and the main concepts, the discrete case": [[28, "stochastic-variables-and-the-main-concepts-the-discrete-case"]], "Strongly Convex Case": [[34, "strongly-convex-case"]], "Suggested readings and videos": [[37, "suggested-readings-and-videos"]], "Summary of methods to implement and analyze": [[26, "summary-of-methods-to-implement-and-analyze"]], "Summing up": [[35, "summing-up"], [36, "summing-up"]], "Support Vector Machines, overarching aims": [[8, null]], "Synthetic data generation": [[36, "synthetic-data-generation"], [37, "synthetic-data-generation"]], "Systematic reduction": [[3, "systematic-reduction"]], "Teachers": [[31, "teachers"]], "Teachers and Grading": [[29, null]], "Teaching Assistants Fall semester 2023": [[29, "teaching-assistants-fall-semester-2023"]], "Tensorflow": [[39, "tensorflow"]], "Tentative deadllines for projects": [[29, "tentative-deadllines-for-projects"]], "Testing the Means Squared Error as function of Complexity": [[0, "testing-the-means-squared-error-as-function-of-complexity"], [32, "testing-the-means-squared-error-as-function-of-complexity"]], "Testing the XOR gate and other gates": [[39, "testing-the-xor-gate-and-other-gates"]], "Textbooks": [[30, null]], "The back propagation equations for a neural network": [[39, "the-back-propagation-equations-for-a-neural-network"]], "The Algorithm before theorem": [[11, "the-algorithm-before-theorem"]], "The Breast Cancer Data, now with Keras": [[1, "the-breast-cancer-data-now-with-keras"]], "The CART algorithm for Classification": [[9, "the-cart-algorithm-for-classification"]], "The CART algorithm for Regression": [[9, "the-cart-algorithm-for-regression"]], "The CIFAR01 data set": [[3, "the-cifar01-data-set"]], "The Central Limit Theorem": [[35, "the-central-limit-theorem"]], "The Hessian matrix": [[33, "the-hessian-matrix"], [34, "the-hessian-matrix"]], "The Hessian matrix for Ridge Regression": [[33, "the-hessian-matrix-for-ridge-regression"], [34, "the-hessian-matrix-for-ridge-regression"]], "The Jacobian": [[32, "the-jacobian"]], "The MNIST dataset again": [[3, "the-mnist-dataset-again"]], "The Neural Network": [[39, "the-neural-network"]], "The OLS case": [[33, "the-ols-case"]], "The RELU function family": [[1, "the-relu-function-family"], [39, "the-relu-function-family"]], "The Ridge case": [[33, "the-ridge-case"]], "The SVD, a Fantastic Algorithm": [[32, "the-svd-a-fantastic-algorithm"], [33, "the-svd-a-fantastic-algorithm"]], "The Softmax function": [[1, "the-softmax-function"], [39, "the-softmax-function"]], "The \\chi^2 function": [[0, "the-chi-2-function"], [31, "the-chi-2-function"], [31, "id4"], [31, "id5"], [31, "id6"], [31, "id7"], [31, "id8"]], "The approximation theorem in words": [[38, "the-approximation-theorem-in-words"]], "The bias-variance tradeoff": [[6, "the-bias-variance-tradeoff"], [35, "the-bias-variance-tradeoff"], [36, "the-bias-variance-tradeoff"]], "The code for solving the ODE": [[2, "the-code-for-solving-the-ode"]], "The complete code with a simple data set": [[32, "the-complete-code-with-a-simple-data-set"]], "The cost function rewritten": [[36, "the-cost-function-rewritten"], [37, "the-cost-function-rewritten"]], "The cost/loss function": [[32, "the-cost-loss-function"]], "The course has two central parts": [[23, "the-course-has-two-central-parts"]], "The derivative of the Logistic funtion": [[39, "the-derivative-of-the-logistic-funtion"]], "The derivative of the cost/loss function": [[33, "the-derivative-of-the-cost-loss-function"], [34, "the-derivative-of-the-cost-loss-function"]], "The derivatives": [[38, "the-derivatives"], [39, "the-derivatives"]], "The equations": [[33, "the-equations"]], "The equations for ordinary least squares": [[32, "the-equations-for-ordinary-least-squares"]], "The equations to solve": [[36, "the-equations-to-solve"], [37, "the-equations-to-solve"]], "The first Case": [[33, "the-first-case"]], "The gradient step": [[34, "the-gradient-step"]], "The ideal": [[33, "the-ideal"]], "The logistic function": [[7, "the-logistic-function"], [36, "the-logistic-function"]], "The mean squared error and its derivative": [[32, "the-mean-squared-error-and-its-derivative"]], "The moons example": [[8, "the-moons-example"]], "The multilayer perceptron (MLP)": [[12, "the-multilayer-perceptron-mlp"]], "The network with one input layer, specified number of hidden layers, and one output layer": [[2, "the-network-with-one-input-layer-specified-number-of-hidden-layers-and-one-output-layer"]], "The optimization problem": [[38, "the-optimization-problem"]], "The ouput layer": [[38, "the-ouput-layer"], [39, "the-ouput-layer"]], "The plethora of machine learning algorithms/methods": [[31, "the-plethora-of-machine-learning-algorithms-methods"]], "The same example but now with cross-validation": [[35, "the-same-example-but-now-with-cross-validation"], [36, "the-same-example-but-now-with-cross-validation"]], "The sensitiveness of the gradient descent": [[33, "the-sensitiveness-of-the-gradient-descent"]], "The singular value decomposition": [[5, "the-singular-value-decomposition"], [32, "the-singular-value-decomposition"], [33, "the-singular-value-decomposition"]], "The training": [[38, "the-training"], [39, "the-training"]], "The two-dimensional case": [[8, "the-two-dimensional-case"]], "Theoretical Convergence Speed and convex optimization": [[34, "theoretical-convergence-speed-and-convex-optimization"]], "Time decay rate": [[34, "time-decay-rate"]], "To our real data: nuclear binding energies. Brief reminder on masses and binding energies": [[31, "to-our-real-data-nuclear-binding-energies-brief-reminder-on-masses-and-binding-energies"]], "Topics covered in this course: Statistical analysis and optimization of data": [[31, "topics-covered-in-this-course-statistical-analysis-and-optimization-of-data"]], "Towards the PCA theorem": [[11, "towards-the-pca-theorem"]], "Train and test datasets": [[1, "train-and-test-datasets"], [39, "train-and-test-datasets"]], "Two parameters": [[36, "two-parameters"], [37, "two-parameters"]], "Two-dimensional Objects": [[3, "two-dimensional-objects"]], "Type of problem": [[2, "type-of-problem"]], "Types of Machine Learning": [[31, "types-of-machine-learning"]], "Understanding what happens": [[35, "understanding-what-happens"], [36, "understanding-what-happens"]], "Universal approximation theorem": [[38, "universal-approximation-theorem"]], "Updating the gradients": [[38, "updating-the-gradients"], [39, "updating-the-gradients"]], "Usage of the above learning rate schedulers": [[39, "usage-of-the-above-learning-rate-schedulers"]], "Use the books!": [[19, "use-the-books"]], "Useful Python libraries": [[23, "useful-python-libraries"], [31, "useful-python-libraries"]], "Using Autograd": [[13, "using-autograd"]], "Using Keras": [[39, "using-keras"]], "Using Scikit-learn": [[37, "using-scikit-learn"]], "Using forward Euler to solve the ODE": [[2, "using-forward-euler-to-solve-the-ode"]], "Using gradient descent methods, limitations": [[13, "using-gradient-descent-methods-limitations"], [33, "using-gradient-descent-methods-limitations"], [34, "using-gradient-descent-methods-limitations"]], "Using the chain rule and summing over all k entries": [[38, "using-the-chain-rule-and-summing-over-all-k-entries"], [39, "using-the-chain-rule-and-summing-over-all-k-entries"]], "Using the correlation matrix": [[37, "using-the-correlation-matrix"]], "Vanishing gradients": [[39, "vanishing-gradients"]], "Various steps in cross-validation": [[35, "various-steps-in-cross-validation"], [36, "various-steps-in-cross-validation"]], "Visualization": [[1, "visualization"], [1, "id1"], [39, "visualization"], [39, "id1"]], "Visualizing the Tree, Classification": [[9, "visualizing-the-tree-classification"]], "Week 34: Introduction to the course, Logistics and Practicalities": [[31, null]], "Week 35: From Ordinary Linear Regression to Ridge and Lasso Regression": [[32, null]], "Week 36: Linear Regression and Gradient descent": [[33, null]], "Week 37: Gradient descent methods": [[34, null]], "Week 38: Statistical analysis, bias-variance tradeoff and resampling methods": [[35, null]], "Week 39: Resampling methods and logistic regression": [[36, null]], "Week 40: Gradient descent methods (continued) and start Neural networks": [[37, null]], "Week 41 Neural networks and constructing a neural network code": [[38, null]], "Week 42 Constructing a Neural Network code with examples": [[39, null]], "Weights and biases": [[39, "weights-and-biases"]], "What Is Generative Modeling?": [[31, "what-is-generative-modeling"]], "What does it mean?": [[32, "what-does-it-mean"], [33, "what-does-it-mean"]], "What is Machine Learning?": [[0, "what-is-machine-learning"]], "What is a good model?": [[0, "what-is-a-good-model"], [31, "what-is-a-good-model"]], "What is a good model? Can we define it?": [[31, "what-is-a-good-model-can-we-define-it"]], "When do we stop?": [[34, "when-do-we-stop"]], "Which activation function should I use?": [[1, "which-activation-function-should-i-use"]], "Which activation function should we use?": [[39, "which-activation-function-should-we-use"]], "Why Combine Momentum and RMSProp?": [[34, "why-combine-momentum-and-rmsprop"]], "Why Linear Regression (aka Ordinary Least Squares and family)": [[31, "why-linear-regression-aka-ordinary-least-squares-and-family"]], "Why multilayer perceptrons?": [[37, "why-multilayer-perceptrons"], [38, "why-multilayer-perceptrons"]], "Why resampling methods": [[35, "why-resampling-methods"]], "Why resampling methods ?": [[35, "id1"], [36, "why-resampling-methods"]], "Wisconsin Cancer Data": [[7, "wisconsin-cancer-data"]], "With Lasso Regression": [[33, "with-lasso-regression"]], "Wrapping it up": [[35, "wrapping-it-up"]], "Writing Our First Generative Adversarial Network": [[4, "writing-our-first-generative-adversarial-network"]], "Writing our own PCA code": [[11, "writing-our-own-pca-code"]], "Writing the Cost Function": [[33, "writing-the-cost-function"]], "XGBoost: Extreme Gradient Boosting": [[10, "xgboost-extreme-gradient-boosting"]], "Yet another Example": [[33, "yet-another-example"]], "a) Expression for Ridge regression": [[17, "a-expression-for-ridge-regression"]], "scikit-learn implementation": [[1, "scikit-learn-implementation"], [39, "scikit-learn-implementation"]]}, "docnames": ["chapter1", "chapter10", "chapter11", "chapter12", "chapter13", "chapter2", "chapter3", "chapter4", "chapter5", "chapter6", "chapter7", "chapter8", "chapter9", "chapteroptimization", "clustering", "exercisesweek34", "exercisesweek35", "exercisesweek36", "exercisesweek37", "exercisesweek38", "exercisesweek39", "exercisesweek41", "exercisesweek42", "intro", "linalg", "project1", "project2", "schedule", "statistics", "teachers", "textbooks", "week34", "week35", "week36", "week37", "week38", "week39", "week40", "week41", "week42"], "envversion": {"sphinx": 62, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1}, "filenames": ["chapter1.ipynb", "chapter10.ipynb", "chapter11.ipynb", "chapter12.ipynb", "chapter13.ipynb", "chapter2.ipynb", "chapter3.ipynb", "chapter4.ipynb", "chapter5.ipynb", "chapter6.ipynb", "chapter7.ipynb", "chapter8.ipynb", "chapter9.ipynb", "chapteroptimization.ipynb", "clustering.ipynb", "exercisesweek34.ipynb", "exercisesweek35.ipynb", "exercisesweek36.ipynb", "exercisesweek37.ipynb", "exercisesweek38.ipynb", "exercisesweek39.ipynb", "exercisesweek41.ipynb", "exercisesweek42.ipynb", "intro.md", "linalg.ipynb", "project1.ipynb", "project2.ipynb", "schedule.md", "statistics.ipynb", "teachers.md", "textbooks.md", "week34.ipynb", "week35.ipynb", "week36.ipynb", "week37.ipynb", "week38.ipynb", "week39.ipynb", "week40.ipynb", "week41.ipynb", "week42.ipynb"], "indexentries": {}, "objects": {}, "objnames": {}, "objtypes": {}, "terms": {"": [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 12, 13, 15, 16, 17, 19, 21, 22, 23, 24, 25, 26, 28, 29, 31, 32, 38, 39], "0": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 24, 25, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38], "00": [0, 1, 5, 11, 31, 32, 38, 39], "000": [1, 3, 39], "000000": [], "00000000e": [], "001": [2, 8, 13, 21, 33, 34], "004": 5, "004113634617443131": 32, "004113634617443139": 32, "00411363461744314": 32, "004113634617443147": 32, "005b82": [], "00622f": [], "00727646693": [0, 31], "0072b2": [], "00749c": [], "0076268": 21, "008561": [], "0086649156": [0, 31], "00e0e0": [], "01": [0, 1, 2, 5, 9, 11, 13, 17, 30, 31, 32, 34, 36, 37, 38, 39], "010726": [], "0110": 28, "01719003e": [], "02": [0, 4, 7, 12, 31, 36, 37, 39], "02334824": [], "023b95": [], "024c1a": [], "025": 26, "02857": 4, "02f": 6, "03077640549": 4, "03097597e": [], "031": 5, "04": 11, "0458": 9, "05": [4, 6], "0550ae": [], "05767": 38, "062292565": 4, "062435": [], "06730814": [], "07": [], "0713": [0, 31], "07285": 3, "08": 28, "08078025e": [], "080808": [], "08336233266": 4, "08376632": 32, "083766322923899": 32, "0837663229239043": 32, "0917": 9, "0969da4a": [], "0d1117": [], "0n": [0, 31], "0x113e21950": 17, "1": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 24, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37], "10": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 21, 22, 24, 25, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 39], "100": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 24, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "1000": [0, 1, 2, 4, 5, 8, 11, 13, 14, 18, 19, 21, 23, 26, 28, 31, 33, 34, 36, 37, 39], "10000": [2, 5, 6, 10, 11, 13, 28, 35], "100000": 8, "10001": 10, "1001": 28, "1002": 28, "1003": 28, "1005": 28, "1007": [35, 36], "1009": 28, "101": 16, "1011": 28, "1013": 28, "1013904243": 28, "1015": 28, "102": 16, "1023": 28, "1024": 3, "1026": 28, "1027": 28, "103": [1, 39], "1030": 28, "1037": 28, "1038": 28, "1040": 28, "1047": 28, "107": 16, "108": [], "10e": 39, "10th": 9, "10x": [0, 26, 31], "10y": 26, "11": [0, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 24, 25, 26, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "110": [], "1100": 28, "1101": 28, "111": [1, 7, 12, 36, 37, 38, 39], "112": 16, "11340253": [], "11590451": [], "116": 16, "116329": [], "116633": [], "117": 16, "118": 16, "12": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 18, 21, 24, 25, 26, 28, 30, 31, 32, 33, 34, 35, 37, 39], "120": 3, "121": [8, 9, 10, 16], "1215pm": [29, 31], "122": [8, 9, 10], "124": [0, 31], "125": 16, "127": [4, 16], "128": [3, 4, 13, 34], "129": 16, "1298": 9, "12pm": [29, 31], "13": [0, 2, 9, 12, 22, 24, 26, 28, 31, 37], "131": 16, "133": [7, 36], "135": 16, "136": 16, "14": [0, 2, 4, 6, 8, 9, 10, 12, 24, 26, 28, 30, 32, 35, 36], "141": 16, "1412": 34, "141414": [], "143": 16, "1446729567": 4, "149": 16, "14g": [6, 35], "15": [0, 2, 4, 6, 7, 8, 9, 12, 13, 25, 26, 28, 31, 33, 34, 36, 37], "150": [4, 8, 21, 36, 37], "1502": 38, "152": 16, "153760": [], "156": 16, "157": [], "158": [], "159": 16, "15g": [6, 35], "15pm": 31, "16": [1, 2, 3, 4, 5, 8, 9, 10, 21, 28, 31, 33, 35], "160": 16, "1603": 3, "161": 16, "162": 16, "16231451": 4, "163": 16, "16384": 3, "164": 16, "167": 16, "17": [1, 2, 8, 22, 28, 39], "172": 16, "173": 16, "175": [35, 36], "176": 16, "178": 16, "179": 16, "1797": [1, 39], "18": [2, 6, 7, 8, 9, 10, 28, 31, 35, 36], "1807": 4, "181036": [], "18392847": [], "18c1c4": [], "19": [2, 28, 31, 35], "192": [35, 36], "1940": [], "1943": [12, 37, 38], "19569961": 32, "19680801": [], "1970": [24, 31], "1973": 9, "1979": [6, 35], "1989": 38, "1991": 38, "1_1": [12, 37], "1_2": [12, 37], "1_3": [12, 37], "1cm": [0, 8, 10, 28, 31, 38, 39], "1d": [1, 2, 3, 36, 37, 39], "1e": [2, 4, 13, 14, 34, 36, 37, 39], "1e10": 14, "1e1e1": [], "1e4": 6, "1f": 1, "1ffvbn0xlhv": 22, "1k": 24, "1n": [0, 31], "1x": [0, 31], "1zkibvqf": 21, "2": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 23, 24, 25, 28, 30, 34, 35, 36, 37], "20": [0, 1, 2, 6, 7, 8, 16, 17, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "200": [0, 2, 3, 4, 8, 9, 10, 36, 37], "2000": [0, 32], "2001": [], "2004": [13, 33], "2006": 30, "2007": [], "20072279": [], "2008": [31, 34], "2009": [], "2010": [1, 39], "2011": [1, 34, 39], "2012": 34, "2013": [], "2014": [4, 34], "2015": [1, 39], "2016": [0, 31], "2018": [0, 6, 32, 35, 36], "2019": [], "2020": [], "2021": [6, 14, 32, 34], "2022": [26, 31, 38, 39], "2023": 39, "2024": [21, 35], "2025": [18, 21, 22, 26, 31, 32, 33, 34, 35], "21": [0, 1, 5, 7, 9, 12, 24, 31, 32, 33, 36, 37, 38, 39], "2116753732": 4, "215pm": [29, 31], "2167072": [], "22": [0, 1, 5, 12, 13, 24, 31, 32, 33, 37, 39], "221": 8, "225": 4, "22948497": [], "23": [1, 12, 24, 37, 39], "24": [0, 1, 24, 31, 39], "242424": [], "24292f": [], "25": [2, 3, 4, 5, 6, 8, 9, 11, 32], "250": [2, 4, 7, 9, 36], "25000": [], "250154": [], "252124": [], "253775": [], "255": [3, 26], "256": [4, 34], "25x": [25, 26], "26": [], "26303845": [], "264": [], "265": [], "265109911": 4, "266": [], "269": [], "27": [1, 39], "270": [], "278": [33, 34], "27n_": 28, "28": [1, 3, 4, 39], "283": [33, 34], "2830637392": 4, "2861": 28, "2873": 9, "2882": 28, "2886": 28, "2890": [0, 31], "2892": 28, "29": 32, "2915": 28, "2931": 31, "29364655": [], "294399745619595": [], "296247": [], "2968": 31, "2980": [21, 31], "298273": [], "298375": [], "2990": 31, "2_": [12, 37], "2_1": [12, 37], "2_2": [12, 37], "2_3": [12, 37], "2_i": [12, 37], "2_m": [6, 28, 35], "2_t": 13, "2_x": 28, "2a": 17, "2a1968": [], "2b": 28, "2b2b2b": [], "2c8f433990d1": 34, "2cm": 8, "2d": [1, 3, 11, 12, 23, 26, 31, 36, 37, 38, 39], "2e": [6, 35, 36], "2f": [0, 7, 9, 10, 11, 12, 31, 36, 37], "2g": 2, "2g_i": 2, "2k": 3, "2m": [6, 35], "2mvizaqfst8": 32, "2n": [0, 2, 3, 31, 32], "2nd": 9, "2p": [28, 38], "2pt": 4, "2x": [0, 3, 8, 13, 31, 38], "2x_ix_jy_iy_j": 8, "2x_j": 8, "2xb": 38, "2y_i": 10, "2y_j": 8, "3": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 23, 24, 25, 26, 27, 28, 29, 31, 33, 34, 35, 36, 37], "30": [0, 1, 4, 6, 7, 10, 13, 29, 34, 35, 36, 37, 39], "300": [36, 37], "30000": [0, 31], "3072": 3, "31": [12, 24, 28, 37], "315": [6, 32, 34], "3155": [0, 5, 6, 32, 33, 34, 35, 36], "32": [3, 4, 6, 12, 13, 24, 28, 34, 37], "3200": [1, 39], "3250": [1, 39], "3297": [], "33": [12, 24, 29, 37], "3303": [], "3310": [], "332331": [], "333": [7, 36], "3331": [], "3337": [], "34": 24, "3436": [0, 31], "3437": [0, 31], "35": [0, 6, 25, 31, 33, 34], "3581341341": 4, "359": [5, 33], "36": [0, 5, 6, 18, 25, 28], "37": [25, 33, 35, 36], "370782966": 4, "38": [25, 28], "387": [35, 36], "39": [0, 25, 26, 29, 31], "3d": [2, 3, 4, 6, 13, 16, 35, 36], "3d73a9": [], "3f": [1, 3, 9, 39], "3n": 24, "3x": [2, 8], "3x_0x_1": 38, "3x_i": 2, "3y": 8, "4": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 24, 25, 26, 28, 31, 33, 34, 35, 36, 37, 38], "40": [1, 6, 29, 31, 35, 36, 39], "400": 4, "4000": 31, "40008b9a5380fcacce3976bf7c08af5b": 34, "4050": [30, 31], "41": [24, 26], "4155": [2, 15], "41589548": [], "42": [1, 4, 8, 9, 10, 24, 26, 36, 37, 38], "43": [0, 7, 24], "4310": 31, "436462435": 4, "437a6b": [], "44": [0, 24, 33, 34], "45": [29, 31], "46": [29, 31], "462": [7, 36], "47": [29, 31], "473d18": [], "479465113": 4, "47958494": [], "48": [], "48257387": [29, 31], "49": [5, 6, 11], "49152": 3, "4940954": [0, 31], "4990": 28, "4992": 28, "4997": 28, "4c4b4be8": [], "4c4c7f": [9, 10], "4d": 3, "4f": [6, 26, 36, 37], "4pm": [29, 31], "4y": 8, "4y_i": 10, "5": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "50": [1, 2, 3, 4, 6, 7, 8, 10, 13, 26, 31, 32, 34, 35, 37, 38, 39], "500": [1, 3, 4, 6, 9, 10, 13, 34, 35, 36, 39], "5000": [25, 26], "5018": 28, "506": [], "507d50": [9, 10], "50j": 13, "50x10": [1, 39], "51": 10, "510": [1, 39], "512132": [], "515151": [], "5177783846": 4, "52": 36, "53": [9, 36], "5391cf": [], "54": [6, 28], "5411205": [], "54894451": [], "55": [1, 39], "56": [1, 39], "56469864": 21, "56536": [0, 31], "569": 1, "57": [0, 8, 29, 31], "571": [5, 33], "576": 35, "58": [10, 29, 31], "58a6ff70": [], "591317992": 4, "5ca7e4": [], "5cm": 28, "5f": [8, 34], "5x": [8, 18], "5y": 8, "6": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 18, 24, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 39], "60": [1, 3], "60000": 4, "6019067271": 4, "60610368": 21, "606439": [], "61362": 26, "622cbc": [], "625": [7, 36], "63": [1, 39], "64": [1, 3, 4, 13, 24, 31, 34, 39], "64x50": [1, 39], "65": [1, 8, 9, 39], "66666691": [], "66707b": [], "66ccee": [], "66e9ec": [], "6730c5": [], "6887363571": 4, "69": [16, 28], "69069n_": 28, "691": [], "6980": 34, "6e7681": [], "6e7781": [], "6f98b3": [], "6n_": 28, "7": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 24, 25, 26, 28, 30, 31, 32, 34, 35, 36, 37, 38, 39], "70": [1, 7, 36, 39], "702c00": [], "70653767": 4, "71": [1, 39], "724": 3, "72f088": [], "73": [], "7304881": [], "737373": [], "75": [5, 6, 8, 11, 35], "76": [29, 31, 36], "765": [7, 36], "77": [29, 31], "7718": 9, "7782028952": 4, "77893972": [], "78": [], "797979": [], "7998f2": [], "79c0ff": [], "7d7d58": [9, 10], "7ee787": [], "7f4707": [], "8": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 18, 19, 21, 24, 26, 28, 29, 31, 33, 36, 37, 39], "80": [0, 1, 5, 8, 17, 32, 39], "800": [4, 7, 36], "8045e5": [], "81": [1, 39], "815am": [29, 31], "81b19b": [], "8250df": [], "84858": [35, 36], "85": [1, 39], "8702784034": 4, "8786ac": [], "88": 31, "8a4600": [], "8b949e": [], "8c8c8c": [], "8f": [6, 35, 36], "8g": [6, 35], "8n": 24, "8x8": [1, 39], "9": [0, 1, 2, 4, 5, 6, 7, 8, 9, 11, 12, 13, 24, 28, 31, 34, 36, 37, 39], "90": 1, "9040": 9, "91": [29, 31], "912583": [], "91cbff": [], "92": [29, 31], "93": 16, "931": [0, 31], "933": [5, 33], "937": 28, "938": 28, "939": [0, 28, 31], "94": 28, "95": [1, 11, 35, 39], "953800": [], "954": 28, "955820c21e8b": 4, "9579870417283": 21, "96": [6, 35], "960": 28, "961": 28, "962": 28, "9649652536": 4, "96611194e": [], "974eb7": [], "978": [35, 36], "9780387310732": 30, "9780387848570": 30, "9781098134174": 31, "9781492032632": 30, "9781801819312": 31, "97898392": 32, "98": [0, 1, 16, 39], "985": 28, "986": 28, "98661b": [], "989": 28, "9898ff": [9, 10], "99": [13, 16, 34, 35], "991": 28, "992": 28, "993": 28, "996": 5, "996b00": [], "999": [9, 28, 34, 39], "999999": [], "9e86c8": [], "9e8741": [], "9f4e55": [], "9x": 6, "9y": 6, "A": [2, 3, 5, 6, 7, 10, 11, 12, 13, 15, 16, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 38], "AND": 2, "AS": [], "AT": [], "And": [0, 3, 4, 5, 6, 9, 13, 20, 22, 23, 25, 26, 28, 33], "As": [0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 13, 15, 16, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "At": [0, 4, 6, 13, 20, 31, 34], "BE": [0, 31], "BUT": [], "BY": [], "Be": [2, 18, 23, 31], "Being": 13, "But": [0, 1, 2, 3, 5, 6, 9, 10, 16, 21, 26, 28, 32, 35, 36, 39], "By": [0, 3, 5, 6, 12, 13, 17, 19, 24, 31, 32, 33, 34, 35, 37], "FOR": [], "For": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 18, 19, 21, 22, 23, 24, 25, 26, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "IF": [6, 32, 34], "IN": 30, "If": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 18, 21, 22, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "In": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 22, 23, 24, 25, 26, 28, 30, 31, 32, 33, 34, 35, 36, 37, 39], "Ising": [5, 12, 32, 33, 37, 38], "It": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 18, 20, 21, 22, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "Its": [1, 2, 4, 11, 39], "NO": [], "NOT": [], "No": [6, 9, 31, 32, 34, 37, 39], "Not": [0, 1, 5, 6, 32, 33, 34, 35, 37, 39], "OF": [], "ON": [], "OR": 28, "Of": 28, "On": [0, 3, 25, 28, 29, 30, 31, 34, 35], "One": [0, 1, 3, 4, 5, 6, 7, 8, 11, 12, 13, 17, 28, 32, 33, 34, 35, 36, 37, 38, 39], "Or": [0, 1, 6, 31, 39], "SUCH": [], "Such": [0, 6, 12, 16, 28, 34, 35, 36, 37, 38, 39], "THE": [], "TO": 39, "That": [0, 5, 7, 10, 11, 12, 14, 25, 26, 28, 31, 35, 36, 37, 38, 39], "The": [4, 10, 13, 14, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30], "Then": [0, 1, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 24, 31, 33, 34, 35, 38, 39], "There": [0, 3, 4, 5, 6, 8, 9, 11, 12, 14, 15, 24, 25, 26, 28, 29, 31, 32, 33, 34, 37, 38], "These": [0, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 17, 18, 22, 24, 25, 26, 28, 29, 31, 32, 33, 34, 38, 39], "To": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 20, 21, 22, 24, 26, 28, 32, 33, 34, 35, 36, 37, 38, 39], "WITH": [], "Will": [36, 37], "With": [0, 5, 6, 8, 9, 10, 11, 12, 14, 16, 19, 21, 24, 25, 26, 28, 31, 32, 35, 36, 37, 38, 39], "_": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 21, 24, 25, 31, 32, 33, 34, 35, 36, 37, 39], "_0": [5, 8, 10, 11, 13, 32, 33], "_1": [2, 5, 6, 8, 10, 11, 12, 13, 14, 24, 32, 33, 34, 38, 39], "_2": [2, 5, 8, 11, 12, 13, 24, 32, 34, 37], "_3": 24, "_4": 24, "_9": [13, 34], "__array_finalize__": [], "__class__": [10, 39], "__doc__": [6, 35, 36], "__future__": [8, 9, 38], "__getattribute__": [], "__import__": [], "__init__": [1, 22, 36, 37, 39], "__main__": 2, "__name__": [2, 10, 39], "__new__": [], "__path__": [], "_accuraci": 39, "_add_intercept": [36, 37], "_auto1": [2, 3, 4, 5, 6, 7, 12, 13, 24, 28, 32, 33, 36, 37, 38, 39], "_auto10": [6, 12], "_auto11": 6, "_auto12": 6, "_auto2": [2, 3, 4, 5, 6, 12, 13, 24, 28, 37, 38, 39], "_auto3": [3, 4, 5, 6, 12, 13, 24, 37, 38, 39], "_auto4": [4, 6, 12, 13, 24, 37], "_auto5": [4, 6, 12, 13, 24, 37], "_auto6": [4, 6, 12, 24, 37], "_auto7": [4, 6, 12, 24, 37], "_auto8": [6, 12], "_auto9": [6, 12], "_backpropag": 39, "_build": [0, 23, 25, 26, 30, 31, 39], "_c": [1, 39], "_center": [], "_compile_transl": [], "_compon": 11, "_da": 22, "_data": [], "_depth": 9, "_export": [15, 16, 19], "_feed_forward_sav": 22, "_feedforward": 39, "_format": 39, "_fraction": 9, "_i": [0, 1, 2, 5, 6, 7, 8, 11, 12, 13, 19, 25, 31, 32, 33, 34, 35, 36, 37, 38, 39], "_j": [0, 1, 2, 3, 5, 6, 8, 13, 19, 25, 32, 33, 34, 35, 36, 39], "_k": [13, 33, 34, 39], "_l": [12, 37, 38, 39], "_lambda": 6, "_leaf": 9, "_m": 10, "_mask": [], "_multilayer_perceptron": [], "_n": [2, 5, 8, 11, 13, 32, 33, 34], "_node": 9, "_norm": [], "_p": [5, 8, 32, 33], "_parse_numpydoc_see_also_sect": [], "_progress_bar": 39, "_pydevd_bundl": [], "_ratio": 11, "_sampl": 9, "_set_classif": 39, "_sigmoid": [36, 37], "_softmax": [36, 37], "_split": [6, 9, 25], "_t": [13, 34], "_test": [6, 25], "_varianc": 11, "_weight": 9, "a0": 3, "a0111f": [], "a0faa0": [9, 10], "a1": [0, 21, 22, 31], "a11": [], "a12236": [], "a2": [0, 21, 22, 31], "a25e53": [], "a2bffc": [], "a3": [0, 31], "a4": [0, 31], "a5d6ff": [], "a_": [0, 1, 16, 24, 31, 32, 38, 39], "a_0": [0, 31, 38, 39], "a_1": [38, 39], "a_1a": [0, 31], "a_2": [38, 39], "a_2a": [0, 31], "a_3": [0, 31], "a_3a": [0, 31], "a_4": [0, 31], "a_4a": [0, 31], "a_h": [1, 39], "a_i": [0, 1, 2, 12, 31, 38, 39], "a_j": [1, 12, 38, 39], "a_k": [0, 1, 12, 38, 39], "a_matric": 39, "aa": [], "aaa": [], "aaron": 30, "ab": [0, 2, 5, 13, 14, 31, 32, 34, 38], "ab6369": [], "ab_channel": [23, 37, 38, 39], "abandon": [1, 39], "abe338": [], "abid": 28, "abil": [0, 10], "abl": [0, 1, 4, 5, 6, 7, 10, 12, 13, 16, 18, 20, 21, 25, 32, 33, 34, 36, 37, 38, 39], "about": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 19, 20, 22, 23, 24, 25, 29, 34, 35, 36, 37, 39], "abov": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 24, 26, 28, 30, 31, 32, 34, 35, 36, 37], "abovement": [6, 25, 31, 35, 36], "abscissa": [13, 33], "absent": 34, "absolut": [0, 2, 5, 6, 13, 31, 32, 33, 35, 36], "absorb": [32, 33], "abstract": [1, 34, 36, 39], "abund": 34, "ac": [], "acc_bin": [36, 37], "acc_multi": [36, 37], "acceler": [13, 34], "accept": [0, 3, 6, 9, 21, 25, 32, 34], "access": [3, 11, 28, 31, 34], "accid": [4, 6, 35, 36], "accompani": [0, 31, 32], "accomplish": [8, 9, 13, 34], "accord": [0, 1, 2, 5, 6, 9, 12, 13, 14, 28, 31, 33, 34, 35, 37, 38, 39], "accordingli": 11, "account": [0, 3, 5, 13, 15, 16, 20, 28, 31, 34], "accumul": [12, 13, 28, 34, 37, 38, 39], "accur": [0, 3, 4, 6, 10, 13, 34, 35, 36], "accuraci": [0, 1, 3, 4, 5, 6, 7, 9, 10, 11, 12, 21, 26, 31, 32, 33, 36, 37, 38, 39], "accuracy_scor": [0, 1, 10, 21, 22, 26, 31, 36, 37, 39], "accuracy_score_numpi": [1, 39], "acheiv": 21, "achiev": [0, 1, 5, 6, 8, 12, 24, 31, 34, 35, 36, 37, 38, 39], "aco": 28, "acquaint": 23, "acquir": [1, 23, 31, 39], "acr": [], "across": [1, 3, 6, 9, 17, 23, 31, 35, 39], "act": [1, 3, 24, 26, 34, 39], "act_func": 39, "act_func_deriv": 39, "actic": 21, "action": 28, "activ": [0, 2, 3, 4, 9, 15, 22, 27, 29, 31, 34], "activation_d": 22, "activation_func": [21, 22], "activest": [], "actual": [0, 1, 4, 5, 6, 8, 11, 15, 16, 18, 21, 24, 28, 31, 32, 33, 34, 35, 39], "ad": [1, 3, 4, 5, 8, 13, 15, 16, 24, 33, 34, 35, 36], "ada_clf": 10, "adaboostclassifi": 10, "adadelta": [13, 34], "adagrad": [25, 35, 38, 39], "adagradmomentum": 39, "adam": [1, 3, 4, 21, 25, 26, 31, 35, 38, 39], "adam_schedul": 39, "adap": 38, "adapt": [4, 6, 13, 17, 26, 30, 33, 35, 36, 38], "add": [0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 15, 16, 17, 18, 20, 21, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "add6ff": [], "add_": [], "add_subplot": [1, 7, 12, 14, 36, 37, 39], "addendum": 5, "addeventlisten": [], "addit": [0, 2, 3, 5, 6, 7, 8, 9, 10, 12, 13, 15, 21, 23, 24, 25, 26, 28, 29, 30, 31, 32, 35, 36, 37, 38, 39], "addition": [12, 13, 33, 34, 37, 38], "address": [1, 9, 11, 13, 31, 34, 39], "adjac": [3, 12, 37, 38], "adjoint": [5, 32], "adjust": [0, 5, 12, 13, 33, 34, 37], "admir": [0, 31], "advanc": [4, 6, 12, 30, 31, 34, 35, 36, 37, 38], "advantag": [1, 3, 5, 6, 10, 13, 19, 24, 26, 33, 34, 35, 36, 39], "adversari": 31, "advis": [], "afecionado": 31, "affect": [3, 15, 19, 39], "affin": [0, 3, 8, 11, 32, 38], "afford": 3, "aficionado": 31, "aforement": 14, "african": [], "after": [0, 1, 2, 4, 5, 6, 9, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 38, 39], "afterward": [0, 31], "ag": [0, 7, 31, 32, 36], "ag_0": 2, "again": [0, 1, 4, 5, 6, 7, 8, 10, 11, 12, 13, 25, 26, 28, 31, 32, 33, 35, 36, 37, 38, 39], "against": [1, 4, 7, 10, 36, 39], "agegroup": [7, 36], "agegroupmean": [7, 36], "aggreg": [9, 10, 34], "agorithm": 10, "agre": [5, 6, 28, 32, 33, 34, 35], "agreement": [13, 34], "ahead": 9, "ai": [0, 30], "aid": [11, 20, 34], "aim": [0, 1, 4, 6, 7, 11, 14, 16, 17, 19, 20, 23, 24, 25, 26, 32, 35, 36, 37, 38, 39], "ainv": 5, "airplan": 3, "aka": [5, 26], "al": [0, 2, 4, 16, 17, 20, 26, 30, 31, 32, 33, 35, 36, 37, 38, 39], "alarm": [5, 7], "aldo": 32, "algebra": [0, 3, 5, 13, 23, 32, 33, 35], "algorithm": [0, 1, 2, 4, 5, 6, 7, 8, 13, 14, 16, 23, 24, 25, 28, 30, 35, 36, 37], "align": [0, 2, 5, 6, 7, 8, 13, 28, 31, 32, 33, 35, 36, 37], "all": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37], "allclos": 21, "allevi": [1, 13, 33, 39], "alloc": [3, 24], "allow": [0, 1, 2, 3, 5, 6, 8, 10, 13, 15, 23, 24, 25, 31, 32, 33, 34, 35, 36, 37, 38, 39], "almost": [0, 1, 6, 8, 11, 13, 28, 33, 34, 35, 36, 37, 39], "alon": [2, 9, 34], "along": [2, 3, 4, 5, 6, 9, 10, 11, 15, 20, 21, 22, 23, 24, 31, 32, 33, 35, 36, 39], "alpha": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 13, 14, 28, 31, 32, 33, 34, 35, 36, 37, 39], "alpha_": [10, 34], "alpha_0": 3, "alpha_1": 3, "alpha_2": 3, "alpha_i": [3, 13], "alpha_k": 13, "alpha_m": 10, "alpha_n": 3, "alpha_opt": 13, "alreadi": [2, 3, 4, 5, 6, 10, 12, 15, 22, 23, 24, 28, 31, 32, 33, 36, 37, 38], "also": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 22, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "alter": [1, 39], "altern": [0, 1, 4, 5, 6, 8, 9, 11, 13, 15, 18, 24, 25, 31, 32, 34, 35, 36, 39], "although": [0, 1, 5, 6, 8, 10, 13, 16, 19, 20, 31, 34, 35, 36, 38, 39], "alwai": [0, 3, 5, 6, 12, 13, 16, 19, 21, 22, 25, 26, 28, 31, 32, 33, 34, 35, 37, 38], "am": 4, "ambit": [38, 39], "ame2016": [0, 31], "american": [], "amjith": [], "among": [0, 3, 5, 9, 10, 12, 24, 31, 32, 37, 38], "amongst": [5, 35], "amount": [0, 1, 3, 4, 6, 8, 10, 14, 23, 35, 36, 38, 39], "an": [1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 28, 29, 30, 32, 33, 34, 35, 36, 37, 39], "an_": 28, "anaconda": [0, 1, 23, 25, 31, 39], "analogi": 13, "analys": [6, 35, 36], "analysi": [1, 3, 4, 7, 14, 19, 24, 30, 34, 37, 39], "analyt": [2, 3, 5, 6, 7, 12, 13, 17, 22, 23, 25, 31, 32, 33, 34, 35, 36, 37, 38], "analyz": [0, 1, 3, 4, 5, 6, 16, 25, 28, 32, 33, 34], "andrew": [1, 39], "angl": [0, 3, 9, 32, 34], "anharmon": 3, "ani": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 19, 21, 28, 31, 32, 34, 35, 38, 39], "anim": [4, 12, 37, 38], "ann": [12, 37, 38], "annot": [0, 1, 3, 7, 8, 31, 37, 39], "announc": 31, "anom": [], "anomali": [], "anonym": 18, "anoth": [0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 24, 25, 26, 28, 31, 32, 34, 38, 39], "ansatz": [0, 18, 31], "answer": [0, 1, 3, 5, 6, 19, 22, 24, 25, 26, 29, 31, 35, 39], "antialias": [2, 6], "anticip": 4, "anymor": [1, 8, 39], "anyon": [4, 8, 15], "anyth": [1, 15, 16, 21, 22, 28, 39], "anytim": [29, 31], "anywai": [], "apach": [1, 39], "apart": [11, 13, 33, 34], "api": [1, 23, 31, 39], "appar": 2, "appear": [0, 1, 3, 13, 24, 28, 38, 39], "append": [1, 3, 4, 8, 9, 13, 19, 21, 22, 31, 34, 36, 37, 39], "appendic": [25, 26], "appendix": 25, "appli": [0, 1, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 18, 25, 26, 28, 30, 31, 32, 34, 35, 36, 37, 38, 39], "applic": [0, 1, 3, 4, 5, 6, 7, 9, 12, 13, 16, 24, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "apply_gradi": 4, "approach": [1, 2, 4, 5, 6, 9, 10, 11, 12, 13, 15, 16, 18, 21, 23, 25, 28, 30, 32, 33, 38, 39], "approch": 25, "appropri": [2, 6, 9, 12, 13, 17, 23, 28, 34, 35, 36, 37], "approv": 31, "approx": [0, 2, 3, 6, 10, 11, 13, 18, 25, 28, 31, 33, 34, 35], "approxim": [0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 13, 19, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 39], "apt": [0, 23, 25, 31], "aq": 28, "ar": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "aragorn": 31, "arang": [1, 3, 4, 6, 7, 9, 10, 12, 13, 31, 34, 36, 37, 39], "arbitrari": [1, 4, 6, 8, 12, 13, 28, 33, 35, 37, 38, 39], "arbitrarili": [0, 1, 11, 31, 34, 39], "arc": 6, "architectur": [3, 4, 12, 26, 38], "archiv": [25, 26], "area": [0, 3, 6, 30, 31], "argmax": [1, 11, 21, 36, 37, 39], "argmin": [4, 10, 14], "argsort": 11, "argu": [1, 13, 26, 39], "arguement": 19, "argument": [0, 2, 3, 5, 11, 12, 13, 17, 21, 31, 32, 34, 35, 37, 38, 39], "aris": [0, 6, 12, 13, 28, 31, 33, 35, 36], "arithmet": [0, 13, 24, 31], "arm": [6, 32, 34], "armadillo": 24, "armin": [], "arnulf": [38, 39], "around": [0, 1, 4, 5, 6, 11, 18, 21, 22, 25, 26, 28, 31, 35, 36, 37, 38, 39], "arrai": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 16, 18, 21, 23, 25, 28, 32, 33, 34, 35, 36, 37, 38, 39], "arrang": [3, 31], "array_equ": [36, 37], "arraybox": 13, "arriv": [0, 6, 9, 11, 19, 24, 28, 31, 35], "arrow": [12, 37, 38, 39], "arrowprop": 8, "art": [0, 1, 23, 39], "articl": [0, 3, 4, 6, 10, 19, 26, 31, 32, 33, 34, 35, 36], "artifici": [0, 2, 7, 12, 30, 31, 36], "artificialneuron": [12, 37, 38], "arug": 13, "arxiv": [3, 4, 34, 38], "as_fram": 26, "asarrai": [0, 6, 9, 32, 34], "asid": 32, "ask": [5, 6, 11, 12, 15, 19, 25, 26, 35, 38, 39], "aspect": [0, 6, 23, 31, 32, 38, 39], "assembl": 3, "assembli": [0, 31], "assert": [4, 39], "assess": [0, 6, 25, 31, 32, 35, 36], "asset": [], "assici": 4, "assign": [0, 7, 8, 9, 12, 13, 14, 15, 27, 29, 30, 31, 36, 37, 39], "associ": [0, 6, 9, 12, 14, 28, 31, 35, 36, 37, 38], "assum": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 19, 24, 25, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "assumpt": [0, 3, 5, 6, 9, 11, 28, 31, 32, 36], "ast": [0, 5, 6, 31, 35], "astyp": [4, 9, 10, 36, 37], "asymmetri": [0, 31], "asymptot": [4, 6, 34, 35, 36], "atom": [0, 31], "attain": 34, "attempt": [0, 4, 6, 7, 8, 10, 31, 32, 34, 36, 38, 39], "attend": 31, "attent": [0, 24, 31], "attract": [0, 10, 31], "attribut": [0, 9, 22, 31, 39], "audi": [0, 31], "audio": [3, 4], "august": [31, 32], "aurelien": [0, 30, 31], "austfjel": 6, "auth": 15, "authent": 15, "author": [0, 1, 10, 28, 39], "authour": 31, "auto": [9, 10, 26, 28, 39], "auto_exampl": [21, 25, 32], "autocor": 28, "autocorrelation_tim": 28, "autocorrelform": 28, "autocovari": 28, "autoencod": [4, 23, 31], "autoencond": 23, "autograd": [21, 23, 26, 31, 38, 39], "autograd_compliant_predict": 22, "autograd_gradi": 22, "autograd_one_lay": 22, "autom": [0, 23, 30, 31], "automac": 24, "automag": 31, "automat": [0, 1, 2, 3, 4, 11, 16, 21, 22, 23, 24, 26, 31, 37, 39], "automobil": 3, "autonom": 4, "avail": [0, 1, 4, 6, 10, 11, 23, 24, 25, 26, 27, 29, 30, 31, 35, 36, 39], "avali": [20, 25, 26], "averag": [0, 1, 3, 6, 9, 10, 13, 14, 28, 29, 31, 32, 35, 36, 39], "avoid": [0, 4, 5, 6, 9, 11, 13, 18, 21, 24, 32, 34, 35, 36, 39], "awai": [2, 3, 6, 32, 34, 38], "awar": [2, 10], "award": [29, 31], "ax": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 20, 21, 24, 25, 26, 31, 35, 36, 37, 39], "axes3d": [2, 6, 13, 33, 34], "axes_grid1": 6, "axhlin": 8, "axi": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 18, 21, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "axiom": 5, "axvlin": [4, 8], "axvspan": 4, "b": [0, 1, 3, 4, 5, 6, 8, 9, 10, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "b1": [8, 21, 22], "b19db4": [], "b1bac4": [], "b2": [8, 21, 22], "b3": 8, "b35900": [], "b89784": [], "b_": [0, 1, 24, 38, 39], "b_0": [0, 38], "b_1": [0, 2, 12, 13, 34, 37, 38, 39], "b_2": [0, 13, 38, 39], "b_5": [13, 34], "b_g": [21, 22], "b_group": 9, "b_i": [0, 1, 2, 12, 31, 37, 38, 39], "b_ia_": [0, 31], "b_ia_i": 0, "b_index": 9, "b_j": [1, 12, 37, 38, 39], "b_k": [0, 1, 12, 13, 34, 37, 38, 39], "b_m": [12, 37], "b_score": 9, "b_valu": 9, "ba": 34, "babcock": 31, "bach": 34, "bachelor": [27, 29], "back": [0, 3, 4, 5, 6, 8, 9, 10, 15, 16, 21, 24, 26, 28, 31, 34], "backbon": 24, "backend": [1, 4, 39], "background": [30, 31, 39], "backprogag": 22, "backpropag": [1, 21, 26, 34, 38, 39], "backpropog": 22, "backslash": [], "backtrack": 9, "backup": 24, "backward": [1, 2, 4, 12, 22, 24, 34, 38, 39], "bad": [6, 17, 26, 32, 39], "badli": 28, "bag": [9, 23, 31], "bag_clf": 10, "baggin": 31, "baggingboot": 10, "baggingclassifi": 10, "baggingtre": 10, "bailei": [], "balanc": [6, 34, 35, 36], "ballpark": 18, "band": 24, "bandwidth": 24, "banner": [], "bar": [0, 6, 11, 25, 31, 39], "barber": 30, "bare": [4, 10], "base": [0, 1, 3, 4, 5, 7, 8, 9, 10, 14, 15, 16, 17, 23, 28, 29, 30, 31, 32, 33, 36, 37, 38, 39], "basi": [5, 7, 8, 10, 11, 12, 13, 24, 32, 33, 36, 37, 38], "basic": [6, 8, 12, 13, 14, 15, 23, 25, 26, 28, 31, 35, 39], "basin": 34, "batch": [3, 4, 11, 12, 13, 21, 33, 36, 37], "batch_shap": 4, "batch_siz": [1, 3, 4, 39], "batchnorm": 4, "bay": [7, 36, 37], "baydin": 38, "bayesian": [5, 23, 30, 31], "bbbbbb": [], "beauti": [], "becam": [], "becaus": [0, 1, 2, 3, 4, 5, 6, 8, 9, 12, 13, 14, 31, 32, 33, 34, 35, 36, 37, 39], "becom": [0, 1, 2, 5, 6, 7, 9, 12, 13, 19, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "been": [0, 1, 2, 3, 4, 5, 6, 11, 12, 13, 19, 20, 23, 24, 25, 26, 31, 32, 34, 35, 37, 38, 39], "befor": [0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 24, 25, 28, 31, 32, 34, 35, 36, 37, 38, 39], "beforehand": [0, 28, 31], "began": [], "begin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 22, 24, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "beginn": 26, "behav": [1, 6, 13, 33, 35, 36, 39], "behavior": [0, 1, 13, 31, 33, 34, 39], "behaviour": [12, 34, 37, 38, 39], "behind": [0, 1, 6, 8, 13, 31, 33, 39], "being": [0, 1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 17, 20, 28, 31, 32, 33, 34, 36, 37, 38, 39], "believ": [9, 24], "belong": [7, 8, 9, 13, 14, 33, 36, 37, 39], "below": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 18, 21, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "benchmark": [10, 26], "benefici": [1, 13, 39], "benefit": [0, 1, 4, 11, 13, 23, 31, 33, 34, 39], "bengio": [1, 26, 30, 31, 32, 34], "benign": [1, 7, 37], "benno": [38, 39], "berner": [38, 39], "besid": [4, 5, 33], "bessel": [5, 32, 35], "best": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 18, 21, 26, 29, 31, 32, 33, 34, 35, 36, 37, 39], "beta": [1, 3, 10, 11, 13, 16, 17, 19, 31, 32, 33, 39], "beta1": [], "beta2": [], "beta_": [3, 13, 17, 32], "beta_0": [1, 3, 13, 32, 39], "beta_1": [1, 3, 10, 13, 32, 34, 39], "beta_1m_": 34, "beta_1x_i": 13, "beta_2": [3, 13, 34], "beta_2v_": 34, "beta_3": 3, "beta_i": [3, 34], "beta_j": [13, 32], "beta_k": 13, "beta_linreg": 13, "beta_m": 10, "beta_mg_m": 10, "beta_n": 3, "better": [0, 1, 2, 3, 4, 6, 9, 10, 11, 12, 13, 19, 20, 22, 31, 32, 34, 35, 39], "between": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "beyond": [0, 1, 5, 6, 8, 13, 31, 32, 33, 34, 39], "bf": [13, 14, 24, 28, 33], "bf5400": [], "bg": 31, "bgd": [13, 34], "bia": [0, 1, 2, 3, 5, 8, 9, 10, 12, 13, 20, 21, 22, 26, 31, 32, 33, 37, 38, 39], "bias": [1, 2, 3, 5, 6, 9, 12, 19, 21, 22, 26, 34, 35, 37], "bib": [], "bibliographi": [25, 26], "bibtex": [], "big": [0, 1, 2, 5, 6, 14, 19, 34, 35, 39], "bigger": [1, 6, 32, 39], "bigr": [12, 37], "bike": 9, "bilbo": 31, "billion": [3, 12, 23, 34, 37, 38], "bin": [7, 28, 37], "binari": [0, 3, 5, 7, 9, 10, 12, 26, 31, 36, 37], "binary_cross_entropi": [36, 37], "binary_result": [36, 37], "binarycrossentropi": 4, "bind": 0, "binomi": [23, 28, 31], "binsboot": [6, 35], "bioinformat": 0, "biolog": [1, 12, 37, 38, 39], "bios1100": [23, 31], "bird": [0, 3], "birth": 31, "bishop": [30, 31], "bit": [1, 4, 19, 21, 24, 28, 31, 39], "bitwis": 28, "bivari": 2, "bk": [13, 34], "bla": [24, 31], "black": [8, 9, 14], "blame": [], "block": [6, 10, 23, 24, 28, 31, 35, 36], "blockquot": [], "blog": [26, 31], "blogpost": 4, "blue": [0, 3], "bm": [], "bmatrix": [0, 1, 3, 5, 7, 8, 11, 13, 24, 31, 32, 33, 34, 36, 37, 38, 39], "bmi": [1, 39], "bodi": [0, 1, 4, 12, 37, 38, 39], "bold": 1, "boldfac": [0, 5, 16, 32, 33], "boldsymbol": [0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 13, 14, 16, 17, 19, 25, 31, 33, 34, 36, 37, 38, 39], "boltzmann": [12, 23, 31, 37, 38], "book": [17, 25, 26, 30, 31, 32, 35, 36], "book1": 30, "bool": [], "boolean": [4, 17], "boost": [1, 9, 23, 31, 39], "boostrap": 10, "bootstrap": [1, 13, 19, 23, 25, 31, 34, 39], "born": 34, "borrow": 31, "boston_dataset": [], "bot": 8, "both": [0, 1, 4, 5, 6, 8, 9, 10, 13, 14, 15, 16, 17, 19, 23, 24, 25, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 39], "bottl": [7, 36, 37], "bottou": 34, "bound": [8, 12, 34, 37, 38, 39], "boundari": [2, 4, 8, 11, 12], "bousquet": 34, "bower": [], "box": [4, 9, 21, 22], "boyd": [8, 13, 33], "bracket": [4, 28], "brain": [1, 7, 12, 36, 37, 38, 39], "branch": [9, 31], "break": [0, 4, 6, 11, 14, 31, 34], "breast": [5, 7, 11, 37], "breviti": 13, "brew": [0, 23, 25, 31], "brg": 8, "brian": [], "brief": [25, 26, 32], "briefli": [0, 16, 19, 26, 31, 35], "bring": [0, 5, 6, 10, 26, 32, 34], "britt": [29, 31], "broad": 0, "broadcast": 21, "broadli": 31, "brought": [13, 23, 31], "brownle": 4, "browser": [15, 31], "brute": [3, 5, 11, 32, 38], "bsd": [], "budget": 34, "buffer_s": 4, "bug": [], "bugfix": [], "bui": 4, "build": [0, 4, 5, 6, 10, 16, 22, 24, 28, 31, 35, 36, 37, 38], "buildmodel_tutori": 26, "built": [1, 3, 4, 6, 35, 36, 39], "bunch": 11, "bundl": [], "busi": [], "bxe2t": [37, 38, 39], "byte": [24, 31], "c": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39], "c1": [8, 11], "c2": [8, 11], "c4a2f5": [], "c5e478": [], "c9d1d9": [], "c_": [8, 9, 10, 13, 28, 33, 34], "c_0": 28, "c_1": [12, 37], "c_2": [12, 37], "c_3": [12, 37], "c_4": [12, 37], "c_i": [12, 13, 34, 37], "c_k": 28, "ca": [1, 31], "caab6d": [], "cach": 10, "cal": [0, 8, 10, 12, 13, 33, 34, 38, 39], "calcul": [0, 1, 2, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 19, 22, 24, 26, 28, 31, 34, 35, 36, 37, 38, 39], "california": [25, 26], "call": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 19, 21, 23, 24, 25, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "callabl": 39, "calor": [0, 32], "caltech": [], "cambridg": [13, 30, 33, 38, 39], "can": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 32, 33, 37, 39], "cancel": [0, 13, 31, 32], "cancer": [5, 10, 37], "cancerpd": [7, 37], "candid": [8, 9, 10, 34], "cannot": [0, 1, 4, 5, 6, 7, 8, 9, 25, 28, 32, 33, 34, 37, 39], "canopi": [0, 23, 25, 31], "canva": [15, 16, 19, 20, 25, 26, 31], "cap": 5, "capabl": [0, 1, 8, 13, 23, 31], "capac": [2, 29], "capita": [], "caption": [20, 25, 26], "captur": [4, 11, 12, 31, 37, 38], "car": [3, 4], "card": [0, 7, 31, 36, 37], "cardin": [1, 39], "care": [11, 15, 19, 22, 34], "carefulli": [13, 34], "carlo": [0, 6, 23, 28, 30, 31, 35, 36], "carri": [2, 6, 7, 25, 35, 36, 37], "cart": 10, "case": [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 23, 24, 25, 26, 31, 35, 38, 39], "casella": 30, "cast": [1, 39], "cat": [3, 4], "catch": 0, "categor": [0, 1, 3, 9, 11, 31, 36, 37, 39], "categori": [0, 1, 3, 7, 10, 12, 14, 31, 36, 37, 38, 39], "categorical_cross_entropi": [36, 37], "categorical_crossentropi": [1, 3, 39], "caus": [0, 5, 6, 28, 31, 32, 33, 34, 35, 36], "causal": 0, "causat": [0, 31], "cax": 1, "cb": [6, 31], "cbar": 1, "cc": [0, 1, 5, 13, 31, 32, 33, 34, 38, 39], "cc398b": [], "ccbb44": [], "ccc": [5, 12, 33, 37], "cdf": 28, "cdot": [0, 2, 6, 12, 13, 14, 24, 28, 31, 33, 34, 35, 37], "celebr": [13, 33], "cell": [4, 21, 22], "center": [0, 1, 6, 7, 8, 9, 11, 14, 18, 25, 28, 31, 32, 34, 35, 36, 37, 39], "central": [0, 3, 5, 6, 8, 16, 20, 24, 26, 31, 32, 38, 39], "centroid": [14, 28], "centroid_differ": 14, "centuri": 3, "certain": [0, 3, 6, 7, 9, 21, 28, 31, 32, 35, 36, 37], "certainti": 35, "cf": [], "cf222e": [], "cffi": [], "cg": 13, "cha": [], "chain": [0, 1, 13, 22, 23, 28, 31], "challeng": [15, 38], "chanc": [1, 5, 13, 28, 34, 39], "chang": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 13, 14, 15, 16, 19, 21, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "changeabl": 26, "changelog": [], "channel": 3, "chap4": [38, 39], "chapter": [0, 6, 10, 11, 16, 17, 19, 24, 25, 26, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "chapter3": [0, 25], "charact": [0, 3, 5, 31, 32, 33], "character": [8, 9, 10, 12, 28, 37, 39], "characterist": [0, 1, 3, 10, 13, 31, 39], "charg": [0, 31], "charl": [], "charset": [], "chase": 4, "chatgpt": [15, 25, 26], "chd": [7, 36], "chddata": [7, 36], "cheap": [5, 32, 33, 34], "cheaper": [1, 13, 34, 39], "check": [1, 3, 4, 5, 11, 13, 15, 16, 19, 21, 22, 24, 31, 34, 36, 37, 39], "checkmark": 3, "checkpoint": 4, "checkpoint_dir": 4, "checkpoint_prefix": 4, "chen": 10, "cheng": 32, "chiaramont": 2, "childcar": 16, "children": 16, "choic": [0, 1, 2, 3, 4, 6, 9, 12, 13, 14, 20, 24, 26, 31, 32, 33, 34, 35, 36, 37], "choleski": [5, 24, 32, 33], "choos": [2, 3, 6, 9, 10, 11, 13, 14, 15, 18, 19, 21, 25, 26, 33, 35, 36, 37], "chosen": [0, 1, 2, 6, 8, 9, 10, 13, 16, 28, 31, 33, 34, 35, 36, 39], "chosen_datapoint": [1, 39], "christian": 30, "christoph": [30, 31], "chunk": 34, "cifar": 3, "cifar10": 3, "circ": [1, 12, 34, 38, 39], "circl": [0, 8, 12, 32, 34, 37, 38], "circuit": 3, "circumfer": 9, "circumv": [1, 5, 13, 32, 33, 34, 39], "citat": [], "cite": [20, 25, 26], "ckpt": 4, "cl": [36, 37], "claim": [], "clarifi": 21, "clariti": 28, "class": [0, 1, 3, 4, 6, 7, 8, 9, 11, 12, 13, 21, 22, 28, 31, 35, 39], "class0": [36, 37], "class1": [36, 37], "class_nam": [3, 9], "class_to_index": [36, 37], "class_val": 9, "class_valu": 9, "classic": [7, 9, 13, 26, 37], "classif": [0, 3, 5, 6, 7, 8, 11, 12, 21, 23, 25, 30, 31, 32, 35], "classifi": [0, 1, 4, 7, 9, 10, 11, 26, 31, 37, 39], "classificaton": [1, 39], "classifii": 10, "claus": [], "clean": [1, 39], "clear": [1, 5, 10, 12, 13, 34, 39], "clearli": [0, 3, 5, 6, 7, 8, 28, 32, 33, 35, 36, 37], "clever": [1, 10, 39], "clf": [0, 6, 8, 9, 10, 31, 32], "clf3": 0, "clf_lasso": 6, "clf_ridg": 6, "cli": 15, "click": [], "clip": [3, 28, 34, 36, 37], "clock": 34, "clone": [15, 29], "close": [0, 1, 2, 4, 6, 8, 9, 11, 12, 13, 14, 18, 28, 30, 31, 33, 34, 35, 37, 38, 39], "closer": [3, 5, 13, 32, 33, 34], "closest": [8, 11, 13, 14], "closur": [23, 31], "cloud": [23, 31], "cluster": [0, 1, 4, 6, 11, 23, 31, 35, 36, 37, 39], "cluster_label": 14, "cm": [1, 2, 3, 6, 8, 13, 33, 34, 39], "cmap": [0, 1, 2, 3, 4, 6, 8, 9, 10, 31, 39], "cmap_arg": 6, "cmd": [9, 15], "cn_": 28, "cnn": [12, 37, 38], "cnn_kera": 3, "cntk": [23, 31], "co": [0, 2, 3, 6, 9, 13, 31, 35, 36], "code": [0, 3, 4, 6, 7, 8, 18, 19, 21, 22, 23, 24, 28, 30], "codebas": 39, "codec": [], "coef": [0, 31], "coef0": 8, "coef_": [0, 5, 6, 8, 9, 13, 16, 31, 32, 33, 34], "coeff": 5, "coeffici": [0, 3, 5, 6, 7, 8, 9, 13, 18, 24, 31, 32, 34, 35, 36, 37], "coerc": [0, 6, 31, 35, 36], "coin": [10, 28], "coin_toss": 10, "col": [0, 11, 31, 32], "colab": [21, 22, 23, 31], "cold": 9, "colinear": [], "collabor": [20, 25, 26], "collaps": 8, "collect": [2, 6, 10, 11, 17, 23, 28, 30, 31, 35, 36, 38], "collinear": [5, 32, 33], "color": [0, 3, 4, 6, 8, 9, 10, 28, 34], "color_channel": 3, "color_cod": 6, "colorbar": [1, 6, 20], "coloumn": 39, "colsample_bytre": 10, "colsaobject": 10, "column": [0, 1, 2, 5, 6, 7, 8, 9, 11, 12, 16, 17, 18, 19, 24, 31, 32, 33, 34, 35, 36, 37, 38, 39], "columntransform": 9, "com": [4, 6, 15, 16, 19, 20, 21, 22, 23, 25, 26, 30, 31, 33, 34, 35, 36, 37, 38, 39], "combin": [1, 2, 5, 6, 7, 10, 15, 18, 22, 28, 35, 36, 39], "come": [0, 1, 3, 4, 5, 12, 13, 14, 15, 26, 31, 32, 33, 34, 37, 38, 39], "comfort": [], "command": [0, 1, 15, 39], "comment": [0, 4, 5, 6, 20, 25, 26], "commerci": [0, 23, 25, 31], "commit": 15, "commod": [0, 31], "common": [0, 1, 3, 5, 6, 7, 9, 11, 13, 14, 16, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "commonli": [0, 1, 4, 6, 7, 9, 13, 14, 32, 34, 35, 36, 37, 39], "commonmark": [], "commun": [0, 12, 15, 25, 37, 38], "commut": 3, "commutatitav": 3, "compact": [0, 1, 3, 5, 6, 7, 9, 11, 12, 13, 14, 21, 31, 32, 35], "compair": 0, "compar": [0, 3, 4, 5, 6, 11, 13, 18, 24, 25, 26, 31, 32, 33, 34, 35, 36, 38], "comparison": [2, 4, 13, 26], "compat": [7, 36, 37], "compens": 34, "compet": 0, "competit": 10, "compil": [0, 1, 3, 4, 13, 23, 24, 31, 39], "compl": 21, "complet": [0, 2, 3, 4, 9, 12, 15, 16, 17, 18, 19, 20, 21, 22, 31, 37], "completenn": [12, 37], "complex": [1, 5, 8, 9, 11, 12, 13, 16, 19, 26, 31, 33, 34, 35, 36, 39], "complianc": [], "complic": [0, 1, 9, 13, 25, 26, 31, 33, 34, 35, 36, 39], "compoment": 32, "compon": [0, 1, 3, 4, 5, 6, 7, 9, 14, 16, 23, 31, 32, 33, 35, 37, 38, 39], "components_": 11, "compos": [9, 12, 13, 14, 23, 31, 37, 38], "compphys": [0, 6, 16, 20, 23, 25, 26, 27, 29, 30, 31, 32, 33, 36, 37, 39], "compress": [0, 31, 32], "compris": 6, "compromis": [5, 32, 33], "compulsori": [23, 31], "comput": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 35, 36, 37, 38, 39], "computation": [0, 3, 6, 9, 13, 28, 31, 33, 34, 38], "computationalscienceuio": 31, "compute_gradi": 22, "computerlab": [25, 26], "con": 26, "concaten": [2, 4, 6, 14, 36, 37], "concav": [1, 13, 32, 33], "concentr": 10, "concept": [0, 2, 23, 31, 32], "conceptu": [12, 13, 33, 37, 38], "concern": [0, 1, 4, 7, 31, 33, 36, 37, 39], "concic": 31, "conclud": [0, 5, 13, 34], "conclus": [1, 39], "cond": 2, "conda": [0, 1, 23, 25, 31, 39], "condis": 32, "condit": [0, 2, 4, 5, 6, 8, 9, 11, 13, 28, 31, 32, 34, 35], "conduct": 23, "condwav": 2, "confid": [0, 5, 6, 7, 8, 19, 31, 32, 36, 37], "configur": 3, "confirm": [5, 12, 21, 37], "conform": [], "confus": [5, 6, 7, 10, 24, 26, 32, 35], "confusion_matrix": 9, "congruenti": 28, "conjug": [4, 8], "conjugaci": 13, "conjunct": 3, "connect": [0, 1, 3, 4, 9, 11, 12, 13, 24, 31, 32, 33, 37, 38, 39], "consensu": 34, "consequ": [5, 6, 8, 10, 12, 13, 32, 33, 34, 35], "consequenti": [], "conserv": [5, 14, 32, 33], "consid": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 12, 13, 16, 19, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "consider": [0, 1, 5, 13, 31, 32, 33, 35], "consist": [1, 2, 3, 4, 6, 12, 13, 25, 26, 28, 32, 33, 35, 36, 37, 38, 39], "consol": [], "const": [], "constant": [0, 2, 4, 5, 6, 8, 12, 13, 16, 18, 28, 31, 32, 33, 34, 37, 38, 39], "constitu": [0, 31], "constitut": [2, 6, 35, 36], "constrain": [1, 3, 5, 7, 11, 33, 36, 39], "constraint": [5, 6, 8, 13, 32, 33, 35], "construct": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 24, 28, 31, 32, 35, 37], "constructor": [], "consult": 26, "consum": 34, "contact": [0, 31], "contain": [0, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 18, 19, 21, 24, 25, 26, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "contemporari": 31, "content": [1, 15, 20, 23, 24, 31, 33, 34], "context": [6, 10, 13, 22, 25, 33, 34, 35, 36, 38], "contigu": 24, "contin": 19, "continu": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 19, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 38, 39], "contour": [9, 10, 13], "contourf": [8, 9, 10], "contract": [], "contrast": [1, 4, 9, 10, 12, 31, 34, 37, 38, 39], "contribut": [0, 3, 5, 13, 18, 28, 31, 32, 33, 34], "contributor": [0, 25], "control": [0, 1, 3, 9, 13, 15, 23, 31, 39], "conv": [3, 4], "conv2d": [3, 4], "conv2dtranspos": 4, "convei": 31, "conveni": [5, 6, 12, 13, 24, 25, 26, 31, 33, 34, 35, 37], "convent": [12, 32], "converg": [1, 2, 4, 5, 8, 13, 14, 18, 32, 33, 38, 39], "convergencewarn": [], "convers": [20, 34], "convert": [0, 1, 4, 5, 9, 11, 13, 24, 31, 32, 33, 36, 37], "converttomatrix": 4, "convex": [4, 5, 7, 32, 36, 37], "convinc": [13, 33], "convolut": [1, 4, 23, 31, 39], "cool": [4, 9], "coolwarm": 6, "coordin": [5, 12, 14, 32, 33, 34, 37], "coorel": [], "copi": [0, 1, 14, 15, 32, 36, 37, 39], "copyright": [], "core": 10, "corel": 31, "coronari": [7, 36], "corr": [5, 7, 11, 32, 37], "correalt": [11, 23], "correct": [0, 1, 2, 3, 4, 5, 7, 13, 15, 19, 20, 21, 22, 24, 28, 31, 32, 33, 35, 36, 37, 39], "correctli": [1, 2, 6, 7, 10, 18, 19, 21, 22, 25, 26, 35, 36, 39], "correl": [0, 1, 3, 5, 6, 7, 10, 12, 13, 23, 28, 31, 33, 34, 35, 38], "correlation_matrix": [5, 7, 11, 32, 37], "correspond": [0, 3, 5, 6, 8, 9, 11, 12, 23, 24, 25, 26, 28, 31, 32, 33, 35, 37, 38], "cortex": [12, 37, 38], "cosin": [3, 6, 35, 36], "cost": [0, 2, 3, 5, 6, 7, 8, 9, 12, 13, 16, 17, 18, 19, 21, 22, 25, 26, 31], "cost_autograd": 22, "cost_deep_grad": 2, "cost_der": 22, "cost_fun": 22, "cost_func": 39, "cost_func_deriv": 39, "cost_funct": 2, "cost_function_deep": 2, "cost_function_deep_grad": 2, "cost_function_grad": 2, "cost_function_train": 39, "cost_function_v": 39, "cost_grad": [2, 22], "cost_histori": [], "cost_ol": [], "cost_one_lay": 22, "cost_ridg": [], "cost_sum": 2, "cost_two_lay": 22, "costcrossentropi": 39, "costli": 34, "costlogreg": 39, "costol": [13, 34, 39], "could": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "coulomb": [0, 31], "count": [0, 9, 15, 25, 26, 27, 28, 29, 31], "counter": [25, 26], "counteract": 34, "counterpart": 31, "countor": 13, "coupl": [4, 5, 6, 21, 35], "cours": [0, 1, 3, 5, 11, 15, 16, 17, 19, 20, 21, 25, 26, 29, 32, 35, 36, 39], "coursework": 15, "courvil": [26, 30, 31, 32, 34], "cov": [5, 6, 11, 24, 28, 31, 32, 35], "cov_xi": [5, 11, 32], "cov_xx": [5, 11, 32], "cov_yi": [5, 11, 32], "covari": [0, 7, 23, 24, 31, 33, 37], "covariance_matrix": [5, 11, 14], "cover": [0, 5, 23, 25, 26, 29, 30, 32, 33, 35], "covert": [0, 31], "covxi": 28, "covxx": 28, "covxz": 28, "covyi": 28, "covyz": 28, "covzz": 28, "cpu": [1, 39], "cqofi41lfdw": [38, 39], "craft": 3, "crash": 34, "creat": [1, 3, 4, 5, 9, 10, 11, 12, 15, 18, 19, 21, 22, 23, 31, 34, 36, 37, 38, 39], "create_biases_and_weight": [1, 39], "create_convolutional_neural_network_kera": 3, "create_lay": [21, 22], "create_layers_batch": 21, "create_neural_network_kera": [1, 39], "create_x": [5, 11, 39], "creation": [], "credit": [0, 7, 29, 31, 36, 37], "crim": [], "crime": [], "criteria": [0, 4, 9, 10, 14, 28, 31], "criterion": [9, 10, 13, 18, 33, 34, 38], "critic": [6, 25, 32], "critiqu": [25, 26], "cross": [0, 1, 3, 7, 9, 10, 13, 15, 21, 22, 23, 26, 28, 31, 32, 33, 34, 39], "cross_entropi": [4, 21], "cross_val_scor": [6, 35, 36], "cross_valid": [7, 10, 37], "crossvalid": [6, 35, 36], "crucial": [1, 28, 34, 39], "cs231": 3, "csr_matrix": [24, 31], "css": [], "csv": [0, 4, 6, 7, 9, 35, 36, 37], "ctnk": [1, 39], "cube": 38, "cubic": 0, "culprit": [], "cumbersom": [5, 35], "cumprod": [], "cumsum": [10, 11, 31], "cumul": [7, 10, 28, 34], "cumulative_heads_ratio": 10, "cup": 5, "current": [1, 2, 3, 4, 13, 14, 15, 16, 30, 33, 34, 36, 37, 39], "curs": [0, 32], "curv": [6, 7, 10, 12, 25, 36, 37, 39], "curvatur": [13, 33, 34], "custom": [6, 14], "custom_cmap": [9, 10], "custom_cmap2": [9, 10], "custom_lin": [], "cutpoint": 9, "cv": [6, 7, 10, 35, 36, 37], "cvxbook": [13, 33], "cvxopt": [5, 8, 32], "cybenko": 38, "cycl": [1, 12, 37, 38, 39], "cycler": [], "d": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "d1": [], "d166a3": [], "d2": [], "d2_g_t": 2, "d2a8ff": [], "d4d0ab": [], "d71835": [], "d9dee3": [], "d_f": [13, 33], "d_g_t": 2, "d_net_out": 2, "da": [3, 22, 38], "da_1": 22, "dagger": [5, 24, 32, 33], "dai": [1, 9, 23, 39], "damag": [], "damp": 3, "darget": 9, "darkr": 28, "dat": [0, 31], "dat_id": [0, 6, 7, 9, 31, 35, 36], "data": [2, 4, 5, 8, 10, 12, 13, 14, 16, 19, 20, 22, 24, 25, 26, 30, 33, 34, 35], "data1": 14, "data2": 14, "data3": 14, "data4": 14, "data_id": [0, 6, 7, 9, 31, 35, 36], "data_indic": [1, 39], "data_panda": 31, "data_path": [0, 6, 7, 9, 31, 35, 36], "databas": [1, 39], "datafil": [0, 6, 7, 9, 31, 35, 36], "datafram": [0, 4, 5, 7, 9, 11, 31, 32, 37], "datapoint": [1, 5, 6, 7, 11, 13, 16, 33, 34, 35, 36, 39], "datasci": [15, 16, 19], "dataset": [0, 4, 6, 7, 8, 9, 10, 11, 13, 14, 16, 21, 22, 25, 26, 31, 33, 34, 35, 36, 37], "datatyp": 4, "date": [15, 18, 21, 22, 25, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39], "daughter": 10, "davi": [], "david": 30, "davison": [35, 36], "db": [22, 38], "db_1": 22, "dbb7ff": [], "dbh": [1, 39], "dbo": [1, 39], "dc": 22, "dc5e85cd93c3": 26, "dc_da": 22, "dc_da1": 22, "dc_da2": 22, "dc_db": 22, "dc_db1": 22, "dc_db2": 22, "dc_dw": 22, "dc_dw1": 22, "dc_dw2": 22, "dc_dz": 22, "dc_dz1": 22, "dc_dz2": 22, "dcc6e0": [], "dcomposit": 24, "ddot": 2, "de": 34, "dead": [1, 39], "deadlin": [15, 20, 21, 22], "deal": [0, 1, 3, 5, 6, 8, 11, 13, 14, 19, 24, 28, 31, 32, 33, 34, 38, 39], "dealt": 0, "debt": [7, 36, 37], "debug": [0, 5, 6, 32, 33, 34, 35, 36, 39], "debugg": [], "decad": [0, 3, 34], "decai": [0, 13, 28, 31], "decemb": [29, 31], "decent": 10, "decid": [0, 2, 3, 5, 6, 9, 18, 32, 33, 34, 35, 36, 39], "decim": [0, 31, 39], "decis": [0, 1, 8, 11, 23, 30, 31, 39], "decision_funct": 8, "decision_tre": 9, "decisiontreeclassifi": [9, 10], "decisiontreeregressor": [0, 9, 10], "declar": [0, 4, 20, 24, 31], "declare_namespac": [], "decompos": [5, 6, 24, 32, 33, 38], "decomposit": [0, 6, 12, 31, 37, 38], "decompost": [5, 32, 33], "deconvolut": 3, "decorrel": [10, 13, 34], "decreas": [1, 2, 4, 5, 6, 10, 11, 13, 19, 33, 34, 35, 36, 39], "dedic": 20, "deduc": [0, 31], "deep": [3, 7, 12, 13, 23, 26, 30, 32, 33], "deep_neural_network": 2, "deep_param": 2, "deep_tree_clf": [9, 10], "deep_tree_clf1": 9, "deep_tree_clf2": 9, "deepcopi": 39, "deepen": [5, 23, 31], "deeper": [0, 3, 4, 31], "deeplearningbook": [26, 30, 31, 33, 34], "deer": 3, "def": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 16, 17, 21, 22, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "def_covari": 28, "default": [0, 1, 2, 4, 6, 7, 24, 26, 31, 32, 36, 37, 39], "default_tim": 4, "defect": [5, 32, 33], "defici": [5, 32, 33], "defin": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 21, 22, 24, 25, 28, 32, 33, 34, 35, 36, 37], "definit": [1, 2, 5, 6, 7, 8, 10, 11, 12, 13, 24, 28, 32, 33, 34, 35, 36, 37], "defint": 28, "defualt": 39, "degre": [3, 5, 6, 8, 9, 10, 11, 15, 16, 19, 20, 25, 28, 31, 33, 34, 35, 36], "deisenroth": 32, "del": 1, "delet": [6, 15], "delimit": 4, "deliv": [15, 25, 26, 27, 31], "delta": [0, 2, 3, 6, 8, 12, 13, 14, 31, 34, 38, 39], "delta_": [1, 24, 38, 39], "delta_0": [3, 38], "delta_1": [3, 38, 39], "delta_2": [3, 38, 39], "delta_2a_1": [38, 39], "delta_3": 3, "delta_4": 3, "delta_5": 3, "delta_h": [0, 1, 31, 39], "delta_i": [38, 39], "delta_j": [3, 12, 38, 39], "delta_k": [12, 38, 39], "delta_l": [1, 3, 39], "delta_matrix": 39, "delta_momentum": [13, 34], "delta_n": [0, 3, 31], "delug": 23, "delv": 0, "demand": [13, 33], "demonstr": [0, 3, 5, 6, 7, 11, 12, 19, 23, 31, 32, 33, 34, 35, 36, 37, 39], "demystifi": [37, 38, 39], "den": 4, "denomin": [1, 5, 34, 39], "denot": [1, 2, 6, 7, 13, 28, 33, 34, 36, 37, 39], "dens": [1, 3, 4, 39], "densiti": [0, 2, 6, 28, 35, 36], "depart": [29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "depend": [0, 1, 2, 4, 5, 6, 7, 8, 11, 12, 13, 15, 16, 23, 24, 25, 28, 31, 32, 33, 34, 36, 37, 38, 39], "depict": 28, "deploy": [0, 23, 25, 31], "depth": [0, 3, 9, 10, 24, 35, 39], "der": [], "deriv": [0, 1, 2, 6, 7, 8, 10, 11, 13, 18, 22, 23, 25, 26, 31, 36, 37], "derivati": 13, "derivative_fn": 13, "derivb1": [38, 39], "derivb2": [38, 39], "derivw1": [38, 39], "derivw2": [38, 39], "descend": [5, 9, 11, 32, 33], "descent": [0, 1, 3, 7, 8, 12, 22, 26, 31, 32, 36, 38, 39], "describ": [0, 2, 4, 5, 6, 8, 10, 11, 12, 13, 19, 20, 24, 25, 26, 31, 34, 35, 37, 38], "descript": [0, 8, 9, 20, 25, 26, 31, 39], "design": [0, 1, 3, 4, 5, 6, 7, 10, 11, 12, 13, 17, 18, 25, 26, 31, 33, 34, 35, 36, 37, 38, 39], "designmatrix": [0, 31], "desir": [0, 2, 4, 5, 13, 14, 31, 32, 33, 34, 39], "desktop": 15, "despit": [1, 12, 34, 37, 39], "destroi": 24, "det": [5, 24, 32, 33], "detail": [0, 6, 11, 13, 14, 18, 21, 22, 24, 25, 32, 33, 34, 39], "detect": [3, 8, 12, 37, 38], "determin": [0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 18, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "determinist": [7, 13, 28, 33, 34, 36, 38], "deternin": 38, "dev": [1, 25, 26, 39], "develop": [0, 3, 5, 8, 10, 11, 12, 23, 24, 25, 26, 31, 32, 37, 38], "deviat": [0, 1, 2, 4, 5, 6, 17, 18, 19, 25, 28, 31, 32, 34, 35, 36, 39], "devis": [12, 37, 38], "df": [4, 8, 11, 13, 31, 38], "df1": 31, "di": [], "diag": [5, 8, 32, 33, 34], "diagnost": [1, 10, 39], "diagon": [0, 5, 7, 13, 18, 19, 24, 28, 31, 32, 33, 34, 36, 37, 39], "diagonaliz": [5, 32, 33], "diagram": 10, "diagsvd": 6, "dice": [6, 28, 35], "dict": [6, 8, 39], "dictionari": 39, "did": [0, 1, 5, 6, 7, 10, 11, 14, 16, 22, 25, 26, 31, 35, 36, 37, 39], "die": [1, 39], "diff": [2, 38], "diff1": 2, "diff2": 2, "diff_ag": 2, "diffeent": 8, "differ": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 28, 30, 31, 32, 33, 35, 36, 37, 38, 39], "different": [38, 39], "differenti": [0, 3, 16, 21, 22, 23, 24, 26, 31, 32, 33, 37, 39], "difficult": [0, 1, 6, 10, 13, 28, 31, 34, 35, 36, 39], "difficulti": [0, 1, 13, 31, 33, 34, 39], "diffonedim": 2, "digit": [0, 1, 3, 4, 6, 26, 29, 31, 39], "digress": 38, "dilemma": [13, 34], "dilut": [1, 39], "dim": [4, 11, 14, 24, 39], "dimens": [0, 1, 2, 3, 4, 5, 8, 11, 14, 16, 24, 31, 32, 33, 38, 39], "dimension": [0, 4, 5, 6, 9, 11, 13, 14, 19, 23, 24, 25, 26, 31, 32, 33, 34, 35], "dimensionless": [0, 3, 31], "diment": 24, "diminish": 34, "dimnsion": 4, "diod": 3, "direct": [0, 1, 2, 4, 11, 12, 13, 14, 31, 32, 33, 34, 37, 38, 39], "directli": [1, 4, 5, 6, 18, 22, 28, 32, 33, 39], "directori": [], "disadvantag": [0, 26, 31, 34], "disappear": [3, 6, 35], "disc_loss": 4, "disc_tap": 4, "discard": [6, 11, 34, 35, 36], "disciplin": [0, 3, 12, 37, 38], "disclaim": 28, "discontinu": 38, "discord": [21, 31], "discourag": [13, 15, 33], "discov": [0, 31], "discover": 5, "discret": [1, 3, 5, 7, 13, 36, 37, 39], "discrimin": [4, 7, 10, 11, 36, 37], "discriminator_loss": 4, "discriminator_loss_list": 4, "discriminator_model": 4, "discriminator_optim": 4, "discuss": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 18, 19, 20, 23, 24, 25, 26, 28, 30, 31, 32, 33, 34, 35, 36, 38, 39], "diseas": [7, 36, 37], "disguis": [6, 32, 34], "disk": 34, "disord": [1, 7, 36, 37], "dispai": [37, 38], "displai": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 25, 28, 31, 32, 34, 35, 36, 37, 38, 39], "displaystyl": [0, 5, 17, 31, 32, 33, 34], "disregard": [0, 31], "dissimilar": [11, 14], "dist": 14, "distanc": [8, 9, 11, 14, 28], "distance_list": 9, "distinct": [3, 7, 8, 9, 10, 14, 36, 37], "distinctli": 8, "distinguish": [0, 4, 7, 8, 28, 31, 37], "distplot": [], "distribut": [0, 1, 4, 6, 7, 10, 11, 13, 14, 18, 19, 21, 23, 24, 25, 26, 31, 32, 33, 34, 36, 39], "distrubut": [0, 23, 25, 31], "div": [], "dive": [0, 8, 24, 31], "diverg": [1, 13, 33, 34, 39], "divid": [0, 1, 3, 5, 6, 7, 8, 9, 11, 12, 18, 19, 26, 28, 31, 32, 34, 35, 36, 37, 38, 39], "divis": [6, 8, 9, 13, 18, 24, 28, 34, 35, 36, 38, 39], "dl": [], "dm": [], "dna": [7, 36, 37], "dnn": [0, 1, 2, 4, 12, 31, 37, 38, 39], "dnn1": 4, "dnn2_gru2": 4, "dnn_kera": [1, 39], "dnn_model": 1, "dnn_numpi": [1, 39], "dnn_scikit": [0, 1, 31, 39], "do": [0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 24, 25, 26, 31, 32, 33, 35, 36, 38], "doc": [0, 15, 16, 19, 23, 25, 26, 27, 29, 30, 31, 39], "document": [4, 13, 15], "docutil": [], "doe": [0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 15, 16, 17, 18, 19, 21, 22, 24, 25, 26, 28, 31, 34, 35, 36, 38, 39], "doesn": [3, 9, 12, 31, 34, 38, 39], "dog": [1, 3, 4, 39], "dollar": [], "domain": [5, 8, 13, 25, 26, 33, 35], "domcontentload": [], "domin": [0, 31], "don": [0, 1, 3, 5, 6, 8, 11, 13, 15, 16, 21, 23, 25, 26, 31, 32, 34, 39], "done": [0, 2, 3, 4, 5, 6, 9, 10, 11, 13, 16, 20, 22, 24, 25, 31, 32, 33, 34, 35, 36, 38, 39], "dot": [0, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 18, 24, 25, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "doubl": [3, 4, 16, 24, 31], "doubli": [1, 39], "doubt": [25, 26], "down": [0, 3, 6, 9, 11, 12, 13, 33, 34, 37], "download": [0, 1, 3, 5, 6, 15, 20, 24, 30, 31, 39], "downsampl": 3, "downscal": 26, "dozen": [1, 39], "dq": [6, 35], "draft": 20, "drag": 13, "dragon": [], "dramat": 11, "drastic": 4, "draw": [4, 6, 10, 13, 33, 35, 36], "drawback": [0, 1, 3, 13, 32, 33, 34, 39], "drawn": [1, 4, 6, 7, 11, 28, 31, 35, 36, 37, 39], "drive": [3, 4, 21, 22], "driven": 3, "drop": [0, 1, 5, 6, 11, 13, 28, 31, 32, 33, 35, 39], "dropna": [0, 6, 31, 35, 36], "dropout": 4, "dt": [2, 3, 13, 28, 38], "dtype": [0, 1, 3, 4, 14, 24, 31, 36, 37, 38, 39], "dual": [], "dub": [0, 31], "duboi": [], "due": [1, 2, 5, 6, 8, 10, 12, 13, 18, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "dugard": [], "dummi": [], "dure": [0, 1, 3, 4, 8, 9, 11, 20, 23, 25, 26, 31, 34, 35, 36, 37, 39], "dw": 22, "dw_1": 22, "dwell": [], "dwh": [1, 39], "dwo": [1, 39], "dx": [2, 3, 8, 28, 38], "dx_1": 28, "dx_1p": [6, 35], "dx_2p": [6, 35], "dx_mp": [6, 35], "dx_n": 28, "dxp": [6, 35], "dy": [1, 8, 28, 39], "dynam": 4, "dz": [8, 22], "dz_1": 22, "dz_2": 22, "e": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "e1e1e1": [], "e_": [0, 2, 31], "e_z": 21, "each": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 22, 23, 24, 26, 27, 28, 29, 31, 32, 33, 34, 35, 37, 38, 39], "eager": 35, "eapprox": [0, 31], "earli": [1, 13, 34, 39], "earlier": [0, 5, 7, 8, 9, 11, 12, 13, 19, 20, 21, 22, 31, 32, 36, 37, 38, 39], "earthexplor": 6, "eas": [6, 9, 14, 35], "easi": [0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 21, 22, 23, 24, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39], "easier": [5, 6, 8, 9, 13, 15, 20, 21, 22, 25, 26, 28, 31, 32, 33, 35, 36], "easiest": [13, 18, 36, 37], "easili": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 24, 25, 31, 32, 33, 34, 35, 36, 37, 38, 39], "eastern": [29, 31], "ebind": [0, 31], "eblock": 9, "ec8e2c": [], "econom": [], "econometr": 31, "economi": 5, "ecosystem": [23, 31], "ect": 27, "edg": 3, "edgecolor": [6, 35, 36], "edit": [21, 22], "editor": [15, 20], "edu": [13, 25, 26, 33], "educ": [0, 25, 26, 31, 35], "ee6677": [], "eff": 28, "effect": [1, 4, 10, 13, 16, 17, 18, 28, 34, 39], "effic": [1, 39], "effici": [0, 3, 10, 13, 21, 22, 23, 24, 28, 31, 34, 36, 37, 38], "effort": 19, "efron": [6, 35, 36], "egrad": 13, "eig": [5, 11, 13, 24, 28, 31, 32, 33, 34], "eigen": 28, "eigenpair": [5, 11, 32, 33], "eigenvalu": [0, 5, 8, 11, 13, 24, 31, 32, 33, 34], "eigenvector": [5, 11, 13, 32, 33], "eight": [24, 31], "eigval": [24, 28, 31], "eigvalu": [11, 13, 33, 34], "eigvec": [24, 28, 31], "eigvector": [11, 13, 33, 34], "eir": [29, 31], "eispack": [24, 31], "either": [1, 5, 6, 7, 8, 9, 10, 11, 13, 18, 19, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "eivind": 29, "eivinsto": 29, "ekstr\u00f8m": 4, "elabor": 28, "elarn": 3, "electr": [0, 3, 12, 31, 37, 38], "electron": 31, "eleg": 11, "element": [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 19, 20, 21, 23, 24, 25, 26, 30, 32, 34, 35, 36, 37, 38, 39], "elementari": [10, 13, 24, 38], "elementwis": [3, 13], "elementwise_grad": [2, 13, 22, 39], "elessar": 31, "elif": [14, 39], "elim": 24, "elimin": [3, 8], "elin": [29, 31], "ell_": [], "ellipsi": 16, "els": [1, 3, 4, 7, 9, 12, 13, 16, 22, 24, 36, 37, 39], "elu": 1, "elus": [0, 31], "em": [], "email": [20, 21, 27, 29, 31], "emb": [], "embark": 38, "embed": [0, 11, 32], "embeddings_fig5_349758607": 26, "embodi": [6, 25, 35, 36], "emit": 28, "emner": 30, "emph": 34, "emphas": [0, 10, 23, 31], "emphasi": [0, 23, 30, 31], "empir": [1, 11, 28, 39], "emploi": [0, 1, 5, 6, 11, 13, 26, 28, 31, 32, 33, 35, 39], "employ": 0, "empti": [6, 10, 15, 35, 36, 39], "emul": [12, 37, 38], "en": [23, 25, 30], "enabl": [11, 34, 39], "enbodi": [6, 35], "encod": [0, 3, 5, 9, 11, 14, 31, 32, 33, 36, 37], "encompass": [0, 25, 28], "encount": [0, 1, 5, 7, 13, 15, 21, 25, 28, 31, 32, 33, 34, 36, 37, 39], "encourag": [15, 25, 26], "end": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 20, 22, 24, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "endblock": [], "endfor": [], "endif": [], "endors": [], "endpoint": [3, 6], "energi": [0, 4, 6, 35, 36], "enforc": [12, 37, 38], "eng": 30, "engin": [0, 1, 3, 4, 23, 31, 39], "english": [25, 26], "enjoi": 34, "enocurag": [25, 26], "enorm": 3, "enough": [0, 6, 13, 26, 31, 33, 34, 35], "ensembl": [1, 9, 31, 39], "ensur": [0, 1, 2, 3, 5, 6, 11, 13, 18, 28, 32, 33, 34, 35, 36, 38, 39], "entail": 31, "enter": [5, 6, 32, 33, 34], "enthought": [0, 23, 25, 31], "entir": [1, 3, 7, 9, 21, 23, 28, 31, 34, 36, 39], "entireti": [], "entiti": [9, 12, 24, 31], "entri": [0, 5, 8, 11, 12, 24, 31, 32, 34, 35], "entropi": [1, 3, 7, 10, 13, 21, 22, 26, 31, 33, 34, 39], "enumer": [0, 1, 2, 3, 4, 6, 8, 21, 31, 32, 34, 36, 37, 39], "env": 28, "environ": [2, 21, 22, 23, 25, 31], "environemnt": 15, "eo": [0, 6, 35, 36], "eol": 0, "eosfit": 0, "epoch": [0, 1, 3, 4, 12, 13, 21, 31, 34, 36, 37, 39], "eppstein": [], "epsilon": [0, 5, 6, 7, 13, 25, 31, 32, 33, 34, 35, 36, 37, 38], "epsilon_": [0, 31], "epsilon_0": [0, 31], "epsilon_1": [0, 31], "epsilon_2": [0, 31], "epsilon_i": [0, 31, 32], "eq": [3, 13, 14, 24, 28, 33], "eqnarrai": [3, 5, 6, 35], "equal": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 13, 14, 16, 18, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 38, 39], "equat": [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 17, 19, 24, 28, 31, 34, 35], "equilibrium": [2, 12, 37, 38], "equiv": [3, 13, 24, 28, 33, 34], "equival": [0, 1, 5, 7, 8, 11, 13, 23, 24, 26, 31, 32, 33, 34, 35, 39], "equivel": [19, 21, 22], "eqynreyrxni": 39, "eras": [], "erf": 28, "eriador": 31, "eric": 39, "err": [0, 10], "err_": [6, 35, 36], "err_sqr": 2, "errat": [13, 33, 34], "erron": 2, "error": [1, 2, 4, 5, 6, 7, 9, 11, 12, 13, 15, 16, 17, 18, 19, 21, 23, 24, 25, 26, 28, 34, 37, 38, 39], "error_estimate_corr_tim": 28, "error_hidden": [1, 39], "error_output": [1, 39], "escap": [13, 33, 34], "escapehtml": [], "especi": [1, 3, 9, 12, 13, 15, 18, 25, 26, 34, 37, 38, 39], "essenti": [0, 5, 6, 9, 10, 12, 14, 15, 25, 26, 28, 32, 33, 34, 37, 38, 39], "establish": [0, 6, 10, 11, 16, 25, 26], "estim": [0, 1, 5, 6, 7, 10, 11, 13, 23, 28, 31, 32, 33, 34, 36, 37, 39], "estimated_mse_fold": [6, 35, 36], "estimated_mse_kfold": [6, 35, 36], "estimated_mse_sklearn": [6, 35, 36], "et": [0, 2, 4, 16, 17, 20, 26, 30, 31, 32, 33, 35, 36, 37, 38, 39], "eta": [0, 1, 3, 8, 12, 13, 18, 26, 31, 33, 34, 38, 39], "eta0": [8, 13], "eta_": 13, "eta_j": 34, "eta_t": [13, 34], "eta_v": [0, 1, 3, 31, 39], "etc": [0, 1, 3, 5, 7, 8, 9, 11, 12, 13, 14, 23, 24, 25, 26, 28, 32, 33, 34, 36, 37, 39], "ethic": 23, "etsim": 35, "euclidean": [0, 14, 32, 34], "euler": [], "evalu": [0, 2, 3, 4, 5, 6, 9, 13, 15, 16, 17, 19, 21, 25, 28, 31, 32, 33, 34, 35, 36, 37], "evalut": [13, 25], "even": [0, 1, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 22, 23, 24, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "evenli": 4, "event": [5, 7, 10, 28, 35, 36], "eventu": [0, 5, 6, 11, 12, 13, 25, 26, 29, 32, 33, 34, 35, 36, 37, 38], "everi": [0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 21, 23, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "everyth": [4, 12, 16, 18, 21, 38, 39], "everywher": [4, 13, 33], "evolv": 0, "exact": [0, 5, 11, 12, 13, 24, 28, 31, 32, 34, 38, 39], "exactli": [0, 3, 4, 6, 12, 18, 23, 32, 34, 35, 37, 38, 39], "exam": 31, "examin": [6, 35, 36], "exampl": [0, 5, 11, 12, 13, 15, 16, 18, 20, 23, 24, 25, 26, 28, 30], "exce": [1, 12, 13, 34, 37, 38, 39], "exceed": 34, "excel": [0, 1, 4, 5, 10, 20, 25, 26, 31, 32, 39], "except": [3, 4, 6, 8, 9, 24, 39], "excess": [0, 31], "exchang": 34, "excit": 0, "exclud": [1, 6, 12, 25, 26, 32, 34, 35, 36, 37, 39], "exclus": [0, 1, 3, 6, 28, 31, 35, 36, 39], "execut": [2, 5, 13, 15, 32, 33, 34], "exemplari": [], "exemplifi": [13, 34], "exercic": [29, 31], "exercis": [5, 23, 25, 26, 27, 29, 31, 33, 34, 35, 36, 37, 39], "exercisesweek41": 26, "exercisesweek42": [26, 39], "exhaust": [6, 34, 35, 36], "exhibit": [0, 5, 6, 8, 31, 32, 35], "exist": [0, 1, 2, 3, 5, 6, 7, 8, 9, 13, 19, 24, 25, 26, 31, 33, 34, 35, 36, 39], "exit": [5, 24, 32, 33], "exp": [0, 1, 2, 5, 6, 7, 8, 10, 11, 12, 13, 16, 17, 19, 21, 22, 28, 32, 33, 34, 35, 36, 37, 38, 39], "exp_term": [1, 39], "exp_z": [36, 37], "expand": [5, 7, 11, 13, 33, 36, 37], "expans": [0, 3, 5, 8, 10, 12, 13, 31, 32, 33, 38], "expect": [0, 1, 5, 6, 7, 11, 12, 13, 15, 18, 23, 25, 26, 31, 32, 34, 36, 38, 39], "expectation_value_of_h_wrt_p": 28, "expens": [6, 10, 13, 16, 33, 34], "experi": [0, 1, 6, 8, 13, 15, 23, 25, 31, 32, 33, 34, 35, 36, 39], "experiment": [0, 4, 6, 9, 28, 31, 35, 36], "expert": [1, 9, 39], "explain": [0, 6, 9, 10, 11, 13, 16, 19, 25, 26, 31, 33, 36, 37], "explained_variance_ratio_": 11, "explan": [], "explanatori": [0, 31], "explicit": [0, 3, 6, 13, 24, 25, 31, 32, 33, 34], "explicitli": [0, 4, 21], "explod": [1, 38], "exploit": [0, 3, 12, 13, 31, 34, 37, 38], "explor": [1, 4, 6, 8, 13, 18, 23, 25, 26, 31, 33, 34, 39], "expon": [1, 39], "exponenti": [0, 1, 5, 6, 10, 13, 28, 31, 33, 38, 39], "export": [9, 15, 16, 19, 20, 36, 37], "export_graphviz": 9, "export_text": 9, "exporttext": 9, "expos": 23, "expr": 38, "express": [0, 2, 3, 5, 6, 7, 10, 12, 13, 18, 22, 24, 25, 26, 28, 31, 33, 34, 35], "exptmean": 28, "exptvari": 28, "extend": [0, 2, 7, 11, 13, 23, 31, 34], "extend_path": [], "extens": [0, 12, 15, 23, 26, 31, 37, 38], "extent": [0, 1, 6, 30, 35, 36, 39], "extern": [3, 6, 9], "extra": [1, 3, 5, 15, 29, 31, 32, 33, 39], "extract": [0, 3, 5, 6, 7, 8, 11, 13, 16, 17, 24, 26, 31, 32, 36, 37, 38], "extrapol": [0, 31], "extrem": [0, 1, 4, 5, 6, 7, 8, 9, 13, 15, 16, 24, 32, 33, 34, 36, 39], "extremum": [13, 33], "extrins": 11, "ey": [0, 5, 6, 13, 14, 18, 24, 31, 32, 33, 34], "f": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14, 15, 16, 17, 18, 19, 22, 24, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "f1": 13, "f11": [0, 31], "f12": [0, 31], "f13": [0, 31], "f1_grad": 13, "f1d": 13, "f2": 13, "f26196": [], "f2_grad_x1": 13, "f2_grad_x1_analyt": 13, "f2_grad_x2": 13, "f2_grad_x2_analyt": 13, "f2f2f2": [], "f3": 13, "f3_grad": 13, "f3_grad_analyt": 13, "f4": 13, "f4_grad": 13, "f4_grad_analyt": 13, "f5": 13, "f5_grad": 13, "f5a394": [], "f5ab35": [], "f5f5f5": [], "f6": 13, "f6_for": 13, "f6_for_grad": 13, "f6_grad_analyt": 13, "f6_while": 13, "f6_while_grad": 13, "f7": 13, "f78c6c": [], "f7_grad": 13, "f7_grad_analyt": 13, "f8": 13, "f8_grad": 13, "f8f8f2": [], "f9": [0, 13, 31], "f9_altern": 13, "f9_alternative_grad": 13, "f9_grad": 13, "f_": 10, "f_0": [3, 10], "f_1": [10, 13, 33], "f_2": [12, 13, 33, 37], "f_3": [12, 37], "f_d": 28, "f_grad": 13, "f_grad_analyt": 13, "f_i": [0, 6, 12, 16, 35, 36, 37], "f_m": [3, 10], "f_n": 3, "f_vec": 2, "face": [13, 31, 33], "facecolor": [6, 8, 28, 35], "facil": [0, 23], "facilit": [12, 37, 38], "fact": [0, 1, 3, 5, 9, 11, 12, 13, 22, 31, 32, 33, 34, 39], "facto": 34, "factor": [0, 1, 3, 5, 6, 9, 10, 11, 13, 24, 28, 31, 32, 33, 39], "factori": 13, "fad000": [], "fade": 6, "fae4c2": [], "fafab0": [9, 10], "fail": [0, 6, 13, 29, 31, 33, 35, 36, 38], "failur": [7, 36, 37], "fairli": [1, 2, 18, 28, 34, 39], "faisal": [16, 32], "fake": 4, "fake_loss": 4, "fake_output": 4, "fall": [8, 9, 27], "fals": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 14, 16, 17, 24, 26, 31, 32, 33, 34, 35, 36, 37, 39], "famili": [0, 7, 8, 28, 32, 34, 36, 37, 38], "familiar": [0, 3, 5, 6, 8, 15, 23, 24, 25, 28, 31, 35, 38], "famou": [6, 12, 39], "far": [0, 3, 4, 5, 6, 8, 11, 12, 13, 14, 16, 20, 21, 22, 31, 32, 33, 34, 37, 38], "fashion": [0, 9, 10, 26, 31, 34], "fashionmnist": 26, "fast": [1, 3, 6, 10, 12, 13, 23, 28, 31, 33, 34, 35, 36, 38, 39], "faster": [1, 11, 13, 21, 34, 39], "fastest": [13, 24, 33], "fatal": [], "favor": [7, 34, 36], "favorit": 28, "fc": 3, "fcfcfc": [], "fdac54": [], "fdf2e2": [], "featur": [0, 1, 3, 5, 6, 7, 8, 10, 11, 12, 13, 15, 17, 18, 19, 21, 23, 26, 28, 31, 33, 34, 35, 36, 37, 38, 39], "feature_nam": [1, 7, 9, 21, 37], "feautur": 9, "fed": [1, 38, 39], "feed": [0, 2, 3, 11, 21, 23, 26, 31], "feed_forward": [1, 21, 22, 39], "feed_forward_all_relu": 21, "feed_forward_batch": 21, "feed_forward_one_lay": 22, "feed_forward_out": [1, 39], "feed_forward_sav": 22, "feed_forward_train": [1, 39], "feed_forward_two_lay": 22, "feedback": [4, 20, 31], "feeddorward": 4, "feedforward": [1, 4, 12, 39], "feel": [0, 5, 6, 11, 13, 15, 16, 18, 21, 22, 23, 25, 26, 29, 31, 38], "feet": [], "fefef": [], "fefeff": [], "felt": [25, 26], "fenc": [], "fernando": [], "fetch": [6, 15, 26], "fetch_openml": 26, "few": [1, 3, 4, 5, 9, 17, 18, 19, 22, 28, 31, 38, 39], "fewer": [0, 9, 11, 19, 31, 34], "ff7b72": [], "ff9492": [], "ffa07a": [], "ffa657": [], "ffb757": [], "ffd700": [], "ffd900": [], "ffd9002e": [], "ffffff": [], "ffnn": [1, 12, 26, 37, 38, 39], "fi": [], "field": [0, 3, 6, 12, 19, 23, 37, 38], "fieldmask": [], "fifteen": 38, "fifth": [0, 6, 31], "fig": [0, 1, 2, 3, 4, 6, 7, 12, 13, 14, 25, 31, 36, 37, 39], "fig_id": [0, 6, 7, 9, 31, 35, 36], "figaxi": 28, "figsiz": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 31, 35, 36, 37, 39], "figur": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, 23, 25, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39], "figure_id": [0, 6, 7, 9, 31, 35, 36], "figurefil": [0, 6, 7, 9, 31, 35, 36], "file": [0, 4, 5, 6, 7, 9, 15, 20, 21, 22, 25, 26, 31, 35, 36], "file_prefix": 4, "filenam": 31, "fill": [5, 9, 18, 32, 33, 39], "fill_valu": [], "filter": [3, 4], "final": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 18, 20, 21, 22, 25, 26, 27, 28, 29, 31, 33, 35, 36, 37], "financ": 0, "find": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 21, 22, 23, 25, 26, 28, 31, 32, 33, 34, 36, 37, 38, 39], "fine": [0, 14], "finish": [2, 20, 21, 39], "finit": [3, 5, 6, 12, 13, 17, 28, 32, 33, 35, 36, 37, 38], "finnicki": 15, "fire": [], "first": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 18, 19, 21, 22, 24, 25, 26, 28, 29, 30, 32, 34, 35, 36, 37], "first_moment": 34, "first_term": 34, "firsteigvector": 11, "fit": [1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 17, 18, 19, 22, 25, 26, 28, 32, 34, 35, 36, 37, 38, 39], "fit_beta": 32, "fit_intercept": [0, 5, 6, 16, 32, 33, 34, 35, 36, 37], "fit_mod": 9, "fit_theta": [6, 34], "fit_transform": [0, 6, 8, 9, 11, 15, 19, 35, 36], "fiti": [0, 31], "five": [0, 9, 31, 32, 38], "fix": [0, 3, 4, 6, 10, 11, 12, 13, 25, 31, 35, 36, 37, 39], "flag": 4, "flat": [12, 13, 33, 34], "flatten": [1, 3, 4, 5, 24, 39], "flavor": [], "flexibl": [1, 6, 8, 10, 12, 26, 31, 34, 35, 36, 37, 39], "flip": [21, 29, 31], "float": [0, 3, 4, 5, 9, 11, 13, 14, 24, 31, 32, 33, 39], "float32": [4, 9, 39], "float64": [4, 24, 31, 37, 38, 39], "floatingpointerror": 39, "floor": 39, "flop": [5, 24, 32, 33], "flow": [1, 4, 12, 37, 38, 39], "flower": 21, "fluctuat": [5, 34], "flush": 39, "fly": 11, "fm": 0, "fmax": 3, "fmesh": 13, "fn": 7, "focu": [0, 3, 4, 5, 6, 15, 23, 25, 26, 30, 31, 32, 33, 34, 35, 36], "focus": [1, 6, 7, 24, 32, 34, 36, 37, 39], "fold": [6, 9, 25], "folder": [0, 4, 6, 15, 20, 25, 26, 31], "follow": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "font": [7, 20, 28, 31, 36], "fontdict": 28, "fontsiz": [1, 6, 8, 9, 10, 28], "fontweight": 1, "footprint": [3, 34], "foral": [8, 32, 38], "forc": [0, 5, 6, 10, 11, 32, 33, 34, 38], "forcast": 4, "forcier": [], "forecast": [4, 12, 37, 38], "forest": [0, 1, 9, 23, 31, 39], "forget": [11, 34], "form": [0, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "formal": [3, 4, 14, 18, 28, 38], "format": [0, 1, 3, 4, 6, 7, 8, 9, 10, 11, 20, 23, 28, 30, 35, 36, 37, 39], "format_data": 4, "formatstrformatt": [6, 13, 33, 34], "formatt": [], "formul": [4, 6, 11, 14], "formula": [3, 13, 28, 33, 38], "forth": [4, 12, 22, 37], "fortran": [0, 23, 24, 31], "fortran2003": [23, 31], "fortran2008": [25, 26], "fortran90": 28, "fortun": [0, 11, 32], "forward": [0, 3, 6, 21, 23, 24, 26, 31, 34, 35], "forwardpropag": [38, 39], "found": [1, 2, 4, 5, 6, 12, 13, 19, 20, 21, 22, 25, 31, 32, 34, 35, 36, 37, 38, 39], "foundat": [23, 31], "four": [4, 5, 6, 8, 12, 21, 24, 27, 29, 31, 33, 37, 38, 39], "fourier": [0, 31, 38], "fourierdef1": 3, "fourierdef2": 3, "fourierseriessign": 3, "fourth": [12, 31, 32], "fp": 7, "frac": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "fraction": [9, 36, 37], "frame": [7, 34, 37], "framework": [1, 8, 10, 28, 39], "frank": [5, 11], "frankefunct": [5, 6, 11], "fredli": [21, 29, 31], "free": [0, 6, 11, 13, 15, 16, 18, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 38], "freecodecamp": 23, "freedom": [5, 33], "freeli": [0, 25], "freez": 15, "frequenc": [3, 6, 7, 28, 35, 37], "frequent": [0, 8, 9, 13, 33], "frequentist": 23, "fresh": 10, "fridai": [15, 21, 22, 29, 31], "friedman": [6, 19, 25, 30, 31], "friendli": 4, "fro": 25, "frodo": 31, "frog": 3, "from": [0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 28, 29, 30], "from_cod": 9, "from_logit": [3, 4], "from_tensor_slic": 4, "front": [0, 4, 5, 31, 32, 33], "frustrat": 15, "fulfil": [2, 5, 12, 32, 33, 37, 39], "full": [1, 3, 5, 7, 9, 10, 13, 21, 26, 28, 31, 32, 33, 36], "full_matric": [5, 32, 33], "fulli": [3, 6, 12, 28, 35, 36, 37, 38], "fullnam": [], "fun": [23, 31], "func": [2, 21, 39], "function": [2, 3, 4, 5, 9, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], "functionali": 11, "fundament": [0, 6, 23, 31, 35, 36], "funtion": 2, "furnish": [], "furthemor": 38, "further": [2, 7, 9, 19, 31, 38], "furthermor": [0, 3, 5, 6, 7, 11, 12, 13, 23, 25, 26, 31, 32, 33, 34, 35, 36, 37, 39], "furthest": 22, "futur": [0, 4, 8, 9, 31], "fy": [15, 21, 25, 26, 27, 29, 30, 31], "fys4155": [25, 26], "fys5419": [30, 31], "fys5429": [30, 31], "f\u00f8470": [29, 31], "g": [0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 13, 15, 18, 19, 28, 31, 32, 33, 34, 35, 36, 37, 39], "g0": 2, "g_": [2, 9, 10, 34], "g_0": 2, "g_1": [2, 10], "g_2": [2, 10], "g_3": 38, "g_analyt": 2, "g_dnn_ag": 2, "g_euler": 2, "g_i": [2, 38], "g_j": 38, "g_m": [3, 10], "g_n": 3, "g_re": 2, "g_t": [2, 34, 39], "g_t_d2t": 2, "g_t_d2x": 2, "g_t_dt": 2, "g_t_hessian": 2, "g_t_hessian_func": 2, "g_t_invers": 39, "g_t_jacobian": 2, "g_t_jacobian_func": 2, "g_trial": 2, "g_trial_deep": 2, "g_vec": 2, "gain": [1, 5, 7, 9, 10, 13, 32, 33, 39], "galleri": [0, 31], "game": 4, "gamge": 31, "gamma": [0, 2, 8, 9, 10, 11, 13, 31, 33], "gamma1": 8, "gamma2": 8, "gamma_": [0, 31], "gamma_0": 10, "gamma_1": 10, "gamma_1x": 10, "gamma_i": [0, 8, 28, 31], "gamma_j": 13, "gamma_k": [13, 33], "gamma_m": 10, "gamma_x": [0, 31], "gap": [8, 34], "gate": [4, 12, 38], "gather": [0, 1, 12, 32, 37, 38, 39], "gaug": [12, 37, 38], "gaussbacksub": 24, "gaussian": [4, 5, 6, 8, 14, 18, 28, 31, 35, 36, 37], "gaussian_point": 14, "gaussian_rbf": 8, "gave": [13, 26, 34], "gavra": 31, "gbc": 31, "gca": [2, 6, 8, 13], "gd": [1, 33, 38, 39], "gd_clf": 10, "gdclassiffiercgain": 10, "gdclassiffierconfus": 10, "gdclassiffierroc": 10, "gdm": 13, "gdregress": 10, "ge": [1, 5, 7, 28, 32, 33, 36, 39], "gen_loss": 4, "gen_tap": 4, "gender": [0, 31], "genener": 4, "gener": [0, 1, 2, 3, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 28, 30, 32, 33, 34, 35, 39], "generaliz": [16, 39], "generallay": [12, 37], "generate_and_save_imag": 4, "generate_binary_data": [36, 37], "generate_imag": 4, "generate_latent_point": 4, "generate_multiclass_data": [36, 37], "generate_simple_clustering_dataset": 14, "generated_imag": 4, "generator_loss": 4, "generator_loss_list": 4, "generator_model": 4, "generator_optim": 4, "genom": 23, "geodes": 11, "geoff": 34, "geometr": [0, 13, 31, 34], "geometri": 5, "georg": 30, "geotif": 6, "geq": [2, 5, 8, 9, 13, 32, 33, 34], "gerard": [], "geron": [0, 30, 31], "get": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 15, 19, 21, 22, 23, 24, 25, 26, 28, 29, 31, 32, 33, 34, 35, 36, 39], "get_dummi": 9, "get_paramet": 2, "get_split": 9, "get_yaxi": 8, "get_yticklabel": 6, "getmask": [], "gh": 15, "giant": 34, "gibb": [23, 31], "gif": 4, "gini": 10, "gini_index": 9, "ginvers": 13, "git": [0, 15, 23, 31], "gitcdn": [], "giter": [13, 34], "github": [0, 20, 23, 25, 26, 27, 29, 30, 31, 32, 38, 39], "gitignor": 15, "gitlab": [0, 15, 23, 25, 26, 31], "gitta": [38, 39], "give": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 12, 13, 14, 18, 19, 23, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "given": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 19, 21, 24, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "glkfgrjhtlnplbx4": 21, "global": [6, 7, 13, 33, 34, 36, 37], "gloriou": 26, "glorot": 1, "gmail": [], "gnew": 13, "go": [0, 1, 3, 5, 6, 8, 9, 11, 12, 13, 15, 16, 18, 21, 31, 32, 33, 35, 38, 39], "goal": [0, 7, 9, 31, 36, 37], "goe": [0, 1, 2, 5, 6, 13, 14, 15, 19, 24, 31, 32, 33, 34, 35, 39], "goessner": [], "golden": 13, "gone": [5, 32, 33], "gong": [1, 39], "good": [1, 3, 4, 5, 6, 9, 10, 11, 13, 15, 18, 21, 23, 26, 28, 30, 32, 33, 34, 36, 38, 39], "goodfellow": [4, 26, 30, 31, 32, 33, 36, 37, 38, 39], "googl": [1, 4, 21, 22, 23, 31, 39], "got": [1, 6, 21, 22, 25, 26, 39], "gotten": [31, 39], "gov": 6, "govern": 31, "gp": 30, "gpu": [1, 13, 23, 31, 34, 39], "grad": [2, 13, 21, 22, 34, 39], "grad_analyt": 13, "grad_ol": 18, "grad_ridg": 18, "grad_two_lay": 22, "grade": [25, 26, 27], "gradient": [0, 3, 4, 7, 8, 9, 12, 21, 23, 31, 32, 36], "gradient_bia": 39, "gradient_desc": 34, "gradient_func": 21, "gradient_weight": 39, "gradientboostingclassifi": 10, "gradientboostingregressor": 10, "gradients_of_discrimin": 4, "gradients_of_gener": 4, "gradienttap": 4, "gradual": [1, 14, 39], "grai": [4, 6], "granger": [], "grant": [], "graph": [1, 9, 11, 12, 13, 16, 20, 33, 34, 37, 38, 39], "graph_from_dot_data": 9, "graphic": [0, 1, 9, 15, 31, 39], "grasp": 0, "gray_r": [1, 3, 39], "grayscal": 3, "great": [5, 13, 15, 21, 22, 33, 34, 38], "greater": [1, 7, 28, 32, 37, 39], "greatli": 13, "greedi": 9, "green": [0, 3, 9, 28], "gregor": 39, "grei": 4, "grid": [1, 3, 6, 7, 8, 12, 28, 32, 34, 35, 36, 37, 39], "groh": [38, 39], "grossli": [13, 33], "ground": [0, 31], "group": [0, 6, 7, 9, 14, 15, 20, 23, 25, 26, 27, 29, 31, 35], "groupbi": [0, 31], "grow": [1, 3, 9, 10, 34, 39], "growth": [0, 31], "gru": 4, "guarante": [0, 4, 13, 28, 31, 32, 33, 34], "guess": [1, 4, 10, 13, 14, 26, 33, 34, 39], "guestrin": 10, "gui": 15, "guid": [1, 21, 39], "guidelin": [20, 25, 26, 36, 37], "g\u00f6ssner": [], "h": [0, 1, 5, 6, 8, 13, 15, 19, 21, 28, 29, 30, 31, 32, 33, 34, 39], "h1": 2, "h_": [0, 13, 31, 33, 34], "h_0": 34, "h_1": [2, 13, 33], "h_2": [2, 13, 33], "h_m": 10, "h_t": 34, "ha": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "haanen": [29, 31], "habit": [0, 32], "had": [0, 1, 6, 7, 13, 31, 33, 34, 35, 36, 39], "hadamard": [1, 12, 13, 34, 38, 39], "half": [1, 8, 9, 36, 37, 38, 39], "halv": 10, "hand": [0, 1, 2, 3, 5, 11, 12, 13, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 36, 37], "handi": [3, 25, 26], "handl": [0, 1, 2, 5, 9, 11, 15, 18, 22, 23, 32, 33, 34, 39], "handle_unknown": 9, "handsid": [12, 38, 39], "handwrit": [12, 37, 38], "handwritten": [1, 5, 39], "happen": [1, 2, 3, 4, 5, 6, 10, 13, 28, 32, 33, 34, 37, 39], "hard": [1, 7, 8, 10, 13, 21, 22, 33, 34, 36, 38, 39], "hardcopi": [23, 31], "harder": [0, 1, 19, 21, 32, 39], "harmon": 3, "hash": 34, "hasn": [], "hassl": [0, 23, 31], "hast": [23, 31], "hasti": [0, 6, 16, 17, 19, 20, 25, 30, 31, 32, 35, 36], "hat": [0, 1, 5, 6, 7, 9, 10, 11, 12, 13, 16, 17, 18, 19, 24, 32, 33, 34, 35, 37, 38], "hauser": [], "have": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "have_sys_un_h": [], "haven": [1, 22, 39], "he": [7, 36, 37], "head": [4, 10, 28], "header": [0, 31], "heads_proba": 10, "health": [0, 32], "hear": [0, 13, 31, 34], "heart": [0, 7, 31, 36], "heatmap": [0, 1, 3, 7, 17, 20, 26, 31, 37, 39], "heavi": 34, "heavili": 0, "heavisid": [1, 39], "height": [1, 3, 6, 32, 39], "held": [13, 34], "help": [0, 1, 4, 12, 13, 15, 16, 25, 26, 31, 34, 35, 37, 38, 39], "helper": [4, 14, 36, 37], "henc": [0, 5, 6, 8, 9, 10, 12, 13, 31, 32, 33, 34, 35, 36, 37], "henrik": [29, 31], "her": [7, 36, 37], "here": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 19, 21, 22, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "hereaft": [0, 8, 12, 31], "herebi": [], "hermitian": 24, "hessenberg": 24, "hessian": [0, 2, 5, 13, 36, 37], "heterogen": [9, 10], "hex": [], "hi": [7, 36, 37], "hidden": [1, 3, 4, 12, 21, 26, 37], "hidden_bia": [1, 39], "hidden_bias_gradi": [1, 38, 39], "hidden_deriv": 39, "hidden_func": 39, "hidden_layer_s": [0, 1, 31, 39], "hidden_neuron": 4, "hidden_nodes1": 39, "hidden_nodes2": 39, "hidden_weight": [1, 39], "hidden_weights_gradi": [1, 38, 39], "hierarch": [5, 32, 33], "high": [0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 13, 14, 21, 23, 24, 25, 31, 32, 33, 34, 35, 36, 39], "higher": [0, 1, 3, 5, 6, 8, 13, 18, 25, 31, 32, 33, 34, 35, 36, 39], "highest": [1, 2, 36, 37, 39], "highli": [0, 3, 4, 10, 19, 23, 24, 26, 30, 31, 32, 33, 34], "highlight": [], "highwai": [], "hing": 8, "hint": [13, 15, 16, 21, 22, 26, 32, 33], "hinton": 34, "hip": 23, "hire": 0, "hist": [4, 6, 7, 28, 35, 37], "histogram": [6, 7, 28, 37], "histor": [7, 11, 36], "histori": [3, 4, 12, 15, 34, 37, 38], "hitherto": 5, "hjorth": [29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "hobbi": 28, "hoc": [5, 32, 33], "hoff": 30, "hojjatk": 26, "hold": [1, 3, 6, 13, 14, 33, 34, 35, 39], "holder": [0, 31], "holdgraf_evidence_2014": [], "home": [], "homepag": [25, 26, 31], "homework": [6, 13, 33, 34], "homogen": [1, 3, 9, 10, 13, 34], "honchar": 2, "hopefulli": [0, 11, 15, 19, 28, 31, 34], "horizont": 11, "horlyk": [29, 31], "hornik": 38, "hors": [3, 7, 31, 36, 37], "hot": [1, 9, 36, 37, 39], "hour": [1, 23, 27, 28, 29, 31, 34, 35, 39], "how": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "howev": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 21, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "href": [], "hspace": [0, 4, 8, 10, 28, 31, 38, 39], "hstack": [1, 39], "htf": 31, "html": [0, 16, 20, 21, 23, 25, 26, 27, 29, 30, 31, 32, 33, 34, 38, 39], "http": [0, 3, 4, 6, 13, 15, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "huang": [0, 31], "huber": [0, 31], "huge": [1, 3, 4, 23, 34, 39], "human": [0, 1, 3, 6, 9, 12, 32, 37, 38, 39], "humid": 9, "hundr": [1, 39], "hungri": [1, 39], "hybrid": 27, "hydrogen": [0, 31], "hyper": 26, "hyperbol": [1, 4, 12], "hyperparam": 8, "hyperparamat": 38, "hyperparamet": [3, 4, 5, 6, 9, 13, 18, 25, 26, 32, 33, 34, 38], "hyperplan": 11, "h\u00f8rlyk": [29, 31], "i": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38], "i0": [0, 31], "i1": [0, 6, 8, 12, 31, 32, 34, 37], "i2": [0, 8, 12, 31, 37], "i3": [0, 12, 31, 37], "i5": [0, 31], "i_": [13, 33, 34], "i_1": [5, 6, 35], "i_2": [5, 6, 35], "i_siz": [21, 22], "i_t": 34, "ian": 30, "iayaan2": 21, "ic": [1, 25, 26, 39], "id": [7, 13, 33, 34, 36], "ida": [29, 31], "idea": [0, 1, 2, 3, 4, 6, 9, 10, 12, 13, 20, 24, 25, 26, 32, 33, 34, 35, 36, 37, 38, 39], "ideal": [0, 2, 6, 8, 13, 28, 31, 34, 35, 36, 37, 39], "idem": [6, 35, 36], "ident": [5, 6, 12, 13, 17, 18, 24, 32, 33, 37, 39], "identical": 35, "identifi": [0, 1, 7, 9, 11, 12, 13, 14, 31, 32, 36, 37, 39], "idx": [36, 37], "ieor": 28, "ifi": 30, "ifs": [23, 31], "ignor": [0, 1, 3, 9, 15, 32, 34, 39], "ii": [24, 28, 39], "iii": [24, 31, 39], "ij": [0, 1, 3, 6, 8, 12, 14, 16, 24, 28, 31, 32, 34, 37, 38, 39], "ik": [0, 24, 31, 32], "iki": [], "ilg3ggewq5u": [38, 39], "ill": 34, "illinoi": [], "illustr": [5, 7, 10, 12, 13, 14, 20, 23, 31, 36, 39], "ilsvrc": 34, "im": 6, "imag": [1, 3, 4, 6, 9, 11, 12, 14, 30, 31, 37, 38, 39], "image_at_epoch_": 4, "image_batch": 4, "image_height": 3, "image_path": [0, 6, 7, 9, 31, 35, 36], "image_width": 3, "imageio": 6, "imagenet": 34, "images_from_seed_imag": 4, "imagin": [1, 39], "immedi": [0, 3, 4, 6, 23, 31, 34], "impact": 26, "implement": [0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 19, 20, 21, 22, 25, 28, 31, 32, 33, 34, 36, 37, 38], "impli": [3, 5, 6, 7, 13, 24, 32, 33, 34, 35, 36], "implicit": [3, 34], "implicitli": [11, 28], "import": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 25, 26, 28, 34, 35, 36, 37], "importantli": 3, "importerror": [], "impos": [0, 6, 11, 12, 31, 37, 39], "imposs": [0, 5, 31, 32, 33], "impract": 34, "impress": [0, 12, 31, 37, 38], "improv": [0, 4, 5, 9, 10, 11, 13, 15, 21, 25, 26, 32, 33], "impur": 9, "imread": 6, "imshow": [1, 3, 4, 6, 39], "in3050": [30, 31], "in3310": 31, "in4080": [30, 31], "in4300": [30, 31], "in4310": 30, "in5400": 3, "in5550": 30, "in_out_neuron": 4, "inaccur": [13, 33], "inact": [12, 37, 38, 39], "inadequ": [0, 31], "inappropri": 34, "inch": [6, 32], "incident": [], "includ": [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 15, 16, 17, 18, 19, 20, 21, 22, 23, 28, 29, 30, 31, 32, 33, 35, 39], "include_bia": [6, 9, 35, 36], "inclus": 26, "incom": [12, 16, 37, 38], "incorrect": [1, 39], "incoveni": 8, "increas": [0, 1, 3, 4, 5, 6, 9, 12, 13, 19, 25, 28, 31, 32, 34, 35, 36, 37, 38, 39], "increasingli": 28, "increment": 34, "ind": 6, "inde": [0, 2, 4, 5, 6, 13, 31, 32, 33, 38], "indefinit": 4, "independ": [0, 5, 6, 7, 8, 12, 13, 28, 31, 32, 33, 34, 36, 37], "index": [0, 1, 3, 4, 10, 14, 23, 24, 25, 26, 28, 30, 31, 39], "index_col": [0, 31], "indic": [0, 1, 3, 4, 5, 6, 9, 10, 11, 13, 16, 25, 26, 31, 32, 38, 39], "indirect": [], "indispens": [6, 35, 36], "individu": [1, 6, 7, 10, 12, 28, 31, 32, 34, 35, 36, 37, 38, 39], "indu": [], "indx": 24, "indx1": 2, "indx2": 2, "indx3": 2, "ineffici": [3, 13], "inequ": [8, 13], "inequaltii": 33, "inertia": 13, "inexperi": [], "inf": [], "inf1000": [23, 31], "inf1100": [23, 31], "inf1100l": [23, 31], "inf1110": [23, 31], "inf3000": 31, "infeas": [9, 34], "infer": [0, 1, 4, 6, 30, 31, 35, 36, 39], "inferenc": 1, "infil": [0, 6, 7, 9, 31, 35, 36], "infin": [5, 6, 7, 11, 19, 32, 33, 35, 36, 38, 39], "infinit": [3, 34], "infinitesim": 28, "influenc": [6, 10, 18, 35, 36], "influenti": [1, 39], "info": 31, "inform": [0, 1, 3, 4, 6, 9, 11, 12, 13, 14, 24, 25, 26, 30, 31, 33, 34, 35, 36, 37, 38, 39], "inforom": 15, "infrequ": 34, "infti": [3, 6, 13, 28, 33, 35, 38], "ingeni": [13, 33, 34], "ingredi": [0, 9, 31], "inher": [6, 34, 35, 36], "inherit": [24, 31, 34], "init": [], "initi": [0, 1, 2, 6, 10, 13, 14, 18, 24, 26, 28, 31, 33, 34, 35, 36, 37, 38, 39], "inititi": 39, "inject": 14, "inlin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 24, 28, 31, 32, 33, 34, 35, 36, 37, 39], "inner": [0, 13, 32], "innerhtml": [], "inp": 4, "inplac": 13, "inpput": 38, "input": [0, 1, 3, 4, 5, 6, 7, 8, 12, 13, 14, 16, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37], "input_dim": 1, "input_nod": 39, "input_s": 21, "input_shap": [3, 4], "inputs": 1, "inputs_shuffl": [0, 1, 32, 39], "inquiri": 20, "insert": [3, 5, 6, 8, 10, 28, 32, 33, 35], "insid": [4, 7, 21, 37], "insight": [0, 1, 5, 23, 26, 31, 32, 33, 35, 36, 38], "insist": [6, 13, 32, 34], "inspir": [0, 1, 12, 25, 26, 31, 37, 38, 39], "instabl": 2, "instal": [0, 1, 5, 6, 9, 15, 20, 26, 39], "instanc": [0, 1, 2, 4, 6, 9, 11, 13, 16, 31, 32, 33, 34, 35, 36, 39], "instanti": 10, "instead": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 17, 20, 21, 22, 24, 26, 28, 31, 32, 34, 35, 39], "institut": [1, 39], "instruct": [0, 1, 15, 39], "int": [0, 1, 2, 3, 4, 5, 6, 11, 13, 14, 24, 28, 32, 34, 35, 36, 37, 39], "int32": 10, "int_": [3, 6, 28, 35, 38], "int_0": 28, "int_a": 28, "intak": [0, 32], "integ": [1, 2, 13, 14, 24, 28, 31, 36, 37, 39], "integer_vector": [1, 39], "integr": [3, 6, 28, 31, 35], "intellig": [0, 14, 30, 31], "intend": 10, "intens": [1, 18, 39], "intention": 14, "interact": [0, 6, 9, 12, 23, 25, 26, 31, 37, 38], "intercept": [0, 6, 8, 11, 13, 16, 17, 18, 19, 31, 32, 33, 34, 35, 36, 37], "intercept_": [0, 6, 8, 9, 13, 31, 32, 34], "interchang": [5, 12, 24, 37, 38], "interconnect": [1, 39], "interesit": [], "interest": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 19, 23, 25, 26, 28, 31, 32, 33, 35, 36, 37, 38, 39], "interfac": [0, 1, 15, 24, 32, 39], "interior": [0, 9, 31], "intermedi": [24, 32, 34], "intermediari": [21, 22], "intermeti": 22, "intermetidari": 22, "intern": [1, 10, 12, 22, 36, 37, 38, 39], "internation": [], "interpol": [1, 3, 4, 6, 12, 37, 38, 39], "interpr": [5, 32, 33], "interpret": [0, 1, 6, 9, 10, 12, 13, 15, 16, 21, 24, 25, 26, 28, 38, 39], "interrupt": [], "interv": [0, 3, 5, 6, 7, 13, 19, 28, 31, 32, 33, 36, 37], "intial": [13, 33], "intract": [0, 4, 32], "intrins": [3, 11, 24, 28, 31], "intro": [23, 30, 31], "introduc": [0, 1, 5, 6, 8, 10, 12, 24, 25, 28, 31, 33, 34, 35, 37, 38, 39], "introduct": [1, 2, 4, 13, 30, 32, 33, 34, 36, 39], "introductori": [0, 4, 24, 30, 31, 32], "intuit": [0, 5, 6, 8, 12, 13, 25, 31, 34, 35, 36, 37, 38, 39], "inv": [0, 5, 13, 17, 31, 32, 33, 34], "invalid": [], "invalu": [0, 13, 23, 31, 33], "invari": [1, 39], "invd": 5, "inver": [8, 37], "invers": [0, 3, 6, 13, 31, 32, 33, 34], "inverse_transform": 8, "invert": [0, 5, 7, 10, 13, 16, 18, 31, 34, 36, 37], "investig": [], "invh": [13, 34], "invok": 8, "involv": [0, 2, 6, 7, 11, 12, 31, 32, 34, 35, 36, 37, 38, 39], "io": [0, 23, 25, 26, 27, 29, 30, 31, 32, 39], "ion": [], "ip": [0, 8, 28, 31], "ipca": 11, "ipynb": [23, 31], "ipython": [0, 5, 7, 9, 11, 14, 23, 25, 26, 31, 32, 36], "iq": [6, 35], "iri": [8, 9, 21], "irreduc": [6, 35, 36], "irrelev": [5, 32, 33], "irrespect": [0, 31], "irvin": [25, 26], "isaac": [], "isaacmus": [], "iseffici": [], "isn": 5, "isnan": 39, "isnul": [], "isolo": 22, "isomap": 11, "issu": [1, 9, 15, 24, 34, 39], "it_arrai": 13, "item": [0, 13, 31], "items": [24, 31], "iter": [1, 2, 4, 6, 8, 13, 14, 18, 25, 28, 33, 34, 35, 36, 37, 38, 39], "its": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 21, 23, 24, 25, 26, 28, 31, 33, 34, 35, 36, 37, 38, 39], "itself": [5, 6, 12, 25, 26, 28, 31, 32, 35, 38], "iv": 39, "ix": 39, "j": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 13, 14, 15, 16, 24, 25, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "j1": 24, "j_": 6, "j_41hld6ttu": 35, "j_lasso_sk": 6, "j_ridge_sk": 6, "j_sk": 6, "jackknif": [6, 23, 31, 35, 36], "jacobian": [2, 13, 33], "janko": [], "jason": 4, "javascript": [], "jax": [23, 26, 31, 34, 38], "jeff": [], "jensen": [29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "jentzen": [38, 39], "jerom": [19, 25, 30], "jhauser": [], "ji": [12, 24, 38, 39], "jit": 13, "jj": [0, 5, 6, 31, 35], "jk": [0, 1, 6, 12, 24, 31, 37, 38, 39], "jl": [0, 31], "jm": 24, "jnp": 13, "job": [2, 8, 10, 15], "join": [0, 4, 6, 7, 9, 25, 26, 31, 35, 36], "joint": [4, 5], "jonathan": [], "json": [], "judg": [13, 33, 36, 37], "judgement": 6, "julia": [23, 24, 25], "juliu": [38, 39], "jump": [28, 34], "junk": 4, "jupit": 31, "jupyt": [0, 15, 16, 19, 23, 25, 30, 31, 35, 38, 39], "jupyterbook": [], "jupytext": [], "just": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 21, 22, 23, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "justif": 0, "justifi": [3, 10], "k": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 21, 23, 24, 25, 28, 29, 31, 32, 33, 34, 37], "k0": [7, 36, 37], "k1": [7, 36, 37], "kaggl": [6, 25, 26], "kajda": 39, "kappa_d": 28, "karl": [29, 31], "karush": 8, "katex": [], "katrin": [29, 31], "keep": [0, 1, 4, 5, 6, 11, 13, 14, 15, 18, 21, 22, 24, 25, 26, 31, 32, 33, 34, 35, 36, 39], "keepdim": [1, 6, 10, 24, 35, 36, 37, 39], "kei": [1, 3, 6, 12, 34, 37, 39], "kellei": [], "kenneth": [], "kept": [4, 6, 14, 35, 36], "kera": [0, 4, 23, 25, 26, 31], "kernel": [0, 1, 3, 23, 31, 32, 39], "kernel_regular": [1, 3, 39], "kernel_s": 4, "kernelpca": 11, "kev": [0, 31], "kevin": [30, 31], "kevinsheppard": [], "keyboardinterrupt": 39, "keyword": [18, 24, 31, 39], "kfold": [6, 35, 36], "kg": [1, 39], "ki": 24, "kick": [1, 13, 34, 39], "kiener": 2, "kilomet": [6, 32], "kim": [], "kind": [0, 2, 3, 4, 8, 12, 13, 14, 31, 32, 37, 38, 39], "kingma": 34, "kj": [6, 12, 24, 32, 34, 38, 39], "kjm": [23, 31], "kkt": 8, "kl": 28, "km": [12, 31, 37], "kmean": 14, "kmeanspoint": 14, "kn_k": 14, "know": [0, 1, 2, 5, 6, 8, 13, 15, 16, 17, 19, 20, 23, 31, 32, 33, 39], "knowledg": [0, 23, 31], "known": [1, 3, 4, 5, 6, 7, 8, 9, 12, 18, 24, 25, 26, 28, 30, 32, 34, 35, 36, 37, 38, 39], "kondev": [0, 31], "kp": 28, "kpca": 11, "kramdown": [], "kroneck": 14, "kt": [], "kuckuck": [38, 39], "kuhn": 8, "kutyniok": [38, 39], "kvalsund": [29, 31], "kwarg": 39, "kwown": [0, 31], "l": [0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 22, 24, 25, 28, 31, 33, 34, 36, 37], "l0": [7, 36, 37], "l1": [0, 1, 3, 7, 26, 31, 36, 37, 39], "l1_l2": [1, 3, 39], "l1regl": 5, "l2": [1, 3, 26, 39], "l_": [24, 34], "l_1": [7, 26, 36, 37, 38], "l_2": [7, 13, 26, 33, 34, 36, 37, 38], "l_i": 34, "l_j": [12, 38, 39], "l_ja": 39, "la": 13, "la_": [], "la_i": [12, 38, 39], "la_k": [12, 38], "lab": [20, 23, 25, 26, 31], "label": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 20, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "labelencod": [7, 10, 37], "labels": [6, 8, 9], "labels_shuffl": [0, 1, 32, 39], "laboratori": 27, "lack": [0, 31, 34], "lagari": 2, "lagrang": [8, 11], "lam": [18, 39], "lambda": [0, 1, 2, 3, 5, 6, 7, 8, 10, 12, 13, 17, 18, 19, 20, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 39], "lambda_": 11, "lambda_0": 11, "lambda_1": [5, 8, 11, 32, 33], "lambda_2": [8, 11], "lambda_i": [8, 11], "lambda_iy_i": 8, "lambda_jy_iy_j": 8, "lambda_k": 8, "lambda_n": [5, 8, 32, 33], "lamda": 1, "land": 8, "landmark": 8, "landscap": [13, 18, 33, 34], "langl": [0, 6, 11, 28, 31, 32], "languag": [0, 1, 4, 8, 23, 24, 25, 26, 30, 31, 39], "lapack": [24, 31], "laplac": 5, "laptop": [15, 23], "larg": [0, 1, 2, 4, 5, 6, 8, 9, 10, 11, 13, 18, 23, 24, 25, 28, 30, 31, 32, 33, 34, 35, 36, 38, 39], "larger": [0, 3, 5, 6, 8, 10, 11, 13, 17, 22, 28, 31, 32, 33, 34, 35], "largest": [4, 8, 11], "lasso": [0, 7, 23, 26, 31, 34, 35, 36, 37], "lasso_sk": 6, "last": [0, 1, 3, 4, 5, 6, 7, 8, 12, 16, 17, 19, 21, 22, 24, 25, 28, 29, 31, 33, 35, 36], "latent": 4, "latent_dim": 4, "latent_point": 4, "latent_space_value_rang": 4, "later": [0, 1, 4, 7, 8, 12, 13, 14, 15, 19, 21, 22, 23, 25, 26, 31, 34, 36, 37, 38, 39], "latest": [4, 15, 23], "latest_checkpoint": 4, "latex": [20, 31], "latexcodec": [], "latrpygrtttbnjr3znuhl": 22, "latter": [0, 3, 6, 7, 8, 11, 13, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38], "lattic": [12, 37, 38], "law": 0, "layer": [0, 4, 13, 26, 31, 34, 37], "layer_grad": 22, "layer_input": 22, "layer_output_s": [21, 22], "layers_grad": 21, "lbfg": [7, 9, 10, 37], "lc_messag": [], "lcc": [5, 6, 35], "lda": 11, "ldot": [0, 6, 11, 25, 31, 35, 36], "le": [5, 7, 10, 13, 17, 28, 32, 33, 34, 36], "lead": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 21, 22, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "leaf": 9, "leaki": [1, 26, 39], "leakyrelu": [4, 26], "lear": [13, 33], "learn": [3, 4, 5, 6, 7, 8, 9, 10, 12, 21, 24, 29, 30], "learnabl": 3, "learner": 10, "learnig": 31, "learning_r": [8, 10, 21], "learning_rate_init": [0, 1, 31, 39], "learning_schedul": [13, 34], "learnt": [25, 26], "least": [0, 7, 8, 10, 11, 17, 18, 23, 24, 28, 35, 36, 37], "leat": [13, 34], "leav": [0, 1, 3, 5, 6, 9, 11, 21, 31, 33, 35, 36, 39], "lectur": [0, 1, 5, 10, 11, 12, 13, 23, 24, 25, 26, 27, 29, 30, 32], "lecturenot": [0, 23, 25, 26, 30, 31, 39], "left": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "leftarrow": [8, 12, 38, 39], "legend": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 15, 21, 31, 32, 33, 34, 35, 36, 37], "legend_el": 21, "leinonen": 31, "len": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 16, 17, 21, 22, 24, 31, 32, 33, 34, 35, 36, 37, 39], "length": [0, 1, 3, 4, 8, 9, 13, 16, 21, 23, 31, 32, 33, 34, 39], "length_of_sequ": 4, "leq": [0, 5, 7, 8, 13, 14, 28, 31, 32, 33, 34, 36], "less": [0, 1, 3, 4, 5, 6, 8, 9, 13, 23, 28, 31, 32, 33, 34, 35, 36, 39], "lessen": [1, 39], "let": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 19, 22, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "letter": [0, 16, 24, 28, 31, 32], "level": [0, 1, 5, 6, 9, 23, 24, 25, 26, 27, 29, 31, 34, 35, 36, 38, 39], "leverag": 34, "lexer": [], "li": [8, 11], "liabil": [], "liabl": [], "lib": [], "liberti": 34, "liblinear": 10, "librari": [0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 24, 25, 28, 30, 32, 33, 34, 39], "licenc": [], "licens": [0, 1, 23, 25, 31, 39], "lie": [0, 6, 11, 28, 31, 32, 35, 36], "life": [0, 1, 8, 12, 31, 37, 38, 39], "lifetim": 13, "light": [], "like": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 15, 16, 20, 21, 22, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "likelihood": [0, 1, 5, 9, 31, 32, 39], "lim_": 28, "limit": [0, 5, 6, 8, 12, 24, 25, 26, 31, 32, 36, 37, 38], "lin_clf": 8, "lin_model": [], "lin_reg": 9, "linalg": [0, 2, 5, 6, 8, 11, 13, 17, 24, 28, 31, 32, 33, 34, 37], "line": [0, 3, 6, 8, 11, 13, 15, 16, 20, 21, 31, 33, 34, 35, 38, 39], "line1": 8, "line2": 8, "line2d": [], "line3": 8, "line_model": 15, "line_ms": 15, "line_predict": 15, "linear": [1, 3, 5, 6, 7, 9, 10, 11, 12, 16, 17, 18, 19, 21, 23, 25, 26, 28, 34, 35, 37, 38, 39], "linear_model": [0, 5, 6, 7, 8, 9, 10, 11, 13, 15, 16, 19, 26, 31, 32, 33, 34, 35, 36, 37], "linear_regress": [6, 35, 36, 39], "linearli": [5, 32, 33, 34], "linearloc": [6, 13, 33, 34], "linearregress": [0, 6, 7, 9, 15, 16, 19, 31, 32, 34, 35, 36], "linearsvc": 8, "lineat": 33, "liner": [1, 3, 39], "linerar": 10, "linewidth": [0, 2, 4, 6, 8, 9, 10, 35], "link": [0, 4, 9, 12, 15, 20, 21, 23, 25, 26, 27, 29, 31, 36, 38], "linlag": 5, "linpack": [24, 31], "linreg": [0, 31], "linspac": [0, 2, 3, 4, 6, 8, 9, 10, 13, 16, 17, 19, 24, 28, 31, 32, 34, 35, 36], "linu": 4, "linux": [0, 1, 23, 25, 31, 39], "liquid": [0, 31], "list": [1, 2, 3, 4, 9, 15, 21, 22, 23, 25, 26, 31, 34, 37], "listedcolormap": [9, 10], "literatur": [1, 7, 14, 30, 35, 36, 39], "littl": [1, 3, 9, 12, 22, 34, 38, 39], "live": [8, 16], "ll": [0, 18, 28, 31, 32], "lle": [0, 32], "llm": 20, "lloyd": [4, 14], "lmb": [0, 2, 5, 6, 32, 33, 34, 35, 36], "lmbd": [0, 1, 3, 31, 39], "lmbd_val": [0, 1, 3, 31, 39], "lmbda": [13, 33, 34], "ln": [1, 13, 33, 39], "load": [1, 4, 6, 7, 9, 10, 34, 37], "load_boston": [], "load_breast_canc": [1, 7, 9, 10, 11, 37, 39], "load_data": [3, 4], "load_digit": [1, 3, 39], "load_iri": [8, 9, 21], "loc": [3, 6, 7, 8, 9, 10, 21, 31, 35, 36, 37], "local": [0, 1, 3, 7, 12, 13, 15, 21, 22, 32, 33, 34, 36, 37, 38, 39], "locat": [2, 3, 8, 15], "log": [0, 1, 2, 4, 5, 6, 7, 9, 10, 11, 13, 15, 20, 21, 24, 25, 26, 31, 34, 35, 36, 37, 39], "log10": [0, 5, 6, 32, 33, 34, 35, 36, 39], "log_": [0, 31], "log_clf": 10, "logarithm": [0, 5, 7, 17, 24, 31, 35, 36, 37], "logbook": [25, 26], "logic": [0, 1, 9, 31, 39], "logical_or": [], "login": 15, "logist": [0, 1, 2, 8, 9, 10, 11, 12, 13, 23, 26, 32, 33, 34, 38], "logisti": 26, "logistic_regress": 39, "logisticregress": [7, 9, 10, 11, 26, 36, 37], "logit": [7, 26, 36, 37], "logreg": [7, 9, 10, 11, 37], "logspac": [0, 1, 3, 5, 6, 31, 32, 33, 34, 35, 36, 39], "long": [0, 1, 3, 4, 12, 13, 21, 31, 33, 34, 37, 38, 39], "longer": [2, 3, 8, 10, 14, 24, 28, 31, 34], "loocv": [6, 35, 36], "look": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 16, 19, 20, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 39], "loop": [1, 4, 6, 10, 12, 14, 16, 17, 18, 22, 23, 24, 31, 34, 35, 36, 39], "lose": [1, 39], "loss": [0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 13, 18, 21, 24, 25, 26, 31, 35, 36, 37, 38, 39], "loss_bin": [36, 37], "loss_fil": 4, "loss_multi": [36, 37], "loss_vec": [36, 37], "lossfil": 4, "lost": 4, "lot": [1, 4, 6, 16, 19, 20, 34, 35, 39], "low": [0, 6, 9, 10, 11, 25, 31, 32, 35, 36], "lower": [0, 1, 3, 6, 9, 10, 16, 21, 24, 32, 34, 39], "lowercas": [24, 31], "lowest": [9, 13, 28, 34], "lr": [1, 3, 4, 10, 36, 37, 39], "lrelu": 39, "lstat": [], "lstm": 4, "lstm_2layer": 4, "lstsq": [0, 31, 32], "lt": [6, 35], "lu": [0, 5, 31, 32, 33], "lubksb": 24, "luckili": 2, "ludcmp": 24, "lux": 24, "lvert": [1, 39], "lw": [0, 31], "m": [0, 1, 2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 15, 24, 28, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39], "m_": [9, 12, 38, 39], "m_0": 34, "m_1": 14, "m_h": [0, 31], "m_k": 14, "m_l": [12, 38, 39], "m_n": [0, 31], "m_p": [0, 31], "m_t": [13, 34], "ma": 11, "machin": [1, 3, 4, 5, 6, 7, 9, 10, 11, 12, 15, 16, 24, 30, 32, 34, 35, 38, 39], "machinelearn": [0, 6, 16, 20, 23, 25, 26, 27, 29, 30, 31, 32, 33, 36, 37, 39], "machineri": [], "mackai": 30, "macro": [], "made": [0, 1, 3, 4, 5, 6, 7, 9, 11, 12, 25, 26, 31, 32, 34, 36, 37, 38, 39], "mae": [0, 31], "magic": 4, "magnitud": [1, 6, 7, 13, 21, 32, 34, 37, 38, 39], "mai": [0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 19, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "mail": [27, 29], "main": [0, 1, 3, 4, 5, 6, 7, 9, 24, 25, 26, 30, 32, 33, 34, 36, 37, 39], "mainli": [0, 5, 6, 7, 9, 31, 32, 35, 36, 37], "maintain": [6, 34, 35], "major": [1, 6, 9, 10, 13, 24, 31, 33, 34, 35, 36, 39], "make": [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 15, 16, 18, 19, 21, 22, 23, 24, 25, 26, 28, 30, 31, 33, 34, 35, 36, 37, 38, 39], "make_axes_locat": 6, "make_classif": 37, "make_moon": [8, 9, 10], "make_pipelin": [0, 6, 10, 32, 35, 36], "makedir": [0, 6, 7, 9, 31, 35, 36], "malcondit": 24, "malign": [1, 7, 9, 37], "mammographi": 5, "manag": [0, 2, 3, 15, 23, 25, 31, 34], "mandatori": [29, 31], "mani": [0, 1, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "manifold": 11, "manner": 3, "manual": [6, 21, 22, 32, 34], "map": [0, 1, 2, 6, 7, 8, 11, 12, 14, 28, 31, 36, 37, 39], "marc": 32, "marchant": [], "margin": [0, 5, 8], "marit": [0, 31], "mark": 31, "markdownfil": [], "markdownit": [], "markdownitdeflist": [], "markedli": [], "marker": [7, 24, 31, 36], "markov": [23, 31], "markup": [], "marsaglia": 28, "mask_or": [], "masked_arrai": [], "maskedrecord": [], "mass": [0, 1, 5, 13, 32, 33, 39], "massag": [0, 31], "masses2016": [0, 31], "masses2016ol": [0, 31], "masses2016tre": 0, "masseval2016": [0, 31], "master": [27, 29], "mat": [23, 31], "mat1100": [23, 31], "mat1110": [23, 31], "mat1120": [23, 31], "match": [1, 4, 5, 13, 14, 15, 32, 33, 34, 39], "materi": [4, 5, 7, 13, 15, 24, 27, 29, 37], "math": [3, 7, 12, 13, 24, 28, 30, 31, 34, 36, 37, 39], "mathbb": [0, 4, 5, 6, 7, 8, 11, 12, 13, 14, 17, 19, 24, 25, 28, 31, 32, 33, 34, 35, 36, 37, 38], "mathbf": [0, 5, 6, 7, 8, 13, 19, 24, 25, 31, 32, 33, 34, 35, 36, 37, 38], "mathcal": [1, 5, 6, 7, 13, 25, 35, 36, 37, 39], "matheemat": 3, "mathemat": [0, 6, 11, 12, 13, 21, 23, 24, 28, 30, 31, 34], "mathemati": 31, "mathrm": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 19, 25, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "matmul": [1, 2, 5, 38, 39], "matnat": 30, "matplotlib": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 19, 21, 22, 23, 24, 25, 28, 31, 32, 33, 34, 35, 36, 37, 39], "matplotlibrc": [], "matric": [0, 1, 3, 4, 6, 7, 8, 11, 13, 16, 17, 23, 32, 33, 36, 37, 38, 39], "matrix": [0, 2, 3, 4, 6, 7, 8, 10, 13, 17, 18, 19, 21, 25, 26, 28, 35, 36, 38], "matshow": 1, "matter": [2, 3, 13, 32, 33, 34, 38], "matthia": [], "max": [0, 1, 2, 3, 4, 9, 10, 12, 13, 21, 29, 31, 33, 34, 36, 37, 38, 39], "max_depth": [0, 9, 10], "max_diff": 2, "max_diff1": 2, "max_diff2": 2, "max_it": [0, 1, 8, 13, 26, 31, 37, 39], "max_iter": 14, "max_leaf_nod": 10, "max_sampl": 10, "maxdegre": [0, 6, 10, 32, 35, 36], "maxdepth": 10, "maxim": [1, 4, 5, 7, 8, 11, 35, 36, 37, 39], "maximum": [0, 2, 3, 5, 7, 8, 9, 10, 13, 14, 31, 32, 33, 34], "maxpolydegre": [5, 6, 32, 33, 34, 35, 36], "maxpooling2d": 3, "mbox": [5, 6, 32, 33, 35], "mcculloch": [12, 37, 38], "md": 11, "mdoel": 4, "me": [], "mean": [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 22, 23, 24, 25, 26, 28, 31, 34, 35, 37, 38, 39], "mean0": [36, 37], "mean1": [36, 37], "mean_absolute_error": [0, 31], "mean_divisor": 14, "mean_i": 28, "mean_matrix": 14, "mean_squared_error": [0, 4, 6, 7, 10, 15, 19, 31, 32, 35, 36], "mean_squared_log_error": [0, 31], "mean_vector": 14, "mean_x": 28, "meaning": [0, 4, 7, 31, 36], "meansquarederror": [0, 31], "meant": [3, 7, 10, 13, 36, 38], "meanwhil": 34, "measur": [0, 1, 2, 5, 6, 9, 11, 12, 14, 16, 18, 25, 26, 28, 31, 32, 34, 35, 36, 38, 39], "mechan": [0, 4, 28, 31, 34], "median": [0, 31, 32, 34], "medicin": [12, 37, 38], "medium": [4, 8, 13, 26, 34], "medv": [], "meet": [0, 29], "mehta": [0, 31, 32, 33], "member": [20, 25, 26], "memori": [3, 4, 11, 12, 13, 18, 24, 37, 38], "mentat": [], "mention": [0, 12, 13, 25, 26, 28, 31, 33, 34, 37, 38], "merchant": [], "mere": [0, 25, 26], "merg": [], "meshgrid": [2, 5, 6, 8, 9, 10, 11, 39], "mess": 15, "messag": [5, 13], "messi": 2, "messier": 22, "met": [0, 3, 8, 32], "meta": [], "meteorolog": 9, "meter": [6, 32], "method": [0, 1, 2, 3, 4, 5, 7, 8, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 28, 30, 32, 38], "metion": 6, "metric": [0, 1, 3, 6, 7, 9, 10, 14, 15, 21, 22, 26, 31, 32, 35, 36, 37, 39], "metropoli": [23, 31], "mev": [0, 28, 31], "mgd": [13, 34], "mglearn": [23, 31], "mgrid": 13, "mhjensen": [], "mi": 10, "mia": [29, 31], "michael": [26, 38, 39], "microsoft": 30, "mid": [1, 39], "midel": 4, "midnight": [15, 21, 22], "midpoint": 9, "might": [0, 1, 2, 4, 6, 9, 13, 15, 17, 18, 22, 32, 33, 34, 39], "migth": 17, "mild": 9, "millimet": [6, 32], "million": [0, 31, 32, 34], "mimic": [12, 37, 38], "min": [0, 2, 5, 8, 9, 33], "min_": [0, 2, 5, 14, 17, 31, 32, 33], "min_samples_leaf": 9, "mind": [0, 6, 13, 15, 18, 21, 31, 32, 33, 34, 35], "mindboard": 4, "mine": [23, 31], "mini": [1, 11, 12, 13, 33, 39], "minibatch": [1, 11, 13, 39], "minibathc": [13, 34], "miniforge3": [], "minim": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 32, 33, 34, 35, 39], "minima": [0, 1, 7, 13, 31, 33, 34, 36, 37, 39], "minimum": [0, 1, 2, 6, 8, 9, 11, 13, 32, 33, 34, 35, 36, 37, 39], "minmaxscal": [0, 32, 34, 39], "minor": 28, "minst": [1, 39], "minu": [7, 36], "mirjalili": 31, "mirror": 9, "misc": 6, "misclassif": [8, 9, 10], "misclassifi": [8, 10], "miser": 0, "mismatch": [1, 39], "miss": [7, 10], "mistak": [4, 19], "mit": 30, "mitig": 34, "mix": [1, 2, 31, 39], "mixtur": [13, 34], "mk": [9, 24], "mkdir": [0, 6, 7, 9, 31, 35, 36], "ml": [0, 1, 10, 13, 24, 25, 26, 32, 33, 34, 39], "mlab": 28, "mle": [5, 7, 36, 37], "mlp": [1, 37, 38, 39], "mlpclassifi": [1, 37, 39], "mlpregressor": [0, 31], "mm": 24, "mml": 32, "mn": [12, 28, 37], "mnist": [1, 11, 26, 39], "mnist_784": 26, "mo": [], "mod": 28, "mode": [27, 29, 31, 36, 37, 39], "model": [2, 3, 5, 7, 8, 9, 10, 11, 13, 14, 16, 18, 19, 20, 21, 23, 25, 26, 28, 30, 32, 33, 34, 35, 36], "model_bin": [36, 37], "model_multi": [36, 37], "model_select": [0, 1, 3, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 26, 31, 32, 33, 34, 35, 36, 37, 39], "moder": [10, 34], "modern": [0, 6, 7, 23, 31, 34, 35, 36, 37, 38, 39], "modest": 34, "modif": [2, 12, 13], "modifi": [0, 1, 3, 5, 7, 8, 10, 12, 13, 31, 32, 33, 34, 36, 37, 38, 39], "modul": [0, 16, 24, 31], "modular": 28, "modulo": 28, "moe": [11, 32], "moment": [5, 6, 13, 28, 35, 39], "moment_correct": 39, "momentum": [22, 38, 39], "momentum_schedul": 39, "mondai": [29, 31, 36], "monitor": [13, 34], "monoton": [5, 12, 28, 35, 37, 38, 39], "mont": [0, 6, 23, 28, 30, 31, 35, 36], "montli": 16, "moor": [5, 6], "more": [0, 1, 2, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 22, 23, 26, 28], "moreov": [0, 3, 26], "morten": [29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "mortenhj": 31, "most": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 21, 22, 23, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "mostli": [1, 11, 18, 34, 39], "motion": [0, 13], "motiv": [1, 4, 38, 39], "moulin": 34, "move": [0, 4, 5, 6, 7, 9, 12, 13, 14, 15, 16, 21, 22, 25, 28, 32, 33, 35, 36, 37, 38, 39], "mpl": [7, 31, 36], "mpl_toolkit": [2, 6, 13, 33, 34], "mplot3d": [2, 6, 13, 33, 34], "mplregressor": [1, 39], "mr_": [], "mrecord": [], "ms3tv8fvar": 37, "mse": [0, 4, 5, 6, 9, 10, 15, 16, 17, 19, 20, 22, 25, 26, 31, 32, 33, 34, 35, 36, 39], "mse_der": 22, "mse_simpletre": 10, "mselassopredict": [5, 33], "mselassotrain": [5, 33], "mseownridgepredict": [6, 32, 33, 34], "msepredict": [5, 33], "mseridgepredict": [0, 5, 6, 32, 33, 34], "msetrain": [5, 33], "msg": [], "msle": [0, 31], "mt": [7, 12, 36, 37, 39], "mu": [0, 6, 11, 13, 28, 31, 34, 35], "mu0": 28, "mu1": 28, "mu2": 28, "mu_": [6, 28, 32, 34, 35], "mu_i": [6, 32, 34], "mu_n": 11, "mu_x": 28, "much": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15, 20, 21, 22, 24, 25, 28, 31, 32, 33, 34, 35, 36, 38, 39], "multi": [0, 1, 3, 7, 23, 31, 36], "multi_class": [26, 36, 37], "multiclass": [1, 7, 26, 36, 37], "multiclass_result": [36, 37], "multidimension": [11, 12, 31, 37, 38], "multilay": [1, 39], "multinomi": [7, 26, 36, 37], "multipl": [2, 4, 5, 6, 7, 12, 13, 15, 22, 26, 28, 32, 33, 34, 35, 36, 37, 38], "multipli": [3, 5, 6, 11, 13, 18, 22, 24, 28, 32, 33, 34], "multiplum": 8, "multivari": [0, 2, 10, 11, 23, 28, 31], "multivariate_norm": [11, 14], "multpli": 16, "murphi": [11, 30, 31], "muse": [], "must": [1, 2, 5, 6, 8, 10, 12, 13, 14, 15, 20, 22, 25, 26, 28, 32, 33, 34, 35, 36, 37, 38, 39], "mutat": [7, 36, 37], "mutual": [1, 3, 6, 13, 35, 36, 39], "mx_": 28, "my": 31, "myenv": [], "myriad": [0, 23, 31], "myself": [], "mz1": 28, "mz2": 28, "m\u00f8svatn": 6, "n": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "n0": [36, 37], "n1": [24, 36, 37], "n2": 24, "n8grai": [], "n_": [1, 2, 3, 8, 12, 28, 37, 39], "n_0": [12, 28, 37], "n_boostrap": [6, 10, 35, 36], "n_bootstrap": [6, 35], "n_categori": [1, 3, 39], "n_class": [36, 37], "n_cluster": 14, "n_compon": 11, "n_epoch": [13, 34, 39], "n_estim": 10, "n_examples_to_gener": 4, "n_featur": [1, 18, 36, 37, 38, 39], "n_filter": 3, "n_hidden": 2, "n_hidden_neuron": [0, 1, 31, 38, 39], "n_i": 28, "n_input": [0, 1, 3, 32, 38, 39], "n_instanc": 9, "n_iter": 34, "n_job": 10, "n_k": 14, "n_l": [12, 28, 37], "n_layer": 1, "n_m": 9, "n_neuron": 1, "n_neurons_connect": 3, "n_neurons_layer1": [1, 39], "n_neurons_layer2": [1, 39], "n_output": [38, 39], "n_point": 14, "n_sampl": [6, 8, 9, 10, 14, 18, 35, 36, 37], "n_split": [6, 35, 36], "n_step": 4, "n_t": 2, "n_x": 2, "nabla": [1, 13, 33, 34, 39], "nabla_": [2, 13, 33, 34], "nabla_w": 13, "nafter": 39, "nag": 13, "naimi": [0, 31], "naiv": [7, 36, 37], "naive_kmean": 14, "name": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 18, 20, 21, 23, 24, 25, 26, 28, 29, 31, 32, 33, 35, 36, 37, 38, 39], "namespac": [], "nan": 39, "narrow": [13, 34], "nathaniel": [], "nation": [1, 5, 39], "nativ": [23, 31], "natur": [0, 1, 4, 8, 9, 12, 13, 25, 26, 28, 30, 31, 33, 34, 37, 38, 39], "navier": [12, 37, 38], "navig": [15, 34], "nb": 28, "nb_": 24, "nbconvert": 31, "nd": 14, "ndarrai": [6, 39], "nderiv": 39, "ne": [9, 10, 24, 28, 32, 33], "nearest": [1, 3, 6, 11, 39], "nearli": [13, 33], "neat": 31, "neccesari": [6, 35], "necess": 2, "necessari": [0, 1, 3, 4, 8, 14, 18, 31, 38, 39], "necessarili": [0, 4, 11, 28, 31], "necesserali": 5, "neck": [7, 36, 37], "need": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 24, 26, 28, 32, 33, 34, 35, 36, 37, 38, 39], "neg": [0, 1, 3, 5, 6, 7, 10, 13, 24, 28, 31, 33, 35, 36, 37, 39], "neg_mean_squared_error": [6, 35, 36], "neglect": [28, 34], "neglig": 28, "neighbor": [3, 6, 11], "neither": [4, 13, 34], "neq": [13, 14, 28, 33], "nerual": 39, "nervou": [12, 37, 38], "nest": [9, 12, 37], "nesterov": 13, "net": [2, 4, 12, 26, 37, 38], "netlib": [24, 31], "network": [0, 9, 13, 21, 22, 23, 30, 32], "network_input_s": [21, 22], "neural": [0, 13, 21, 22, 23, 30, 32, 36], "neural_network": [0, 1, 2, 31, 37, 39], "neuralnetwork": [1, 22, 39], "neuralnetworksanddeeplearn": [26, 38, 39], "neuron": [1, 2, 3, 4, 12, 39], "neutral": [0, 31], "neutron": [0, 31], "never": [1, 4, 6, 9, 28, 35, 36, 39], "new": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 17, 20, 22, 24, 31, 32, 33, 34, 36, 37, 39], "new_chang": [13, 34], "new_hobbit": 31, "new_ma": [], "newaxi": [0, 3, 6, 9, 21, 35, 36], "newli": [0, 31], "newlin": [36, 37], "newton": [1, 7, 8, 13, 28, 38, 39], "next": [0, 1, 2, 3, 4, 5, 6, 8, 9, 13, 14, 15, 16, 21, 22, 31, 32, 33, 34, 35, 37, 38, 39], "next_guess": 13, "next_input": 4, "ng": [1, 39], "nhow": 39, "ni": 14, "nice": [0, 1, 5, 11, 22, 31, 32, 33, 39], "nicer": [18, 34], "nielsen": [26, 38, 39], "nine": [38, 39], "nip": 34, "niter": [13, 33, 34], "nitric": [], "nlambda": [0, 5, 6, 32, 33, 34, 35, 36], "nlp": 30, "nm": 28, "nm_n": [0, 31], "nmse": [6, 35, 36], "nn": [2, 5, 6, 12, 24, 31, 35, 37], "nn_model": 1, "nnmin": 2, "node": [1, 3, 9, 10, 12, 21, 26, 37], "nois": [0, 4, 5, 6, 8, 9, 10, 13, 18, 19, 25, 31, 32, 33, 34, 35, 36], "noise_dimens": 4, "noisi": [1, 6, 25, 34, 35, 36, 39], "nomask": [], "non": [0, 1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 18, 21, 24, 28, 31, 32, 33, 35, 36, 37, 38, 39], "nondifferenti": 34, "none": [0, 1, 2, 4, 5, 9, 10, 13, 28, 31, 32, 36, 37, 38, 39], "noninfring": [], "nonlinear": [3, 6, 8, 9, 11, 12, 35, 36, 37, 38], "nonneg": [6, 9, 13, 33, 35, 36], "nonparametr": 6, "nonsens": 28, "nonsingular": 24, "nonumb": [3, 7, 8, 13, 24, 36, 37], "nor": [1, 4, 13, 22, 34, 38, 39], "norm": [0, 1, 5, 6, 8, 11, 13, 18, 31, 32, 33, 34, 35, 38, 39], "normal": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 21, 23, 24, 25, 26, 28, 31, 32, 33, 34, 36, 37, 38], "normali": [24, 31], "norwai": [6, 25, 26, 31, 33, 34, 35, 37, 38, 39], "notabl": [], "notat": [0, 2, 5, 6, 13, 14, 28, 31, 32, 33, 35, 36, 38, 39], "note": [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 18, 22, 23, 24, 28, 30, 31, 34, 35, 36, 37, 38, 39], "notebook": [0, 1, 3, 9, 15, 16, 19, 20, 21, 22, 23, 25, 26, 31, 35, 38, 39], "noteworthi": 34, "noth": [1, 2, 5, 8, 12, 14, 28, 32, 33, 37, 39], "notic": [4, 5, 12, 13, 22, 24, 28, 31, 38, 39], "notimplementederror": 39, "notion": 3, "noutput": 39, "novel": [3, 6, 10, 31], "novemb": [1, 29, 31, 39], "now": [0, 2, 4, 5, 6, 7, 8, 10, 11, 12, 14, 15, 16, 19, 21, 22, 23, 24, 25, 26, 28, 31, 32, 37, 38, 39], "nowadai": [0, 1, 3, 9, 23, 31, 39], "nox": [], "np": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 22, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "npm": [], "npr": 2, "nsampl": [6, 35, 36], "nt": 2, "nu": 28, "nuclear": [5, 32, 33], "nuclei": [0, 28, 31], "nucleon": [0, 31], "nucleu": [0, 31], "num": 4, "num_coordin": 2, "num_equ": 39, "num_hidden_neuron": 2, "num_it": [2, 18], "num_neuron": 2, "num_neurons_hidden": 2, "num_not": 39, "num_point": 2, "num_tre": 10, "num_valu": 2, "number": [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 21, 24, 25, 26, 27, 29, 31, 33, 35, 36, 37, 39], "numberid": [7, 36], "numberparamet": 3, "numer": [0, 5, 6, 9, 10, 11, 12, 13, 21, 23, 24, 30, 31, 32, 33, 34, 35, 36, 37, 38], "numpi": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 28, 32, 33, 34, 35, 36, 37, 38, 39], "numpydocstr": [], "nunmpi": [5, 32], "nve_frngahw": 33, "nx": 2, "ny": [28, 39], "o": [0, 1, 4, 5, 6, 7, 8, 9, 11, 24, 29, 30, 31, 32, 33, 34, 35, 36, 37], "obei": [6, 11, 13, 32, 34], "object": [0, 1, 4, 8, 10, 15, 19, 24, 31, 34, 38], "obliqu": [5, 32, 33], "observ": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 28, 31, 33, 34, 35, 36, 37], "obtain": [0, 1, 5, 6, 7, 8, 9, 10, 12, 13, 14, 17, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "obviou": [5, 6, 11, 28, 32, 33], "obviouli": 31, "obvious": [0, 4, 5, 6, 24, 31, 35], "oc": [32, 33], "occupi": [], "occur": [0, 6, 8, 9, 24, 28, 31], "octob": [21, 22, 26, 29, 31, 37], "od": 0, "odd": [0, 3, 7, 31, 32, 34, 36, 37], "odenum": 2, "odesi": 2, "oen": 0, "off": [1, 3, 4, 5, 9, 13, 20, 26, 28, 34, 35, 39], "offer": [6, 11, 23, 24, 27, 29, 31, 35, 36], "offic": [29, 31], "offici": [27, 31], "offlin": [21, 22], "often": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "ofter": [24, 31], "og": 39, "ol": [0, 13, 17, 19, 26, 32, 34, 36], "old": [1, 5, 10, 13, 15, 18, 36, 37, 39], "old_ma": [], "oliph": [], "ols_paramet": 16, "ols_sk": 6, "ols_svd": 6, "olsbeta": 33, "olstheta": [0, 5], "omega": [2, 3, 6], "omega_0": 3, "omit": [0, 5, 31, 32, 33, 35], "onc": [1, 6, 9, 11, 13, 20, 35, 36, 39], "one": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 19, 20, 21, 23, 24, 25, 26, 28, 29, 31, 32, 34, 35, 36, 37], "one_hot": [36, 37], "one_hot_predict": 21, "onehot": [1, 39], "onehot_vector": [1, 39], "onehotencod": 9, "ones": [0, 2, 5, 6, 8, 9, 10, 11, 13, 16, 18, 21, 22, 24, 25, 31, 32, 33, 34, 35, 36, 38], "ones_lik": 4, "ong": 32, "onl": 3, "onli": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "onlin": [11, 15, 20, 27, 34, 38, 39], "onto": [5, 11, 32, 33], "open": [0, 1, 4, 6, 7, 9, 15, 23, 25, 27, 29, 31, 35, 36, 37, 39], "oper": [0, 1, 3, 5, 6, 10, 11, 12, 13, 15, 16, 21, 22, 23, 28, 31, 32, 33, 34, 35, 37, 39], "operation": 28, "oplu": 28, "opmiz": [13, 34], "opportun": 0, "oppos": [6, 13], "opposit": [1, 5, 8, 32, 33, 39], "opt": [1, 5, 25, 26, 31, 33, 39], "optim": [0, 2, 3, 4, 5, 6, 7, 9, 10, 11, 14, 16, 17, 19, 21, 22, 25, 26, 35], "optimis": [1, 3, 39], "option": [0, 1, 3, 5, 6, 8, 11, 15, 18, 24, 32, 34, 35, 39], "optmiz": [1, 8, 13, 32, 39], "oral": 31, "orang": 0, "order": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 15, 19, 21, 24, 25, 26, 28, 31, 32, 33, 35, 36, 37, 38, 39], "ordinari": [0, 2, 3, 7, 11, 13, 17, 18, 23, 35, 36, 37], "oreilli": [30, 31], "org": [0, 3, 4, 16, 20, 21, 23, 24, 25, 26, 30, 31, 32, 33, 34, 38], "organ": [6, 7, 10, 24, 35, 36], "orgin": 38, "orient": [1, 5, 28, 32, 33], "origin": [0, 3, 5, 6, 8, 11, 12, 13, 15, 24, 31, 32, 33, 34, 35, 36, 37], "orthogn": [5, 32, 33], "orthogon": [0, 5, 6, 8, 11, 13, 24, 31, 32, 33], "orthonorm": [5, 32, 33], "os": [29, 31], "oscar": [1, 39], "oscil": [3, 13, 34], "oskar": 31, "oskarlei": 31, "osl": 18, "oslo": [0, 23, 25, 26, 27, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "osx": [0, 23, 25, 31], "other": [0, 1, 2, 3, 5, 6, 7, 8, 10, 13, 14, 16, 19, 21, 22, 23, 27, 28, 29, 30, 32, 33, 34, 35, 36], "otherwis": [0, 1, 4, 7, 13, 24, 26, 31, 34, 36, 37, 39], "ouput": [5, 7, 12, 35, 36], "our": [1, 2, 3, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 19, 21, 23, 24, 28, 34, 35, 38], "ourmodel": 0, "ourselv": [0, 5, 6, 8, 11, 13, 31, 32, 33, 35], "out": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 21, 22, 23, 24, 25, 26, 28, 31, 32, 34, 35, 36, 37, 38, 39], "out_deriv": 39, "out_fil": 9, "outcom": [0, 7, 9, 10, 12, 28, 32, 36, 37], "outdoor": 9, "outer": [6, 12, 13], "outfil": 4, "outlier": [0, 8, 31, 32, 34], "outlin": [6, 10, 11, 35, 36], "outlook": 9, "outperform": [10, 34], "output": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 19, 21, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37], "output_bia": [1, 39], "output_bias_gradi": [1, 38, 39], "output_func": 39, "output_nod": 39, "output_shap": 4, "output_weight": [1, 39], "output_weights_gradi": [1, 38, 39], "outputlayer1": [12, 37], "outputlayer2": [12, 37], "outsid": [4, 22], "over": [0, 1, 3, 4, 5, 6, 9, 10, 12, 13, 15, 16, 19, 22, 24, 25, 31, 32, 33, 34, 35, 36], "over1": 13, "overal": [1, 10, 34, 39], "overcast": 9, "overcom": [12, 13, 37, 38], "overdetermin": [0, 31], "overfit": [0, 1, 3, 6, 9, 10, 13, 26, 34, 35, 36, 39], "overflow": [5, 34, 35], "overflowerror": 39, "overhead": [12, 38, 39], "overlap": [3, 7, 8, 9, 37], "overleaf": [20, 25, 26], "overlin": [0, 5, 6, 9, 10, 11, 14, 24, 31, 32, 34], "overshoot": 34, "overst": 0, "overtrain": 4, "overview": [3, 20], "overwritten": 39, "own": [4, 5, 6, 8, 12, 13, 16, 18, 22, 23, 24, 33, 34, 35, 38, 39], "owner": [], "ownmsepredict": 0, "ownmsetrain": 0, "ownridgebeta": 32, "ownridgetheta": [0, 6, 32, 33, 34], "ownypredictridg": 0, "ownytilderidg": 0, "ox": [], "oxid": [], "p": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 24, 28, 31, 32, 33, 34, 35, 36, 37, 39], "p0": 2, "p1": 2, "p_": [2, 4, 8, 9], "p_hidden": 2, "p_i": [5, 28], "p_j": 28, "p_n": 28, "p_output": 2, "p_x": 28, "pa": 38, "pack": [0, 31], "packag": [0, 1, 3, 4, 5, 8, 11, 13, 15, 20, 22, 23, 25, 26, 28, 32, 33, 34, 39], "packtpub": 31, "packtpublish": 31, "pad": [3, 4], "page": [0, 23, 25, 26, 31, 33, 34, 35, 36], "pai": [0, 1, 9, 13, 15, 34, 39], "pair": [0, 2, 3, 9, 23, 28, 31], "paltform": 15, "panda": [0, 4, 5, 6, 7, 9, 11, 23, 25, 33, 34, 35, 36, 37], "pandoc": [], "panel": 31, "paper": [1, 34], "paper_fil": 34, "paradigm": [0, 31], "paragraph": 20, "parallel": [10, 13, 23, 24, 31], "param": 2, "paramat": 2, "paramet": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 16, 17, 18, 19, 21, 22, 25, 26, 28, 33, 34, 35], "parameter": [0, 6, 10, 31, 32], "parametr": [0, 6, 31, 32, 35, 36], "paramt": [3, 5, 35, 38], "parent": 38, "parser": 26, "part": [0, 1, 3, 5, 6, 10, 17, 19, 20, 21, 22, 24, 27, 28, 29, 31, 32, 35], "partial": [0, 1, 5, 6, 7, 8, 10, 11, 12, 13, 16, 21, 28, 31, 32, 33, 34, 36, 37, 38, 39], "particip": [15, 23, 27, 29, 31], "particl": [0, 4, 13, 28, 31], "particular": [0, 1, 2, 3, 5, 6, 9, 10, 11, 12, 13, 16, 25, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "particularli": [5, 6, 8, 11, 13, 28, 32, 33, 34, 35, 36], "partit": [1, 4, 9, 39], "partli": [6, 31], "partner": [15, 25, 26], "pass": [2, 3, 12, 14, 21, 34, 38], "password": [25, 26], "past": [10, 28, 34], "patch": [6, 28, 35], "path": [0, 4, 6, 7, 9, 23, 31, 34, 35, 36], "pathcollect": 17, "patholog": [], "patient": [7, 36, 37], "patter": 4, "pattern": [0, 3, 4, 12, 30, 31, 34, 37, 38], "paul": [], "pauli": [0, 31], "pav": [], "pc": [11, 15, 23], "pca": [0, 7, 23, 31, 32, 37], "pd": [0, 4, 5, 6, 7, 9, 11, 31, 32, 33, 34, 35, 36, 37], "pde": 2, "pdf": [0, 3, 4, 5, 6, 9, 15, 16, 19, 20, 25, 26, 30, 31, 35], "pedagog": [0, 31, 32], "penal": [6, 18, 32, 34], "penalti": [6, 13, 18, 25, 32, 34], "penros": [5, 6], "pentagon": [13, 33], "peopl": [1, 9, 13, 23, 25, 26, 34, 39], "per": [0, 1, 6, 21, 26, 27, 29, 31, 34, 35, 36, 37, 39], "perc_print": 39, "percentag": [10, 11, 29, 39], "perceptron": [0, 1, 7, 31, 36], "peregrin": 31, "perez": [], "perfect": [0, 1, 13, 31, 34, 39], "perfectli": [4, 6, 35, 36], "perform": [0, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 14, 16, 18, 19, 21, 22, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38], "performac": 4, "perhap": [0, 5, 13, 31, 32, 33, 34], "perimet": 1, "period": [1, 4, 28, 39], "permiss": 15, "permit": [], "permut": 11, "persist": 13, "person": [5, 6, 7, 16, 20, 27, 29, 31, 32, 36], "perspect": 30, "pertin": [12, 26, 31, 38, 39], "petal": [8, 9], "peter": [30, 32], "petersen": [38, 39], "phantom": 28, "phase": [6, 12, 37, 38], "phenomena": 28, "phenomenon": 34, "phi": 8, "phi_k": 8, "philipp": [38, 39], "philosophi": 13, "phone": [29, 31], "photo": [4, 31], "php": [25, 26], "phrase": [0, 31], "physic": [0, 1, 4, 7, 12, 13, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "pi": [2, 3, 5, 6, 7, 9, 12, 13, 28, 35, 36, 37, 39], "pick": [1, 9, 10, 11, 13, 14, 25, 26, 34, 39], "pickl": 1, "pictur": [0, 31], "pie": [23, 31], "piec": [11, 14, 21], "pierr": [], "pillow": [0, 23, 25, 31], "pinv": [5, 6, 13, 25, 32, 33, 34, 37], "pip": [0, 1, 15, 23, 25, 31, 39], "pip3": [0, 1, 25, 31, 39], "pipelin": [0, 6, 8, 10, 32, 35, 36], "pippin": 31, "pit": 4, "pitfal": [6, 32], "pitt": [12, 37, 38], "pixel": [1, 3, 4, 26, 31, 39], "pixel_height": [1, 3, 39], "pixel_width": [1, 3, 39], "pkg_resourc": [], "pkgutil": [], "place": [0, 4, 6, 8, 13, 15, 24, 25, 31, 33, 35], "plai": [0, 3, 4, 5, 6, 8, 11, 18, 22, 23, 25, 31, 32, 33, 35, 36, 38, 39], "plain": [8, 10, 12, 13, 14, 25, 26, 33, 34, 38, 39], "plan": [6, 9, 29, 30, 31, 39], "plane": [8, 9], "plateau": [5, 33, 34], "platform": [23, 31], "plausibl": [12, 37, 39], "pleas": [13, 25, 26, 29, 31], "plenti": [1, 39], "plethora": [3, 12, 37, 38], "pliahhy2ibx9hdharr6b7xevztgzra1p": [37, 38, 39], "plot": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 20, 21, 23, 24, 25, 26, 28, 31, 32, 33, 34, 37, 39], "plot_all_sc": [25, 32], "plot_confusion_matrix": [7, 10, 37], "plot_count": 6, "plot_cumulative_gain": [7, 10, 37], "plot_data": 1, "plot_dataset": 8, "plot_decision_boundari": [9, 10], "plot_import": 10, "plot_iris_dataset": 21, "plot_max": 4, "plot_min": 4, "plot_model": 4, "plot_numb": 4, "plot_predict": 8, "plot_regression_predict": 9, "plot_result": 4, "plot_roc": [7, 10, 37], "plot_surfac": [2, 6, 13], "plot_train": 9, "plot_tre": [9, 10], "plqvvvaa0qudcjd5baw2dxe6of2tius3v3": [37, 38, 39], "plt": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 19, 21, 22, 24, 28, 31, 32, 33, 34, 35, 36, 37, 39], "plu": [0, 3, 5, 7, 18, 31, 32, 36], "plugin": [], "pm": [8, 35], "pmatrix": 2, "pml": 30, "pn": 3, "png": [0, 4, 6, 7, 9, 31, 35, 36], "point": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13, 14, 18, 19, 20, 24, 25, 28, 29, 31, 32, 33, 34, 35, 36, 37, 39], "point_1": 4, "point_2": 4, "poisson": [23, 28, 31], "poli": [6, 8, 35, 36], "poly100_kernel_svm_clf": 8, "poly3": 0, "poly3_plot": 0, "poly_degre": 39, "poly_featur": [8, 9, 15], "poly_features10": 9, "poly_fit": 9, "poly_fit10": 9, "poly_kernel_svm_clf": 8, "poly_model": 15, "poly_ms": 15, "poly_predict": 15, "polydegre": [0, 5, 6, 10, 32, 35, 36], "polygon": [13, 33], "polym": [12, 37, 38], "polymi": 25, "polynomi": [0, 5, 6, 7, 8, 9, 10, 11, 15, 17, 19, 20, 25, 26, 31, 32, 34, 35, 36, 37, 38], "polynomial_featur": [6, 15, 16, 17, 35, 36], "polynomial_svm_clf": 8, "polynomialfeatur": [0, 6, 8, 9, 15, 16, 19, 32, 35, 36], "polytrop": [0, 6, 35, 36], "pool": 3, "pool_siz": 3, "poor": [1, 13, 33, 34, 39], "poorli": [0, 32], "popul": [0, 5, 31, 32], "popular": [0, 1, 3, 6, 7, 8, 9, 11, 12, 15, 23, 24, 25, 28, 32, 36, 37, 39], "popularli": [0, 31], "portabl": 10, "portion": [11, 13, 34], "pose": [0, 4, 5, 6, 11, 28, 31, 35], "posit": [0, 1, 2, 3, 5, 7, 8, 10, 11, 13, 14, 21, 24, 28, 31, 32, 33, 34, 36, 37, 39], "possibl": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 21, 23, 24, 25, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "possibli": [6, 8, 13, 25], "post": [], "posterior": 5, "postpon": [0, 32], "postscript": [25, 26], "postul": 5, "potenti": [0, 3, 5, 6, 12, 13, 32, 34, 35, 37, 38], "pott": [12, 37, 38], "power": [0, 1, 5, 6, 8, 9, 12, 13, 31, 32, 33, 34, 35, 36, 37, 38, 39], "pp": [5, 6, 19, 35, 38, 39], "practic": [0, 5, 6, 7, 8, 16, 18, 19, 21, 25, 26, 28, 32, 35, 36, 37], "practition": [0, 1, 3, 31, 34, 39], "pre": 31, "preambl": [], "precalcul": 38, "preced": [1, 11, 12, 28, 37, 39], "preceed": [4, 39], "preceq": 8, "precis": [0, 2, 5, 11, 13, 24, 25, 26, 28, 31, 32, 34, 35, 38], "pred": [6, 35, 36, 37], "pred_train": 39, "pred_val": 39, "predicit": 0, "prediciton": 39, "predict": [0, 1, 5, 6, 7, 8, 9, 10, 15, 16, 17, 19, 22, 23, 25, 26, 30, 31, 32, 33, 34, 35, 36, 37, 39], "predict_prob": [1, 36, 37, 39], "predict_proba": [7, 10, 37], "predictedlabel": [36, 37], "predictor": [0, 5, 6, 7, 9, 10, 11, 31, 32, 34], "prefer": [0, 1, 6, 8, 9, 11, 13, 15, 20, 23, 25, 26, 31, 39], "prefil": [], "prepar": [0, 6, 24, 25, 26, 31, 32], "preprocess": [0, 4, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 25, 35, 36, 37, 39], "prerequisit": 0, "prescript": [25, 26], "presenc": 13, "present": [0, 5, 6, 7, 9, 12, 13, 24, 25, 26, 28, 31, 32, 33, 34, 37, 38, 39], "preserv": [3, 11, 24], "press": [13, 15, 30, 33, 38, 39], "pretrain": [1, 4, 39], "pretti": [0, 4, 8, 9, 21, 23, 25, 31], "prettier": [], "prev_centroid": 14, "prevent": [13, 28, 34], "previou": [0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 15, 16, 21, 22, 24, 25, 26, 28, 32, 33, 34, 37, 38, 39], "previous": [2, 3, 9, 10, 28], "price": [0, 4, 9, 13, 34], "primal": 8, "primari": [0, 7, 31, 36, 37], "prime": 28, "princip": [0, 5, 7, 23, 31, 32, 33, 37], "principl": [0, 6, 7, 8, 14, 31, 35, 36, 37], "print": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 18, 21, 22, 24, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "print_funct": [8, 9], "print_length": 39, "printout": [0, 31], "prior": [0, 5, 6, 31], "privat": 0, "pro": 26, "prob": [1, 28, 36, 37], "probabilist": [0, 30, 31, 32], "probabl": [0, 1, 3, 4, 6, 7, 10, 13, 21, 23, 31, 32, 34, 36, 37, 39], "problem": [0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 17, 23, 24, 25, 26, 28, 35], "probml": 30, "proce": [0, 5, 6, 7, 8, 9, 10, 11, 13, 24, 31, 32, 35, 38], "procedur": [2, 4, 5, 6, 8, 10, 11, 13, 32, 33, 34, 35, 36], "proceed": 24, "process": [0, 2, 4, 6, 9, 10, 12, 13, 23, 24, 25, 28, 30, 31, 33, 34, 35, 36, 37, 38], "procur": [], "prod": 30, "prod_": [1, 5, 7, 35, 36, 37, 39], "produc": [0, 3, 4, 5, 6, 9, 10, 11, 12, 13, 18, 20, 23, 24, 25, 26, 28, 31, 32, 35, 37, 38], "product": [0, 1, 3, 5, 6, 7, 8, 12, 13, 16, 17, 23, 24, 31, 32, 34, 35, 36, 37, 38, 39], "profess": [0, 31], "profit": [], "progag": 26, "program": [0, 1, 4, 5, 6, 8, 12, 14, 15, 23, 24, 27, 28, 29, 31, 32, 37, 39], "programm": 24, "progress": [1, 4, 14, 34, 36, 37, 39], "prohibit": [6, 35, 36], "project": [0, 1, 2, 3, 5, 11, 13, 15, 19, 22, 23, 27, 32, 33, 34, 35, 36, 37, 39], "project_root_dir": [0, 6, 7, 9, 31, 35, 36], "promin": [12, 37, 38], "promis": 8, "promot": [29, 31], "prompt": 20, "prone": [9, 15, 21, 38], "pronounc": [13, 23, 31, 34], "proof": [0, 11, 12, 13, 31, 33, 35, 36, 38], "prop": [26, 34, 39], "prop_cycl": [], "propag": [2, 3, 13, 21, 22, 26, 34], "proper": [0, 2, 6, 7, 20, 35, 36], "properli": [1, 6, 8, 10, 13, 18, 20, 25, 26, 34, 39], "properti": [0, 1, 3, 12, 13, 16, 24, 31, 35, 37, 39], "propgag": 38, "proport": [0, 1, 5, 9, 11, 13, 28, 31, 32, 39], "propos": [1, 4, 6, 10, 25, 26, 31, 34, 39], "propto": [5, 13, 33, 34], "proton": [0, 31], "prove": [3, 13, 33, 34], "provid": [0, 1, 3, 4, 5, 6, 8, 9, 10, 12, 13, 20, 21, 22, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 38, 39], "proxi": [1, 13, 34, 39], "prune": 9, "pseudo": [24, 28, 34], "pseudocod": [25, 26], "pseudoinv": 5, "pseudoinvers": [5, 6, 25], "pseudorandom": [6, 28, 35], "psychologi": [0, 31], "pt": 13, "public": [0, 15, 23, 31], "publish": [38, 39], "pull": 15, "punish": [0, 1, 31, 39], "pure": [3, 9, 28], "purest": 9, "puriti": 9, "purpos": [0, 3, 10, 12, 14, 21, 31, 37, 38], "push": 15, "put": [1, 20, 25, 26, 34], "putmask": [], "py": 5, "pybtex": [], "pycod": 31, "pydata": 23, "pydevd_extension_api": [], "pydevd_plugin": [], "pydevd_plugin_plugin_nam": [], "pydot": 9, "pygment": [], "pyhton2": 31, "pylab": [7, 31, 36], "pypi": 23, "pyplot": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 19, 21, 22, 24, 28, 31, 32, 33, 34, 35, 36, 37, 39], "pythagora": 5, "python": [1, 2, 3, 5, 6, 8, 11, 12, 13, 14, 18, 20, 21, 22, 25, 26, 28, 32, 34, 38, 39], "python2": [0, 25], "python3": [0, 23, 25, 31], "pythonpath": [], "pytorch": [0, 23, 25, 26, 31, 38, 39], "pyzmq": [], "q": [5, 6, 8, 11, 28, 35, 39], "qp": 8, "qquad": [2, 11, 13, 24, 34], "qr": [5, 6, 24, 32, 33], "quad": [1, 13, 24, 39], "quadrat": [0, 8, 9, 13, 31], "qualit": [4, 9, 25, 26, 28], "qualiti": [0, 9, 23, 31, 32, 38], "quantifi": [1, 39], "quantil": 10, "quantit": [0, 6, 9, 25, 26, 31, 35, 36], "quantiti": [0, 2, 5, 6, 7, 9, 10, 11, 12, 14, 16, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "quantum": [4, 12, 30, 31, 37, 38], "quartil": [0, 32, 34], "quasi": 38, "quench": 5, "queri": 9, "question": [0, 5, 6, 9, 11, 12, 13, 25, 26, 29, 31, 32, 34, 35, 38, 39], "qugan": 4, "quick": [4, 28], "quicker": 34, "quickli": [1, 3, 9, 11, 13, 33, 34, 39], "quit": [1, 5, 6, 9, 10, 12, 15, 22, 32, 33, 35, 36, 37, 39], "quot": 4, "r": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 23, 24, 25, 28, 32, 33, 34, 35, 36, 37, 38, 39], "r2": [0, 5, 6, 19, 31, 32, 33], "r2_score": [0, 31], "r2score": [0, 31], "r_": 34, "r_0": 34, "r_1": 9, "r_2": 9, "r_j": 9, "r_m": 9, "r_t": 34, "rad": [], "rade": [], "radial": [8, 12, 37, 38], "radioact": 28, "radiu": [0, 1, 32, 34], "radziej": [], "ragan": [], "rain": 9, "rais": 39, "ram": 34, "ramanujam": [], "ramp": [1, 39], "ran0": 28, "ran1": 28, "ran2": 28, "ran3": 28, "rand": [0, 4, 5, 6, 9, 10, 13, 15, 19, 21, 22, 24, 31, 32, 33, 34, 35, 36, 39], "randint": [6, 9, 13, 34, 35], "randn": [0, 1, 2, 5, 6, 9, 11, 13, 15, 18, 21, 22, 31, 32, 33, 34, 35, 36, 37, 38, 39], "random": [0, 1, 2, 3, 4, 5, 6, 8, 9, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39], "random_forest_model": 10, "random_index": [13, 34], "random_indic": [1, 3, 39], "random_st": [7, 8, 9, 10, 11, 26, 36, 37], "randomforestclassifi": 10, "randomli": [1, 6, 9, 13, 14, 18, 33, 34, 35, 36, 39], "randomst": [36, 37], "rang": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 18, 19, 21, 22, 24, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "rangl": [0, 6, 11, 28, 31, 32], "rangle_x": 28, "rank": [5, 32, 33], "rankdir": 4, "raphson": [1, 8, 13, 39], "rapidli": [0, 34], "rare": [1, 13, 34, 39], "raschka": [26, 31, 32, 35, 36, 37], "rasckha": 31, "rashcka": [33, 34, 38, 39], "rashkca": [38, 39], "rate": [1, 2, 3, 4, 8, 9, 10, 12, 13, 18, 26, 33, 35, 36, 37, 38], "rather": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 24, 28, 31, 32, 33, 35, 36, 38, 39], "ratio": [4, 7, 9, 10, 11, 36, 37], "rational": [0, 31], "ravel": [5, 6, 7, 8, 9, 10, 11, 13, 24, 35, 36, 37, 39], "raw": [3, 34], "rbf": [8, 11, 12, 37, 38], "rbf_kernel_svm_clf": 8, "rbf_pca": 11, "rc": 28, "rcond": [0, 31, 32], "rcparam": [1, 3, 7, 8, 9, 10, 28, 31, 36, 39], "re": [2, 4, 13, 15, 33], "reach": [1, 4, 5, 6, 9, 10, 12, 13, 14, 33, 34, 35, 36, 38, 39], "react": [], "read": [0, 2, 3, 4, 5, 6, 7, 8, 11, 12, 16, 17, 19, 20, 24, 25, 26, 28, 30, 33], "read_csv": [0, 6, 7, 9, 35, 36], "read_fwf": [0, 31], "reader": [0, 6, 20, 24, 28, 31, 32, 34], "readi": [0, 1, 5, 6, 8, 10, 11, 12, 24, 31, 38, 39], "readili": [1, 39], "readm": [15, 20, 25, 26], "readthedoc": 23, "real": [0, 1, 4, 7, 10, 11, 12, 16, 18, 19, 24, 32, 35, 36, 37, 39], "real_loss": 4, "real_output": 4, "realist": [8, 31], "realiti": 28, "realiz": [1, 12, 37, 39], "realli": [0, 1, 31, 39], "rearrang": 13, "reason": [0, 1, 3, 4, 10, 13, 30, 31, 33, 34, 39], "reassign": 1, "reat": 39, "reber": 39, "recal": [5, 6, 9, 10, 11, 12, 22, 24, 28, 31, 32, 33, 34, 35, 36, 38, 39], "recarrai": [], "recast": 3, "receiv": [1, 3, 10, 12, 28, 37, 38, 39], "recent": [0, 6, 13, 30, 34, 35, 36, 38, 39], "recept": [3, 12, 37, 38], "receptive_field": 3, "recip": [0, 6, 7, 24, 25, 26, 31, 32, 36, 37], "reciproc": 5, "recogn": [0, 4, 5, 10, 31, 35], "recognit": [0, 1, 3, 12, 30, 31, 37, 38, 39], "recommen": 31, "recommend": [0, 2, 3, 4, 5, 6, 8, 13, 15, 19, 20, 21, 22, 23, 24, 25, 26, 30, 33, 34, 35, 36, 37, 38], "reconsid": 9, "reconstruct": 11, "record": [10, 25, 26, 27, 29, 31, 36, 37], "recreat": [15, 21], "rectangl": [9, 13, 33], "rectangular": [5, 32, 33], "rectifi": [1, 3, 12, 37, 39], "recur": [0, 23, 31], "recurr": [0, 1, 23, 31, 39], "recurs": [9, 23, 24, 31], "red": [0, 3, 4, 6, 8, 9, 34, 35], "redefin": [0, 10, 31, 32, 33], "redefinit": 33, "redistribut": [], "reduc": [1, 3, 5, 6, 9, 10, 11, 13, 21, 31, 33, 34, 35, 39], "reduct": [0, 10, 11, 23, 28, 31, 32], "reegress": 25, "ref": 20, "refer": [0, 1, 2, 3, 5, 6, 11, 12, 13, 14, 20, 24, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "referansestil": 20, "referenc": [2, 38, 39], "refin": [12, 37, 38], "refit": [6, 35, 36], "reflect": [0, 1, 4, 5, 25, 26, 28, 31, 39], "refresh": [23, 31], "refreshprogrammingskil": 31, "reg": [10, 11], "regard": [1, 9, 13, 39], "regardless": [12, 16, 37, 39], "regexp": [], "reggi": [], "regim": 34, "region": [3, 4, 6, 9, 12, 25, 34, 37, 38], "regist": [6, 28], "reglasso": [5, 33], "regr_1": [0, 9], "regr_2": [0, 9], "regr_3": [0, 9], "regress": [1, 8, 11, 12, 16, 20, 23, 24, 38, 39], "regressor": [0, 7, 10, 36, 39], "regret": [], "regridg": [0, 5, 6, 32, 33, 34], "regular": [0, 3, 4, 5, 6, 7, 9, 13, 17, 18, 26, 29, 31, 32, 33, 34, 35, 36, 37], "regularli": 15, "reilli": [0, 30, 31], "reinforc": [0, 8, 23, 31], "reiniti": 39, "reiter": 1, "reitz": [], "reject": 7, "rel": [0, 4, 6, 7, 9, 12, 13, 21, 28, 31, 32, 34, 35, 36, 37, 39], "relat": [0, 1, 3, 4, 5, 11, 13, 14, 19, 24, 28, 31, 32, 33, 35, 38, 39], "relationship": [0, 4, 9, 18, 31], "relativeerror": [0, 31, 32], "releas": [1, 23, 31, 39], "relev": [0, 1, 5, 7, 11, 23, 25, 26, 28, 31, 33, 34], "reli": [0, 6, 8, 34], "reliabilti": [25, 26], "reliabl": [7, 28, 36, 37], "relu": [3, 4, 21, 22, 26, 31], "relu_d": 22, "remain": [1, 2, 4, 6, 12, 24, 28, 32, 34, 35, 36, 37, 38, 39], "remaind": 28, "reman": 2, "remark": [1, 39], "rememb": [0, 8, 13, 20, 21, 22, 24, 25, 26, 31, 34], "remind": [0, 5, 11, 13, 19, 24, 28, 35], "remot": 15, "remov": [4, 5, 6, 18, 32, 33, 34], "renam": 15, "render": [0, 31, 32], "reorder": [5, 7, 32, 33, 36, 37], "reorgan": [0, 31], "repeat": [0, 1, 3, 4, 5, 6, 9, 10, 11, 13, 14, 24, 25, 28, 31, 32, 33, 34, 35, 36, 38, 39], "repeated": 31, "repeatedli": [0, 6, 10, 13, 35, 36], "repet": 3, "repetit": [6, 31, 32, 35, 36], "rephras": [13, 33], "replac": [0, 1, 3, 4, 5, 6, 10, 12, 14, 23, 25, 31, 32, 33, 35, 36, 38, 39], "replica": [6, 35], "repo": [15, 25, 26], "report": [31, 34, 36, 37], "repositori": [4, 20, 25, 26, 31], "reposotori": [], "repres": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "represent": [0, 1, 3, 6, 28, 31, 35, 36, 39], "representd": 3, "reproduc": [0, 5, 6, 9, 12, 15, 16, 18, 20, 23, 25, 26, 28, 31, 32, 38, 39], "repuls": [0, 31], "request": [0, 13, 34], "requir": [0, 1, 3, 4, 5, 6, 8, 9, 11, 12, 13, 15, 17, 18, 19, 20, 24, 25, 31, 32, 33, 34, 35, 36, 37, 38, 39], "rerun": 39, "res1": 2, "res2": 2, "res3": 2, "res_analyt": 2, "res_analytical1": 2, "res_analytical2": 2, "res_analytical3": 2, "resaml": 6, "resampl": [0, 7, 10, 23, 31, 32, 39], "rescal": [0, 11, 12, 34, 37], "rescu": 5, "reseach": 6, "research": [0, 4, 13, 21, 22, 23, 26, 30, 31, 34], "researchg": 26, "resembl": [6, 28, 35], "reserv": [1, 5, 6, 28, 35, 36, 39], "reset": 39, "reset_weight": 39, "reshap": [0, 1, 2, 3, 4, 6, 8, 9, 10, 24, 31, 32, 35, 36, 39], "resid": 34, "residenti": [], "residu": [0, 5, 13, 31], "resiz": [5, 32, 33], "resnet": 34, "resort": 34, "resourc": [31, 34], "respect": [0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 21, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "respond": [12, 37, 38], "respons": [0, 7, 9, 12, 31, 32, 36, 37, 38], "rest": [0, 5, 18, 21, 22, 32, 33, 34], "restat": [0, 12, 31], "restor": 4, "restored_discrimin": 4, "restored_gener": 4, "restrict": [0, 3, 9, 12, 31, 37, 38, 39], "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 31, 34, 35, 36, 37], "retail": [], "retain": [5, 6, 32, 33, 34, 35, 36], "rethink": 35, "return": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 16, 17, 21, 22, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "return_data": 14, "return_sequ": 4, "return_x_i": 9, "reus": [1, 3, 6, 19, 20, 22, 25, 26, 38, 39], "reveal": [0, 12, 31, 37, 38], "revers": [1, 22, 24, 39], "review": [23, 24], "revis": [], "revisit": 14, "revolut": 31, "reward": [0, 4, 31], "rewrit": [0, 3, 5, 6, 7, 8, 10, 11, 12, 13, 16, 19, 24, 25, 28, 33, 34, 36, 37, 38, 39], "rewritten": [2, 6, 8, 10, 28, 35], "rewrot": [13, 36, 37], "rf": 10, "rgb": 3, "rgoj5yh7evk": 23, "rh": [6, 35], "rho": [0, 10, 13, 34, 39], "rho2": 39, "rho_1": 10, "rho_2": 10, "rho_m": 10, "rich": [0, 31], "rid": [], "ride": 9, "rideclass": 9, "ridedata": 9, "ridg": [7, 11, 13, 20, 23, 26, 31, 35, 36, 37], "ridge_paramet": 17, "ridge_sk": 6, "ridgebeta": 33, "ridgetheta": 5, "right": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, 17, 19, 21, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "right_sid": 2, "rightarrow": [0, 1, 5, 6, 8, 11, 12, 13, 28, 31, 32, 33, 34, 35, 37, 38, 39], "rigor": [0, 31, 32, 33], "ring": 6, "rise": [0, 31], "risk": [0, 13, 31, 33, 34], "rival": 4, "river": [], "rlm": 31, "rm": [26, 28, 34, 39], "rms_prop": 39, "rmse": [], "rmsporp": [13, 34], "rmsprop": [1, 3, 4, 13, 25, 26, 35, 38, 39], "rnd_clf": 10, "rng": [28, 36, 37], "rnn": [4, 12, 37, 38], "rnn1": 4, "rnn2": 4, "rnn_2layer": 4, "rnn_input": 4, "rnn_output": 4, "rnn_train": 4, "rntrick1": 28, "rntrick2": 28, "rntrick3": 28, "rntrick4": 28, "ro": [0, 13, 31, 33, 34], "robert": [19, 25, 30], "robust": [0, 31, 34], "robustscal": [0, 32, 34], "roc": [7, 10], "role": [0, 2, 5, 6, 8, 18, 23, 25, 31, 32, 33, 34, 35, 36, 38, 39], "roll": 6, "ronach": [], "room": [0, 29, 31], "root": [0, 5, 9, 13, 15, 28, 32, 33, 34, 38], "root_directori": [], "rot": 31, "rotat": [1, 8, 9, 10], "rotation_matrix": 9, "roughli": [1, 3, 18, 39], "round": [7, 9, 13, 37, 39], "routin": [13, 24, 31, 33], "row": [0, 1, 2, 5, 6, 9, 11, 16, 21, 24, 31, 32, 33, 35, 39], "rr": [5, 32, 33], "rrr": [5, 32, 33], "rubric": [], "rudg": [], "rug": [13, 33, 34], "rule": [0, 1, 5, 6, 13, 22, 25, 31, 32, 33, 37], "run": [0, 1, 2, 4, 5, 6, 8, 9, 11, 13, 15, 20, 21, 22, 23, 25, 26, 31, 32, 33, 34, 35, 36, 39], "rung": 26, "runtim": [1, 6, 14, 15, 39], "rust": [0, 23, 24, 31], "rvert": [1, 39], "rvert_2": [1, 39], "s41467": 26, "s_": [3, 6], "s_1": 6, "s_i": [6, 7, 36], "s_j": 6, "s_k": 6, "s_phenomenon": 25, "saddl": [13, 33, 34], "safeguard": [18, 34], "saga": 26, "sai": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 19, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "said": [6, 9, 13, 33], "sake": [0, 5, 7, 11, 31, 32, 33, 36, 37, 38, 39], "sale": [0, 31], "sam": 31, "same": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 28, 31, 32, 33, 37, 38, 39], "samm": 10, "sampl": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 18, 19, 23, 24, 25, 28, 31, 32, 34, 35, 36, 37, 39], "sample_vari": 14, "sampleexptvari": 28, "samples_per_class": [36, 37], "samwis": 31, "sandbox": [], "sandboxmod": [21, 22], "sasha": [], "sastri": 11, "satisfactori": [0, 31], "satisfi": [1, 2, 3, 6, 8, 13, 24, 28, 33, 35, 39], "satur": [1, 6, 35, 36, 39], "save": [0, 4, 6, 7, 9, 13, 20, 22, 31, 34, 35, 36], "save_fig": [0, 6, 7, 9, 10, 31, 35, 36], "savefig": [0, 4, 6, 7, 9, 28, 31, 35, 36], "savetxt": 4, "saw": [5, 32], "scalabl": 10, "scalar": [2, 5, 6, 10, 32, 35, 38, 39], "scale": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 22, 23, 24, 25, 26, 29, 31, 33, 36, 37, 39], "scale_mean": 4, "scale_std": 4, "scaler": [0, 7, 8, 9, 10, 11, 17, 25, 32, 39], "scan": [5, 7, 36, 37], "scari": 5, "scatter": [0, 1, 6, 7, 8, 9, 14, 15, 17, 21, 31, 32, 34, 35, 36], "scenario": [6, 13, 33, 34], "schedul": [13, 34], "scheduler_arg": 39, "schedulers_bia": 39, "schedulers_weight": 39, "scheme": [1, 13, 33, 34, 36, 37, 39], "schrage": 28, "sch\u00f8yen": [6, 32, 34], "scienc": [0, 1, 10, 12, 13, 23, 27, 28, 29, 30, 33, 35, 36, 37, 38, 39], "scientif": [0, 20, 23, 25, 26, 31, 36, 37], "scientist": [0, 31], "scikit": [3, 5, 6, 8, 9, 10, 13, 15, 16, 20, 21, 23, 24, 25, 26, 30], "scikit_learn": [0, 37], "scikitlearn": 31, "scikitplot": [7, 10, 37], "scipi": [0, 3, 5, 6, 13, 23, 24, 25, 31, 32, 33, 35], "scl": 6, "scm": 15, "score": [0, 1, 3, 6, 7, 9, 10, 11, 15, 16, 19, 21, 25, 26, 29, 31, 32, 34, 35, 36, 37, 39], "scores_kfold": [6, 35, 36], "scratch": [1, 13, 16, 37, 38, 39], "script": [], "sdg": [13, 34], "sdv4f4s2sb8": [33, 34], "seaborn": [0, 1, 3, 6, 7, 26, 31, 37, 39], "seamless": [0, 23, 25, 31], "seamlessli": 39, "search": [0, 1, 3, 5, 9, 13, 15, 31, 33, 34, 39], "sebastian": [31, 38, 39], "sebastianraschka": [26, 31], "sec": 6, "second": [0, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 14, 15, 16, 20, 21, 22, 23, 24, 28, 29, 31, 32, 33, 35, 36, 37, 38, 39], "second_correct": 39, "second_mo": 34, "second_term": 34, "secondari": 34, "secondeigvector": 11, "secondli": [12, 38, 39], "section": [4, 11, 16, 20, 24, 25, 28, 32, 34, 36], "sector": 0, "see": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "seed": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 18, 20, 21, 25, 26, 28, 31, 32, 33, 34, 35, 36, 38, 39], "seed_imag": 4, "seek": [1, 2, 8, 39], "seem": [1, 3, 4, 34, 39], "seemingli": [0, 31], "seen": [0, 1, 3, 5, 10, 12, 28, 39], "segment": [13, 33, 39], "seismic": 6, "seldomli": [0, 31], "select": [1, 5, 6, 8, 9, 10, 11, 15, 20, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 39], "selevet": 15, "self": [1, 5, 22, 32, 36, 37, 39], "sell": 4, "semest": [7, 27, 37], "semi": [8, 13, 33, 34], "semilogx": 6, "send": [5, 12, 13, 21, 22, 29, 31, 37, 38], "senior": [27, 29], "sens": [0, 4, 6, 8, 21, 31, 35], "sensibl": [3, 21], "sensit": [0, 5, 6, 9, 13, 31, 32, 34, 35, 36], "sent": [2, 21, 38, 39], "sentdex": [37, 38, 39], "sentenc": [4, 12, 37, 38], "separ": [0, 1, 2, 4, 6, 8, 9, 12, 14, 18, 21, 22, 23, 25, 28, 31, 34, 35, 37, 38, 39], "septemb": [18, 25, 31], "sequenc": [3, 4, 7, 9, 10, 12, 13, 23, 24, 28, 31, 33, 36, 37, 38], "sequenti": [1, 3, 4, 10, 12, 28, 37, 38, 39], "seri": [0, 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 24, 31, 32, 33, 35, 37, 38, 39], "serif": [7, 28, 31, 36], "serv": [0, 1, 2, 3, 5, 7, 13, 26, 30, 31, 32, 33, 34, 36, 37, 39], "servic": [25, 26], "session": [1, 15, 20, 25, 26, 27, 29, 31], "set": [1, 4, 5, 6, 7, 8, 10, 11, 13, 14, 16, 17, 18, 21, 22, 23, 24, 25, 26, 28, 29, 34, 35, 36, 37], "set_major_formatt": 6, "set_major_loc": 6, "set_tick": [1, 8], "set_ticklabel": 1, "set_titl": [0, 1, 2, 3, 7, 12, 14, 31, 36, 37, 39], "set_xlabel": [0, 1, 2, 3, 7, 12, 31, 36, 37, 39], "set_xlim": [7, 12, 36, 37, 39], "set_xticklabel": 1, "set_ylabel": [0, 1, 2, 3, 7, 31, 37, 39], "set_ylim": [7, 12, 36, 37, 39], "set_ytick": [7, 37], "set_yticklabel": [1, 6], "set_zlim": 6, "seth": 4, "setminu": 6, "setosa": [8, 9], "setosa_or_versicolor": 8, "setp": [6, 35, 36], "setup": [1, 4, 6, 8, 22, 23, 26, 31, 32, 33, 38, 39], "sever": [0, 3, 5, 6, 7, 8, 9, 11, 12, 13, 16, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38], "sgd": [1, 3, 33, 39], "sgd_clf": 8, "sgdclassifi": 8, "sgdreg": 13, "sgdregressor": 13, "sgn": [5, 32, 33], "shall": [], "shallow": [13, 34], "shape": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 18, 21, 22, 24, 31, 32, 33, 34, 35, 36, 37, 38, 39], "share": [1, 3, 15, 31, 39], "share_mask": [], "shareabl": 15, "she": [7, 36, 37], "sheppard": [], "shibukawa": [], "shift": [1, 6, 12, 15, 18, 28, 32, 34, 37, 39], "ship": 3, "shire": 31, "short": [4, 5, 20, 25, 26, 39], "shortcom": [13, 33, 34], "shorten": 4, "shorter": 28, "shorthand": [31, 35], "shortli": [24, 31], "should": [0, 2, 3, 5, 6, 8, 9, 11, 12, 15, 18, 19, 20, 21, 22, 24, 25, 28, 31, 32, 34, 35, 36, 38], "shouldn": [], "show": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "show_shap": 4, "shown": [0, 4, 5, 8, 12, 13, 24, 32, 33, 34, 37, 38, 39], "shrink": [3, 5, 6, 8, 11, 32, 33, 34], "shrinkag": [5, 6, 32, 33], "shrunk": 11, "shuffl": [0, 1, 4, 6, 13, 32, 34, 35, 36, 39], "sickit": [38, 39], "side": [0, 2, 5, 8, 12, 13, 24, 25, 26, 31, 33, 36, 37, 39], "sigh": [23, 31], "sigma": [0, 1, 5, 6, 7, 10, 11, 12, 13, 19, 24, 25, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "sigma0": 28, "sigma1": 28, "sigma2": 28, "sigma_": [5, 24, 31, 32, 33, 35], "sigma_0": [5, 32, 33], "sigma_1": [5, 32, 33, 38, 39], "sigma_2": [5, 32, 33, 38, 39], "sigma_fn": [7, 12, 36, 37, 39], "sigma_i": [0, 5, 31, 32, 33], "sigma_j": [5, 32, 33], "sigma_m": [6, 28, 35], "sigma_n": [11, 28], "sigma_t": 13, "sigma_x": 28, "sigmoid": [1, 2, 4, 7, 8, 10, 12, 21, 22, 26, 36, 37, 38], "sigmoid_autograd": 22, "sigmoid_d": 22, "sigmundson": [6, 32, 34], "sign": [1, 2, 7, 8, 10, 26, 28, 29, 36, 39], "signal": [1, 3, 10, 12, 34, 37, 38, 39], "signifi": 4, "signific": [1, 34, 39], "significantli": [1, 13, 18, 28, 33, 34, 39], "sim": [4, 5, 6, 13, 19, 28, 35], "similar": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 18, 23, 24, 25, 26, 31, 33, 35, 36, 37, 38, 39], "similarli": [0, 1, 3, 5, 8, 10, 13, 28, 31, 32, 33, 34, 38, 39], "similiar": 39, "simpl": [1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 14, 16, 17, 22, 23, 24, 26, 28, 35, 37], "simple_plot": [], "simplefilt": 39, "simplepredict": 10, "simpler": [0, 1, 5, 6, 7, 13, 16, 23, 25, 26, 31, 33, 34, 39], "simplernn": 4, "simplest": [0, 1, 3, 4, 9, 10, 12, 14, 25, 31, 37, 38, 39], "simpletre": 10, "simpli": [0, 1, 2, 4, 5, 6, 8, 9, 10, 11, 12, 23, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "simplic": [2, 5, 6, 7, 8, 9, 10, 11, 12, 14, 32, 33, 34, 36, 37, 38, 39], "simplicti": [5, 32, 33], "simplif": 38, "simplifi": [0, 6, 9, 18, 22, 23, 25, 31, 32, 34, 35, 36, 38], "simplist": [3, 6, 28, 35], "simul": [6, 18, 34, 35, 36], "simultan": [6, 34, 35, 36], "sin": [0, 1, 2, 3, 4, 9, 12, 13, 24, 31, 37, 39], "sinc": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13, 16, 18, 21, 22, 24, 25, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "sine": [3, 12, 37, 39], "singl": [0, 1, 2, 3, 5, 6, 7, 8, 9, 12, 13, 18, 19, 21, 22, 24, 28, 31, 32, 33, 34, 35, 36, 39], "singular": [0, 6, 13, 24, 31, 35], "sinusoid": 3, "site": [0, 25, 26, 27, 32], "situat": [0, 4, 5, 7, 13, 28, 31, 32, 33, 34, 36, 37], "six": [3, 28, 38], "size": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 18, 20, 21, 24, 25, 28, 31, 35, 36, 37, 38, 39], "sizesp": 34, "skeleton": 22, "sketch": 10, "ski": 9, "skill": 0, "skip": 11, "skl": [0, 6, 31, 32, 34], "sklearn": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 17, 19, 20, 21, 22, 26, 31, 32, 33, 34, 35, 36, 37, 39], "skplt": [7, 10, 37], "skrankefunct": 39, "sl": [6, 32, 34], "slack": 8, "slender": [], "slice": [2, 24, 31], "slide": [0, 3, 16, 25, 26, 28, 31, 32, 33, 38, 39], "slight": [6, 13, 35, 36], "slightli": [1, 2, 3, 5, 6, 7, 10, 28, 32, 33, 35, 36, 37, 38, 39], "slope": [8, 11, 12, 37], "slow": [0, 2, 8, 13, 18, 32, 33, 34], "slower": [5, 24, 31, 32, 33, 34], "slowest": 24, "slowli": [12, 34], "slp": [1, 39], "small": [0, 1, 2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 18, 21, 22, 23, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "smaller": [0, 1, 2, 5, 6, 8, 9, 11, 13, 21, 28, 31, 32, 33, 34, 35, 36, 39], "smallest": [0, 4, 14, 31], "smallest_row_index": 14, "smodin": [], "smooth": [0, 3, 6, 13, 25, 31, 33, 34], "smoother": 34, "sn": [0, 1, 3, 6, 7, 31, 37, 39], "sne": 11, "so": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "soar": 6, "social": 0, "soft": [1, 7, 10, 12, 36, 37, 38, 39], "soften": 8, "softmax": [3, 7, 21, 22, 26, 36, 37], "softmax_vec": 21, "softwar": [0, 8, 23, 24, 38], "sokogskriv": 20, "sol": 8, "sol1": 21, "sole": [0, 6, 31], "solid": [0, 7, 36, 37], "solut": [0, 1, 2, 3, 5, 6, 8, 10, 11, 13, 18, 21, 24, 25, 26, 28, 31, 32, 33, 34, 35, 39], "solution_ev": 34, "soluton": 2, "solv": [0, 1, 3, 5, 6, 8, 10, 11, 12, 13, 16, 24, 25, 26, 31, 32, 38, 39], "solve_expdec": 2, "solve_ode_deep_neural_network": 2, "solve_ode_neural_network": 2, "solve_pde_deep_neural_network": 2, "solveod": 2, "solveode_popul": 2, "solver": [2, 7, 8, 9, 10, 24, 26, 31, 37], "some": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 19, 21, 22, 25, 26, 28, 31, 34, 35, 37, 39], "some_model": [6, 32, 34], "somehow": 4, "someon": 16, "someth": [0, 1, 3, 4, 7, 9, 11, 15, 19, 20, 25, 26, 28, 31, 32, 37, 39], "sometim": [0, 1, 11, 12, 13, 14, 19, 32, 34, 37, 38, 39], "somewhat": [26, 37], "soon": [24, 29, 32], "sophist": [0, 31], "sopt": 13, "sort": [5, 6, 9, 11, 28, 35, 36], "sound": [3, 5], "sourc": [0, 1, 3, 6, 23, 24, 25, 26, 28, 31, 34, 35, 36, 39], "source1": 22, "source2": 22, "space": [0, 1, 4, 5, 8, 9, 11, 12, 13, 14, 28, 32, 33, 34, 36, 37, 38, 39], "span": [0, 3, 5, 9, 11, 24, 31, 32, 33], "spare": [1, 39], "spars": [3, 6, 18, 24, 31, 34], "sparse_mtx": [24, 31], "sparsecategoricalcrossentropi": 3, "sparsiti": [10, 18], "spatial": [1, 2, 3, 12, 37, 38, 39], "speak": 28, "special": [6, 7, 10, 12, 13, 24, 28, 31, 32, 33, 34, 36, 37, 38, 39], "specif": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 16, 23, 24, 25, 26, 28, 30, 31, 32, 33, 35, 36, 37, 38, 39], "specifi": [0, 3, 5, 6, 7, 9, 11, 13, 14, 28, 31, 33, 34, 35, 36, 37, 39], "specifici": [0, 10, 31], "spectacular": 3, "spectral": 1, "speech": [0, 1, 3, 4, 12, 37, 38, 39], "speed": [1, 2, 4, 13, 39], "spend": [16, 28, 34], "spent": [25, 26], "sphere": [0, 32, 34], "sphinx": [], "sphinx_book_them": [], "sphinxcontrib": [], "spike": 34, "spin": 6, "spite": 0, "spitzer": [], "spline": 8, "split": [1, 3, 4, 5, 6, 8, 9, 10, 11, 14, 16, 17, 20, 21, 22, 25, 26, 28, 31, 33, 34, 35, 36, 39], "splite": 0, "splitter": [1, 10], "spoiler": [], "spontan": 28, "spot": 3, "spread": [0, 11, 28, 31, 32, 36, 37], "spring": 39, "springer": [19, 25, 30, 31, 35, 36], "spuriou": [13, 34], "sqquar": 33, "sqrsignal": 3, "sqrt": [3, 4, 5, 6, 8, 10, 11, 13, 28, 32, 33, 34, 35, 38, 39], "squar": [1, 2, 3, 4, 7, 8, 9, 11, 13, 14, 15, 17, 18, 23, 24, 26, 28, 35, 36, 37, 38, 39], "squarederror": 10, "squaredeuclidean": 14, "squash": [12, 37, 39], "src": [], "srtm": 6, "srtm_data_norway_1": 6, "sso": 20, "stabil": [5, 25, 26, 34, 36, 37], "stabl": [0, 4, 5, 6, 9, 16, 20, 23, 25, 31, 32, 33, 34], "stack": [3, 4], "stage": [5, 13, 15, 25, 26, 34, 38, 39], "stagnat": 34, "stai": [0, 2, 4, 5, 11, 31, 32, 34, 39], "stand": [0, 5, 9, 12, 31, 32, 33, 37], "standard": [0, 1, 4, 5, 6, 7, 8, 10, 12, 17, 18, 19, 24, 25, 26, 28, 31, 33, 34, 36, 37, 38, 39], "standardscal": [0, 6, 7, 8, 9, 10, 11, 17, 32, 34], "standpoint": 34, "stanford": [13, 33], "start": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 21, 22, 24, 26, 28, 29, 31, 32, 33, 34, 35, 36, 38, 39], "start_tim": 14, "starter": [], "stat": [6, 35], "state": [1, 2, 4, 5, 6, 7, 8, 10, 11, 12, 13, 23, 28, 31, 32, 33, 35, 36, 37, 38, 39], "statement": [0, 7, 24, 31, 37], "static": [], "stationari": [33, 34], "statist": [0, 1, 3, 4, 7, 9, 10, 11, 12, 13, 14, 19, 24, 25, 30, 32, 33, 34, 37, 38, 39], "statu": [0, 7, 15, 31, 36, 37], "stavang": 6, "stb": [], "std": [0, 4, 6, 18, 31, 32, 34, 35, 36], "stdout": 39, "steep": [13, 33, 34], "steepest": 34, "stefan": [], "step": [0, 1, 2, 4, 6, 7, 9, 10, 11, 12, 13, 14, 15, 18, 22, 24, 25, 31, 33, 37, 38, 39], "step_fn": [7, 12, 36, 37, 39], "step_length": [13, 34], "step_siz": 34, "steps_list": 9, "stereo": 3, "sticki": [], "still": [0, 2, 3, 5, 6, 11, 13, 21, 22, 26, 28, 32, 33, 34, 35, 36, 38], "stimuli": [12, 37, 38], "stk": [30, 31], "stk2100": [30, 31], "stk3155": [15, 25, 26, 27, 29], "stk4021": [30, 31], "stk4051": [30, 31], "stk4155": [27, 29], "stk5000": 30, "stochast": [0, 1, 5, 6, 8, 11, 12, 22, 26, 33, 35, 36, 38, 39], "stock": 4, "stoke": [12, 37, 38], "stone": [0, 7, 36, 37, 38], "stop": [1, 4, 9, 13, 14, 18, 33, 38, 39], "storag": [5, 32, 33], "store": [0, 1, 2, 3, 6, 11, 13, 22, 28, 31, 34, 39], "storehaug": [29, 31], "stori": [], "str": [1, 3, 4, 39], "straight": [0, 6, 8, 13, 31, 33, 35], "straightforward": [0, 2, 3, 5, 6, 8, 9, 10, 13, 24, 31, 32, 33, 35], "strategi": [0, 1, 9, 31, 39], "stratifi": [6, 35, 36], "stream": 34, "strength": [0, 5, 14, 32, 33], "stretch": 11, "strict": [8, 13, 33], "strictli": [8, 13, 33], "stride": [4, 24], "strike": 6, "string": [1, 39], "stroke": [7, 36, 37], "strong": [3, 6, 9, 10, 12, 24, 28, 34, 35, 37, 38], "strongli": [0, 8, 15, 20, 22, 23, 24, 26, 39], "stronli": [], "structur": [0, 1, 2, 3, 6, 9, 10, 12, 22, 23, 31, 35, 36, 37, 39], "stuck": [1, 13, 33, 34, 39], "student": [0, 15, 25, 26, 27, 29, 30, 31], "studi": [0, 3, 4, 5, 6, 7, 8, 11, 12, 13, 23, 25, 26, 30, 31, 32, 33, 34, 36, 38, 39], "studier": 30, "stuff": [21, 22], "style": [7, 9, 20, 24, 31], "stylesheet": [], "st\u00f8land": 29, "sub": [9, 12, 34, 37, 38], "subarrai": [], "subclass": [], "subdivid": [0, 24, 31], "subfield": 0, "subgradi": 34, "subject": [6, 8, 28], "sublicens": [], "sublinear": 34, "submit": 31, "subplot": [0, 1, 3, 4, 6, 7, 8, 9, 10, 14, 21, 31, 35, 36, 37, 39], "subplots_adjust": [8, 28], "subprogram": [24, 31], "subproject": [], "subract": [0, 32], "subroutin": [0, 31], "subscript": [1, 39], "subsequ": [1, 4, 5, 6, 12, 24, 28, 32, 33, 35, 37, 38], "subset": [1, 6, 9, 12, 13, 23, 31, 33, 34, 35, 36, 37, 38, 39], "subspac": [0, 8, 11, 32], "substanti": [9, 10, 34], "substep": 11, "substitut": [3, 6, 12, 16, 24, 35, 36, 37], "subsubset": 9, "subtask": 6, "subtl": [1, 39], "subtract": [0, 4, 5, 6, 11, 13, 18, 19, 24, 25, 28, 32, 34, 35, 36, 39], "subtre": 9, "succeed": [0, 4, 31], "success": [3, 7, 9, 13, 28, 36, 37], "successfulli": [4, 9], "succinctli": 34, "sudo": [0, 23, 25, 31], "suffer": [0, 1, 2, 5, 10, 31, 32, 33, 39], "suffici": [1, 6, 8, 11, 13, 33, 35, 36, 39], "suggest": [1, 13, 25, 26, 30, 33, 34, 39], "suit": [8, 12, 26, 37, 38], "suitabl": [0, 15, 19, 28, 32, 34], "sum": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 19, 21, 24, 28, 31, 32, 33, 34, 37], "sum_": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 19, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "sum_i": [0, 2, 5, 6, 8, 13, 19, 25, 32, 33, 34, 35, 36], "sum_j": [6, 18, 34], "sum_ja_": 0, "sum_k": [6, 8, 12, 24, 38, 39], "sum_logist": 13, "sum_m": 3, "sum_n": 3, "sum_nx_": 3, "summar": [5, 6, 9, 26, 35, 36], "summari": [1, 3, 4, 10, 27, 33, 34, 39], "summat": [0, 3, 16, 32, 33], "sunni": 9, "super": [5, 32, 33, 34, 39], "superfici": 3, "superscript": [1, 12, 37, 38, 39], "supervis": [0, 5, 6, 7, 9, 12, 23, 31, 32, 33, 35, 36, 37, 38], "supplement": [7, 25, 26, 36, 37], "supplementari": 26, "suppli": [], "support": [0, 1, 9, 10, 11, 13, 20, 21, 23, 31, 32, 34, 36, 37, 38, 39], "suppos": [0, 5, 6, 7, 8, 10, 11, 12, 13, 24, 31, 32, 33, 34, 35, 36, 37, 38], "suppress": [5, 13, 33], "sure": [0, 1, 4, 6, 16, 20, 21, 22, 25, 39], "surf": 6, "surfac": [0, 6, 31, 34], "surpass": 6, "surpris": [0, 31], "surround": [3, 23], "survei": [0, 5, 6, 31, 32], "svc": [8, 9, 10], "svd": [0, 6, 11, 31, 35], "svdinv": 5, "svm": [8, 9, 10, 11], "svm_clf": [8, 10], "svn": [], "swap": 21, "swath": [5, 32, 33], "switch": [0, 39], "sy": [13, 33, 34, 39], "symbol": [1, 5, 11, 13, 23, 28, 31, 32, 33, 38, 39], "symmeteri": 1, "symmetr": [0, 5, 8, 11, 12, 13, 24, 31, 32, 37, 38], "symmetri": 6, "sympi": [0, 23, 25, 31, 38], "synonim": 28, "syntax": 13, "system": [0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 23, 24, 25, 31, 33, 34, 36, 37, 38, 39], "systemat": [4, 6, 35, 36], "t": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 28, 29, 31, 33, 34, 35, 36, 37, 38, 39], "t0": [3, 6, 13, 34], "t1": [2, 13, 34], "t2": 2, "t3": 2, "t9jjwsmsd1o": 35, "t_": 2, "t_0": [2, 9, 13, 34], "t_1": [13, 34], "t_b": 10, "t_batch": 39, "t_i": [1, 2, 5, 12, 26, 32, 33, 39], "t_j": 12, "t_k": 9, "t_test": 39, "t_train": 39, "t_val": 39, "tabl": [9, 25, 26, 28, 29, 31, 37], "tabul": [0, 31], "tabular": 31, "tackl": 4, "tag": [2, 3, 4, 5, 6, 7, 12, 13, 14, 24, 28, 32, 33, 36, 37, 38, 39], "tagrget": 38, "taht": [0, 31], "tail": 28, "tailor": [2, 8, 11, 31, 38], "taiwan": [0, 31], "take": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 17, 19, 21, 22, 23, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "taken": [0, 1, 3, 6, 10, 13, 21, 24, 35, 39], "tan": 3, "tangent": [1, 4, 12, 13, 33, 37, 39], "tanh": [1, 4, 7, 8, 12, 36, 37, 39], "target": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 16, 18, 19, 21, 22, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39], "target_nam": [9, 21], "task": [0, 1, 3, 6, 9, 11, 12, 14, 21, 25, 26, 31, 34, 35, 36, 37, 38, 39], "tau": [3, 5, 28], "taught": 31, "tax": [], "taylor": [2, 13, 33, 38], "taylornr": [13, 33], "tc": 8, "teach": [15, 27, 31, 35], "team": [1, 39], "teaser": 0, "technic": [0, 5, 6, 13, 25, 26, 33, 34, 35], "techniqu": [0, 1, 8, 10, 13, 23, 28, 30, 31, 32, 34, 35, 36, 39], "technologi": [0, 1, 39], "tell": [0, 4, 6, 10, 11, 13, 16, 28, 34, 35, 36], "temp": 1, "temp1": 1, "temp2": 1, "temperatur": [0, 9, 31], "templat": [18, 20], "temporari": [], "temporarili": [1, 39], "ten": [3, 31, 38], "tend": [3, 5, 6, 8, 9, 10, 12, 13, 14, 32, 34, 35, 36], "tendenc": [0, 31], "tension": [6, 35, 36], "tensor": 3, "tensorflow": [0, 2, 4, 8, 14, 23, 24, 25, 26, 30, 31, 32], "term": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 18, 19, 22, 25, 26, 28, 31, 32, 33, 34, 36, 37], "term1": [5, 6, 11], "term2": [5, 6, 11], "term3": [5, 6, 11], "term4": [5, 6, 11], "termin": [0, 4, 5, 9, 10, 13, 15, 32, 33, 34], "terminarl": 15, "terrain": 6, "terrain1": 6, "test": [3, 4, 5, 6, 7, 8, 9, 10, 13, 16, 19, 20, 21, 24, 25, 28, 31, 33, 34, 35, 36, 37], "test_acc": 3, "test_accuraci": [1, 3, 39], "test_error": 6, "test_imag": [3, 4], "test_ind": [6, 35, 36], "test_input": 4, "test_label": [3, 4], "test_loss": 3, "test_pr": [1, 39], "test_predict": [1, 39], "test_rnn": 4, "test_scor": [7, 10, 37], "test_siz": [0, 1, 3, 5, 6, 10, 15, 17, 26, 32, 33, 34, 35, 36, 39], "test_split": 9, "testerror": [0, 6, 32, 35, 36], "testi": 4, "testpredict": 4, "testx": 4, "tex": [], "text": [0, 1, 2, 4, 5, 8, 9, 11, 13, 15, 18, 20, 24, 25, 26, 28, 30, 32, 33, 34, 35, 36, 39], "textbf": [], "textbook": [16, 25, 26, 32, 33, 35, 36], "textual": 9, "textur": 1, "tf": [1, 3, 4, 13, 14, 33, 39], "th": [0, 1, 2, 5, 6, 7, 9, 12, 13, 14, 24, 25, 28, 31, 32, 34, 35, 36, 37, 38, 39], "than": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 17, 21, 23, 28, 31, 32, 34, 35, 36, 37, 38, 39], "thank": [4, 6, 32, 34], "thats": 39, "theano": [1, 23, 31, 39], "thei": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 18, 20, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "them": [0, 1, 3, 4, 6, 8, 9, 10, 11, 12, 13, 18, 21, 24, 25, 26, 31, 32, 37, 38, 39], "theme": [0, 15, 31], "themselv": [0, 25, 26, 28, 31, 34], "thenc": [6, 35, 36], "theorem": [2, 6, 7, 32, 33, 36, 37, 39], "theoret": [0, 4, 10], "theori": [0, 1, 3, 8, 9, 12, 13, 19, 23, 25, 30, 31, 34, 37, 38, 39], "thereaft": [0, 5, 6, 11, 12, 24, 25, 31, 35, 36, 38, 39], "therebi": [0, 5, 7, 11, 25, 31, 32, 33, 36, 37, 38], "therefor": [0, 1, 2, 3, 4, 6, 7, 8, 11, 13, 19, 28, 31, 32, 33, 34, 35, 36, 37, 39], "therein": 11, "thereof": [0, 6, 13, 31, 34, 35], "theta": [0, 1, 4, 5, 6, 7, 13, 16, 25, 28, 31, 32, 33, 34, 36, 37, 38, 39], "theta1": 34, "theta2": 34, "theta_": [0, 1, 6, 7, 13, 31, 32, 33, 34, 36, 37, 39], "theta_0": [0, 5, 6, 7, 16, 31, 32, 33, 34, 36, 37], "theta_0x_": [0, 31, 32], "theta_1": [0, 5, 6, 7, 31, 32, 33, 34, 36, 37], "theta_1x_": [0, 31, 32], "theta_1x_0": [0, 31], "theta_1x_1": [0, 7, 31, 36, 37], "theta_1x_2": [0, 31], "theta_1x_i": [7, 32, 33, 34, 36, 37], "theta_2": [0, 31, 32], "theta_2x_": [0, 31, 32], "theta_2x_0": [0, 31], "theta_2x_1": [0, 31], "theta_2x_2": [0, 7, 31, 36, 37], "theta_2x_i": 32, "theta_3x_i": 32, "theta_4x_i": 32, "theta_closed_form": 18, "theta_closed_formol": 18, "theta_closed_formridg": 18, "theta_gdol": 18, "theta_gdridg": 18, "theta_i": [0, 1, 5, 31, 32, 33, 39], "theta_j": [0, 5, 6, 18, 31, 32, 34], "theta_k": [33, 34], "theta_linreg": [13, 33, 34], "theta_ol": 18, "theta_p": [7, 36, 37], "theta_px_p": [7, 36, 37], "theta_ridg": 18, "theta_t": [13, 34], "theta_tru": 18, "thetaand": 37, "thetaith": 34, "thetaor": 37, "thetavalu": 5, "thetaxor": 37, "thi": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 36, 37, 39], "thing": [0, 1, 2, 4, 5, 7, 9, 15, 16, 18, 21, 22, 28, 31, 35, 37, 39], "think": [0, 1, 3, 4, 6, 9, 12, 13, 14, 28, 31, 32, 33, 34, 35, 37, 39], "third": [0, 3, 6, 13, 29, 31, 33, 34], "thirti": [7, 37], "thorughout": 31, "those": [0, 3, 5, 6, 8, 9, 10, 11, 24, 25, 26, 31, 32, 33, 34, 35, 36, 38], "though": [1, 2, 3, 4, 13, 16, 17, 19, 21, 22, 24, 28, 34, 39], "thought": [6, 14, 25, 26, 28, 35, 36], "thousand": [0, 1, 25, 32, 34, 39], "three": [0, 1, 3, 5, 6, 8, 9, 12, 21, 24, 25, 26, 27, 28, 29, 31, 32, 33, 35, 36, 37], "threshold": [1, 3, 9, 10, 11, 12, 13, 34, 36, 37, 38, 39], "through": [0, 1, 2, 3, 4, 5, 6, 8, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 28, 31, 32, 33, 34, 35, 37, 39], "throughout": [0, 4, 5, 14, 15, 23, 24, 28, 31, 39], "throw": [3, 6, 28, 35], "thu": [0, 1, 2, 5, 6, 7, 8, 10, 11, 12, 13, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "thumb": [0, 6, 25, 32], "thursdai": [], "tibshirani": [6, 19, 25, 30, 31, 35, 36], "tick_param": 6, "ticker": [6, 13, 28, 33, 34], "tif": 6, "tight_layout": [1, 7, 37], "tightli": 11, "tild": [0, 5, 6, 7, 11, 19, 25, 28, 31, 32, 33, 34, 35, 36, 38, 39], "till": [0, 4, 7, 8, 9, 10, 12, 24, 31, 32, 36, 37, 38, 39], "time": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 28, 31, 32, 33, 35, 36, 37, 38, 39], "timeit": 4, "timer": 4, "timeseri": [], "tini": [1, 34, 39], "tip": 3, "titl": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 13, 15, 20, 21, 28, 31, 33, 34, 35, 36, 39], "tm": [], "tmp": 13, "tn": [2, 3, 7], "to_categor": [1, 3, 4, 39], "to_categorical_numpi": [1, 39], "to_numer": [0, 6, 31, 35, 36], "todai": 3, "togeth": [0, 3, 6, 8, 11, 13, 22, 23, 31], "toi": 14, "token": [], "told": 13, "toler": [2, 14], "tolist": 4, "tomographi": [12, 37, 38], "too": [0, 2, 4, 5, 6, 9, 11, 13, 17, 18, 28, 30, 32, 33, 34, 35, 36], "took": [8, 31], "tool": [0, 1, 3, 6, 13, 15, 23, 32, 35, 36, 39], "toolbox": 8, "top": [0, 3, 5, 6, 9, 10, 19, 23, 31, 35], "topic": [0, 5, 6, 7, 8, 23, 25, 26, 32, 33, 35, 36, 37, 38], "topolog": [3, 12, 37, 38], "topologi": [1, 12, 39], "torkjellsdatt": [29, 31], "tort": [], "toss": [10, 28], "total": [0, 1, 2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 14, 24, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "total_loss": 4, "totalclustervari": 14, "totalscatt": 14, "toward": [1, 2, 7, 12, 13, 15, 33, 36, 37, 39], "towardsdatasci": 34, "town": [], "tp": [4, 7], "tpng": 9, "tpu": [13, 23, 31], "tqdm": 6, "tr": [], "track": [3, 13, 14, 15, 22, 24, 32, 33, 34], "tract": [], "tractabl": [0, 31, 32], "trade": [5, 9, 20, 26, 34, 35], "tradeoff": [0, 5, 19, 25, 31, 32, 33], "tradit": [0, 1, 4, 6, 31, 35, 36, 39], "train": [2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 16, 17, 20, 25, 26, 33, 34, 35, 36, 37], "train_acc": 39, "train_accuraci": [0, 1, 3, 31, 39], "train_dataset": 4, "train_end": [0, 1, 32, 39], "train_error": [6, 39], "train_imag": [3, 4], "train_ind": [6, 35, 36], "train_label": [3, 4], "train_network": 21, "train_pr": [1, 39], "train_siz": [0, 1, 3, 32, 39], "train_step": 4, "train_test_split": [0, 1, 3, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 26, 31, 32, 33, 34, 35, 36, 37, 39], "train_test_split_numpi": [0, 1, 32, 39], "trainable_vari": 4, "trained_model": [6, 32, 34], "trainerror": [0, 32], "traini": 4, "training_checkpoint": 4, "training_dataset": 4, "training_gradi": [13, 34], "trainingerror": [6, 35, 36], "trainpredict": 4, "trainscor": 4, "trainx": 4, "trait": [0, 31], "trajectori": [4, 34], "transfer": [9, 31], "transform": [0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 17, 21, 23, 24, 31, 32, 33, 34, 35, 36, 37, 38, 39], "transit": [6, 12, 37, 38], "translat": [1, 4, 6, 10, 31, 32, 34, 39], "transpos": [1, 5, 11, 21, 24, 32, 33, 39], "travers": [0, 5], "travi": [], "treat": [0, 1, 3, 6, 12, 13, 18, 21, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "tree": [0, 1, 23, 31, 39], "tree_clf": [9, 10], "tree_clf_": 9, "tree_clf_sr": 9, "tree_reg": 9, "tree_reg1": 9, "tree_reg2": 9, "trend": 28, "treue": 7, "trevor": [19, 25, 30], "tri": [2, 3, 4, 9, 13, 16, 34], "triain": 0, "trial": [0, 2, 4, 6, 13, 28, 31, 33, 34, 35, 36], "triangl": [13, 33], "triangular": 24, "trick": [3, 4, 8, 11, 13, 28, 34], "tricki": 22, "trickier": 28, "tridiagon": 24, "trillion": 23, "trim": [], "trivial": [0, 1, 5, 11, 28, 31, 33, 39], "troffa": [], "troubl": [0, 8, 12, 15, 21, 22, 32, 34, 38, 39], "truck": 3, "true": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, 17, 18, 19, 21, 22, 24, 25, 28, 31, 32, 33, 34, 35, 36, 37, 39], "true_beta": 32, "true_fun": [6, 35, 36], "true_theta": [6, 34], "truelabel": [36, 37], "truli": 31, "truncat": 38, "try": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 18, 21, 22, 23, 24, 25, 26, 28, 31, 32, 33, 34, 36, 37, 38, 39], "tr\u00f6ger": [], "tucker": 8, "tuesdai": [29, 31, 36], "tumor": [7, 9, 36, 37], "tumour": [7, 37], "tunabl": 1, "tune": [4, 9, 13, 24, 31, 34], "tupl": [21, 39], "turn": [0, 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 24, 25, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "tutori": [1, 4, 26, 39], "tv": 2, "tveito": 2, "tvw1zdmznwm": 37, "tweak": [1, 4, 10, 28, 39], "twice": [13, 33], "twist": 11, "two": [0, 1, 2, 4, 5, 6, 7, 9, 10, 11, 12, 13, 15, 17, 21, 24, 25, 27, 28, 30, 31, 32, 33, 34, 35], "tx": [13, 33, 34, 37], "tx_1": [13, 33], "txt": [4, 15, 20, 25, 26], "ty": [13, 33], "type": [0, 1, 3, 6, 8, 10, 13, 21, 24, 28, 32, 33, 34, 35, 39], "typeset": 20, "typic": [0, 1, 2, 3, 4, 5, 7, 9, 10, 12, 13, 15, 16, 20, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "typo": [25, 26], "u": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 21, 24, 25, 26, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "u_": 24, "u_i": [12, 37], "u_m": 10, "ua": [0, 31], "ubuntu": [0, 23, 25, 31], "uci": [25, 26], "ufunc": [], "uio": [15, 20, 21, 25, 26, 29, 30], "uk": [], "un": 14, "unabl": [15, 21], "unari": [24, 31], "unbalanc": [6, 9, 35, 36], "unbias": [0, 5, 6, 31, 35], "uncent": [6, 32, 34], "uncertainti": [0, 5, 31], "uncertitud": 28, "unchang": [1, 3, 39], "uncom": [], "uncorrel": [10, 28], "undefin": [5, 32, 33], "under": [0, 1, 5, 6, 10, 13, 23, 25, 31, 32, 33, 34, 35, 39], "underdetermin": [0, 31], "underfit": [1, 6, 35, 36, 39], "underflowproblem": [5, 35], "undergo": [5, 21], "undergradu": [27, 29], "underli": [0, 1, 9, 13, 18, 28, 31, 34, 39], "underlin": [], "underscor": [], "underset": [4, 14], "understand": [0, 1, 3, 5, 6, 10, 13, 14, 15, 19, 20, 21, 23, 31, 32, 33, 34, 38, 39], "understood": [8, 13], "underwai": [], "undesir": 8, "undetermin": [5, 8, 35], "undo": 4, "unexpect": [6, 35], "unexpected": 28, "unexplain": 18, "unfair": [6, 32], "unfortun": [1, 8, 9, 10, 39], "unicode_liter": [8, 9], "uniform": [0, 1, 5, 6, 11, 13, 25, 28, 31, 33, 34, 36, 37, 39], "uniformli": [13, 28, 33, 34], "unifrompdf": 28, "unimport": [13, 33], "union": [5, 6, 35, 36], "uniqu": [0, 2, 6, 13, 14, 24, 31, 35, 36, 37], "unique_class": [36, 37], "unique_cluster_label": 14, "unit": [0, 1, 3, 4, 5, 10, 12, 18, 28, 31, 32, 33, 34, 37, 38, 39], "unitari": [5, 6, 24, 32, 33], "unitarili": [24, 31], "uniti": 28, "univari": 28, "univers": [0, 1, 2, 13, 23, 25, 26, 27, 29, 31, 32, 33, 34, 35, 36, 37, 39], "unix": [1, 39], "unknow": [0, 24, 31], "unknown": [0, 1, 3, 4, 5, 6, 8, 10, 13, 19, 24, 25, 31, 32, 33, 34, 35, 36, 38, 39], "unknowwn": 12, "unlabel": [1, 39], "unless": [0, 3, 6, 11, 13, 25, 26, 31, 33, 35, 38], "unlik": [1, 3, 8, 13, 33, 34, 39], "unnecessarili": 9, "unord": 3, "unpickl": [], "unpleas": [], "unpublish": 34, "unravel": [1, 39], "unrol": [3, 11], "unscal": 19, "unseen": [0, 7, 9, 15, 36, 37], "unstabl": [1, 39], "unsupervis": [0, 1, 4, 12, 23, 31, 37, 38, 39], "unsymmetr": [24, 31], "until": [1, 2, 4, 9, 12, 13, 14, 21, 33, 34, 37, 39], "untouch": 0, "unusu": [12, 37, 38], "up": [1, 3, 4, 5, 6, 8, 10, 11, 13, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 28, 29, 34, 37], "updat": [1, 2, 10, 12, 13, 14, 15, 18, 19, 21, 22, 26, 35, 36, 37], "update_chang": 39, "update_matrix": 39, "update_weight": 22, "uploa": 31, "upload": [15, 20, 23, 25, 26, 30], "upon": [0, 1, 6, 7, 11, 24, 38, 39], "upper": [0, 8, 9, 16, 24, 32], "uppercas": [24, 31], "upsampl": 4, "upscal": 4, "uptad": 38, "upward": [], "url": [31, 32, 37], "us": [4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 17, 20, 21, 24, 28, 30, 35], "usag": [0, 8, 23, 31, 32, 38], "usd": [], "usd10000": [], "use_bia": 4, "usecol": [0, 31], "useless": [1, 39], "user": [0, 1, 2, 4, 6, 7, 15, 23, 24, 25, 31, 32, 36, 37, 39], "usernam": [15, 25, 26], "usetex": 28, "usg": 6, "usr": 28, "usual": [0, 3, 4, 7, 12, 13, 14, 31, 34, 36, 37, 38], "ut": 5, "utf": [], "util": [1, 3, 4, 6, 7, 10, 14, 19, 31, 35, 36, 39], "ux": 24, "v": [2, 4, 5, 6, 11, 13, 15, 23, 32, 33, 35, 36, 37, 38, 39], "v0": 28, "v1": 28, "v2": 28, "v5": [], "v8xr": [37, 38, 39], "v_": 34, "v_0": [11, 34], "v_t": 34, "va": 1, "vahid": 31, "val": 13, "val_acc": 39, "val_accuraci": 3, "val_error": 39, "val_loss": 4, "val_set": 39, "vale": 2, "valid": [0, 1, 4, 7, 9, 10, 13, 23, 28, 31, 32, 34, 37, 39], "validation_data": 3, "validation_split": 4, "valu": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 31, 34, 37, 38, 39], "valuat": 9, "valued_at_a": 39, "valued_at_z": 39, "valueerror": [], "valy": 4, "van": [0, 19, 25, 31, 32, 33, 34], "vandenbergh": [8, 13, 33], "vandermond": [0, 31], "vanilla": [0, 6, 11, 14, 32, 34], "vanish": [1, 4, 13, 28, 33, 38], "var": [5, 6, 10, 11, 19, 25, 28, 32, 35, 36], "var_x": 28, "varabl": 8, "varepsilon": [5, 6, 19, 35], "varepsilon_": [5, 6, 35], "varepsilon_i": [5, 6, 35], "vari": [0, 1, 3, 5, 6, 10, 21, 31, 35, 36, 38, 39], "variabl": [0, 1, 2, 5, 6, 7, 8, 10, 11, 12, 13, 14, 21, 24, 31, 32, 34, 35, 36, 37, 38, 39], "varianc": [0, 1, 5, 7, 9, 10, 11, 13, 14, 18, 20, 23, 24, 26, 28, 31, 32, 33, 34, 37, 39], "variance_i": [5, 11, 32], "variance_x": [5, 11, 32], "variant": [0, 1, 6, 8, 12, 13, 26, 31, 32, 33, 34, 37, 38, 39], "variat": [3, 4, 11, 31], "varieti": [0, 3, 12, 23, 25, 31, 37, 38], "variou": [1, 3, 5, 6, 7, 8, 9, 11, 12, 13, 16, 19, 20, 23, 24, 25, 28, 31, 32, 33, 34, 37, 38, 39], "varydimens": 4, "vast": 34, "vastli": 3, "vaue": 1, "vault": 0, "vdot": [2, 13, 33, 34], "ve": [25, 26, 34], "vec": [6, 35], "vector": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 14, 17, 18, 21, 22, 23, 33, 34, 35, 36, 38, 39], "vector_mean": 14, "ventur": [0, 8, 23, 31], "venv": 15, "verbos": [1, 3, 4, 36, 37, 39], "veri": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 18, 21, 22, 25, 26, 28, 30, 31, 32, 33, 34, 35, 36, 39], "verifi": [3, 11, 24, 31], "versatil": [8, 31], "versicolor": [8, 9], "version": [0, 3, 10, 13, 14, 15, 21, 22, 23, 24, 25, 26, 28, 31], "versu": [1, 34, 39], "vert": [0, 1, 5, 6, 7, 8, 9, 11, 13, 16, 17, 31, 32, 33, 34, 35, 36, 37, 38, 39], "vert_1": [5, 6, 32, 33, 34], "vert_2": [5, 6, 11, 17, 32, 33, 34, 35], "vi": 39, "via": [0, 5, 6, 7, 8, 9, 10, 11, 12, 19, 23, 24, 25, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "vidal": 11, "video": [0, 1, 12, 23, 27, 29, 31, 32, 33], "view": [1, 3, 5, 6, 12, 13, 28, 30, 31, 33, 34, 35, 37, 39], "vii": 39, "viii": 39, "violat": 8, "virginica": 9, "viridi": [0, 1, 2, 3, 31, 39], "virtanen": [], "virtual": [1, 34, 39], "viscos": 13, "viscou": 13, "visibl": 15, "vision": [0, 3], "visit": 34, "visual": [0, 3, 11, 12, 18, 23, 31, 32, 37, 38], "visualis": 1, "visualstudio": [15, 16, 19], "viz": [6, 8, 28], "vmap": 13, "vmax": [1, 6], "vmh0zpt0tli": 34, "vmin": [1, 6], "voic": 3, "volatil": 34, "volum": [0, 3, 31], "von": [38, 39], "vote": [10, 31], "voting_clf": 10, "votingclassifi": 10, "votingsimpl": 10, "vscode": [21, 22], "vstack": [5, 11, 24, 28, 31, 32, 36, 37, 39], "vt": [5, 32, 33], "w": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 21, 22, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "w1": [8, 21, 22], "w2": [8, 11, 21, 22], "w3": 8, "w_": [1, 12, 37, 38, 39], "w_0": 38, "w_1": [8, 24, 38, 39], "w_1a_0": [38, 39], "w_1x": [38, 39], "w_1x_": 8, "w_1x_1": 8, "w_2": [8, 24, 38, 39], "w_2a_1": [38, 39], "w_2x_": 8, "w_2x_2": 8, "w_3": 24, "w_4": 24, "w_g": [21, 22], "w_hidden": 2, "w_i": [1, 2, 10, 38, 39], "w_ix_i": [12, 37, 38], "w_j": 24, "w_m": 24, "w_output": 2, "w_px_": 8, "w_px_p": 8, "w_t": [], "wa": [1, 3, 4, 5, 6, 7, 10, 11, 12, 14, 17, 19, 21, 24, 31, 32, 34, 35, 36, 37, 38, 39], "wai": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 18, 19, 21, 22, 24, 28, 31, 32, 33, 34, 37, 39], "walk": 9, "walker": 28, "wall": 34, "walt": [], "wang": [0, 31], "want": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23, 25, 26, 28, 31, 32, 33, 34, 35, 36, 38, 39], "warn": [4, 39], "warrant": [6, 35, 36], "warranti": [], "wast": [3, 34], "watch": [23, 33, 34, 35, 37, 38, 39], "wave": 3, "wavelet": 8, "wcag": [], "we": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 32, 33, 35, 36, 37], "weak": [9, 10, 14], "weaker": 34, "weather": [1, 12, 37, 38, 39], "web": [23, 27, 29, 31], "weblink": 26, "webpag": 31, "websit": [6, 24, 25, 26, 27, 31], "wedg": [8, 28, 38, 39], "wednesdai": [29, 31, 36], "wee": 11, "week": [0, 5, 6, 7, 25, 26, 27, 29], "week41": 26, "week42": 26, "weekli": [15, 16, 23, 25, 27, 29, 30, 31, 37], "weierstrass": 38, "weight": [1, 2, 3, 6, 7, 9, 10, 12, 13, 18, 21, 22, 26, 28, 34, 36, 37, 38], "weight_arrai": 39, "weigth": [2, 22], "welchlab": [37, 38, 39], "welcom": [8, 15, 23], "well": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 20, 21, 22, 23, 24, 25, 26, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "went": 8, "were": [0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 28, 31, 34, 35, 36, 37, 38, 39], "wessel": [0, 19, 25, 31, 32, 33, 34], "wg_nf1awssi": 38, "what": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 28, 34, 37, 38, 39], "whatev": [3, 21], "when": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 22, 24, 25, 26, 28, 31, 32, 33, 35, 36, 37, 38, 39], "whenev": [13, 15, 28, 34, 38], "where": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39], "wherea": [6, 28, 34, 35, 36], "wherefrom": [25, 26], "wherein": [1, 12, 37, 38, 39], "whether": [0, 3, 5, 7, 9, 25, 26, 28, 31, 36, 37], "which": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 35, 36, 37, 38], "whichev": [1, 3, 39], "while": [0, 1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 19, 20, 21, 22, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "white": 9, "whiteboad": 34, "whiteboard": [32, 33, 34, 35, 36, 37, 38, 39], "who": [0, 15], "whole": [1, 3, 4, 5, 9, 11, 13, 21, 34, 39], "whom": [], "whose": [0, 6, 10, 26, 28, 32, 35, 36], "whow": [11, 32], "why": [0, 1, 3, 6, 13, 15, 16, 17, 19, 21, 25, 32, 33, 39], "wide": [0, 1, 3, 6, 7, 12, 23, 24, 25, 31, 35, 36, 37, 38, 39], "widehat": [6, 35], "width": [0, 3, 8, 9, 21, 31], "wieringen": [0, 19, 25, 31, 32, 33, 34], "wiki": 25, "wikipedia": 25, "win": [10, 34], "wind": 9, "window": [], "wing": [29, 31], "winther": 2, "wiothout": 6, "wiscons": 7, "wisconsin": [10, 37, 39], "wisdom": [6, 32, 34], "wise": [1, 5, 12, 13, 21, 32, 33, 34, 37, 39], "wish": [0, 2, 5, 7, 8, 11, 13, 14, 18, 24, 25, 26, 31, 32, 33, 34, 36, 37, 38, 39], "with_std": [0, 32], "wither": 6, "within": [0, 2, 3, 4, 7, 9, 12, 13, 14, 28, 30, 31, 33, 36, 37], "withinclust": 14, "without": [0, 1, 5, 6, 8, 9, 11, 12, 13, 15, 18, 25, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39], "wo5dmep_bbi": [37, 38, 39], "won": [0, 15, 31, 38], "wonder": 8, "word": [0, 1, 3, 4, 5, 6, 7, 14, 19, 25, 26, 28, 31, 32, 33, 34, 39], "work": [0, 1, 4, 6, 7, 8, 9, 13, 15, 16, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 31, 32, 34, 35, 36, 37, 38, 39], "workabl": 34, "workaround": [], "workhors": 34, "workload": 34, "workshop": 31, "world": [0, 8, 16, 32], "worldwid": [0, 31], "worri": 15, "wors": [0, 1, 3, 4, 6, 31, 34, 35, 36, 39], "worth": [9, 19, 21], "worthi": [25, 26], "would": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 18, 20, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "wouldn": [], "wrap": [6, 24, 31], "wrapper": [21, 22], "write": [0, 1, 2, 3, 5, 6, 7, 8, 12, 13, 15, 16, 18, 21, 24, 31, 32, 34, 35, 36, 37, 38], "writer": [36, 37], "writerow": [36, 37], "written": [0, 2, 3, 5, 11, 12, 13, 16, 23, 24, 25, 26, 28, 31, 32, 33, 34, 38, 39], "wrong": [1, 8, 15, 19, 39], "wrongli": 10, "wrote": [5, 11, 32], "wrt": [10, 13, 21, 22, 34, 38, 39], "wth": [10, 13, 34], "wurstemberg": [38, 39], "www": [20, 23, 24, 25, 26, 30, 31, 33, 34, 35, 37, 38, 39], "wx_1": 8, "x": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 24, 25, 26, 28, 31, 33, 34, 35, 36, 37, 38, 39], "x0": [8, 36, 37], "x1": [4, 8, 9, 10, 13, 36, 37], "x1_exampl": 8, "x1d": 8, "x2": [8, 9, 10, 13], "x2d": [8, 11], "x2d_train": 11, "x2dsl": 11, "x3": 8, "x_": [0, 2, 3, 5, 6, 8, 10, 11, 13, 14, 24, 28, 31, 32, 33, 34, 35, 36, 38], "x_0": [0, 5, 11, 18, 24, 31, 32, 35, 38], "x_1": [0, 2, 5, 6, 7, 8, 9, 10, 11, 13, 18, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "x_2": [0, 2, 5, 6, 7, 8, 9, 10, 11, 13, 24, 28, 31, 32, 33, 35, 36, 37, 38, 39], "x_3": [8, 24, 28, 38], "x_4": [24, 38], "x_5": 38, "x_6": 18, "x_batch": 39, "x_bin": [36, 37], "x_center": 11, "x_data": [1, 39], "x_data_ful": [1, 39], "x_hidden": 2, "x_i": [0, 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 24, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "x_input": 2, "x_ix_": [0, 31], "x_iy_i": 8, "x_j": [0, 2, 8, 9, 12, 16, 28, 32, 34, 37, 38], "x_jy_j": 8, "x_k": [12, 14, 24, 28, 32, 37], "x_l": [28, 38], "x_m": [6, 12, 24, 28, 35, 37], "x_mean": [18, 34], "x_multi": [36, 37], "x_n": [0, 2, 3, 6, 8, 11, 12, 13, 24, 28, 31, 33, 35, 37, 38], "x_new": [9, 10], "x_norm": [18, 34], "x_offset": [6, 32, 34], "x_output": 2, "x_p": [3, 7, 9, 36, 37], "x_poli": 9, "x_poly10": 9, "x_pred": 4, "x_prev": 2, "x_reduc": 11, "x_sampl": [], "x_scale": 8, "x_small": 13, "x_std": [18, 34], "x_t": 34, "x_test": [0, 1, 3, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 26, 32, 33, 34, 35, 36, 37, 39], "x_test_": 17, "x_test_own": 6, "x_test_scal": [0, 6, 7, 9, 10, 11, 32, 34], "x_tot": 4, "x_train": [0, 1, 3, 4, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 26, 31, 32, 33, 34, 35, 36, 37, 39], "x_train_": 17, "x_train_mean": [6, 32, 34], "x_train_own": 6, "x_train_r": 19, "x_train_scal": [0, 6, 7, 9, 10, 11, 32, 34], "x_val": [1, 39], "xarrai": [23, 31], "xavier": [1, 39], "xbnew": [13, 33, 34], "xcode": [0, 23, 25, 31], "xdclassiffierconfus": 10, "xdclassiffierroc": 10, "xg_clf": 10, "xgb": 10, "xgbclassifi": 10, "xgboost": 9, "xgboot": 10, "xgbregressor": 10, "xgparam": 10, "xgtree": 10, "xi": [8, 13, 34, 36, 37], "xi_": 8, "xi_1": 8, "xi_i": 8, "xinv": 37, "xk": 8, "xla": [13, 23, 31], "xlabel": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 21, 28, 31, 32, 33, 34, 35, 36], "xlim": [6, 10, 35, 36], "xm": 9, "xmesh": 13, "xnew": [0, 13, 31, 33, 34], "xp": 28, "xpanda": [0, 32], "xpd": [5, 11, 32], "xplot": 0, "xscale": [0, 32], "xsr": 9, "xt_x": [13, 33, 34], "xtest": [6, 35, 36], "xtick": [3, 6, 8, 9, 35, 36], "xtrain": [6, 35, 36], "xu": [0, 31], "xx": [0, 24, 31], "xy": [0, 6, 8, 24, 31], "xytext": 8, "xyz": [], "xz": [24, 31], "y": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "y1": 4, "y2": 4, "y3": 4, "y_": [0, 1, 5, 6, 10, 11, 24, 31, 32, 35, 36, 39], "y_0": [0, 5, 11, 24, 31, 32, 35], "y_1": [0, 5, 8, 9, 11, 13, 24, 31, 32, 33, 34, 35], "y_1y_1": 8, "y_1y_1k": 8, "y_1y_2": 8, "y_1y_2k": 8, "y_1y_n": 8, "y_1y_nk": 8, "y_2": [0, 5, 8, 9, 11, 24, 31, 32], "y_2y_1": 8, "y_2y_1k": 8, "y_2y_2": 8, "y_2y_2k": 8, "y_3": [0, 9, 24], "y_4": 24, "y_bin": [36, 37], "y_binari": [36, 37], "y_center": [18, 34], "y_data": [0, 1, 5, 6, 31, 32, 33, 34, 39], "y_data_ful": [1, 39], "y_decis": 8, "y_fit": [0, 32], "y_i": [0, 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 19, 24, 25, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39], "y_if_": 10, "y_indic": [36, 37], "y_ix_": [0, 31], "y_ix_i": [7, 8, 13, 32, 33, 34, 36, 37], "y_iy_jk": 8, "y_j": [6, 8, 12, 25, 35, 36, 37, 38, 39], "y_k": [12, 37], "y_m": 24, "y_mean": [18, 34], "y_model": [0, 4, 5, 6, 31, 32, 33, 34], "y_multi": [36, 37], "y_n": [8, 13, 33, 34], "y_ny_1": 8, "y_ny_1k": 8, "y_ny_2": 8, "y_ny_2k": 8, "y_ny_n": 8, "y_ny_nk": 8, "y_offset": [6, 17, 32, 34], "y_onehot": [36, 37], "y_plot": 9, "y_pred": [0, 1, 4, 6, 7, 8, 9, 10, 26, 32, 34, 35, 36, 37, 39], "y_pred1": 9, "y_pred2": 9, "y_pred_bin": [36, 37], "y_pred_multi": [36, 37], "y_pred_rf": 10, "y_pred_tre": 10, "y_prob": [36, 37], "y_prob_bin": [36, 37], "y_prob_multi": [36, 37], "y_proba": [7, 10, 37], "y_sampl": [], "y_scaler": [6, 32, 34], "y_test": [0, 1, 3, 4, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 26, 32, 33, 34, 35, 36, 37, 39], "y_test_onehot": [1, 39], "y_test_predict": [], "y_tot": 4, "y_train": [0, 1, 3, 4, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 26, 31, 32, 33, 34, 35, 36, 37, 39], "y_train_mean": [6, 32, 34], "y_train_onehot": [1, 39], "y_train_predict": [], "y_train_r": 19, "y_train_scal": [6, 32, 34], "y_true": [36, 37], "y_val": 1, "yand": 37, "ye": [3, 6, 7, 35, 36, 37], "year": [0, 23, 31], "yet": [0, 1, 6, 8, 11, 13, 20, 21, 31, 36, 38, 39], "yi": [13, 34, 36, 37], "yield": [0, 2, 5, 6, 8, 10, 12, 13, 14, 24, 28, 31, 33, 34, 35, 37, 38, 39], "yk": 8, "ylabel": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 21, 28, 31, 32, 33, 34, 35, 36], "ylim": [3, 6, 35, 36], "ym": 9, "ymesh": 13, "yn": 0, "yo": [8, 9, 10], "yor": 37, "yoshiki": [], "yoshua": [1, 30, 39], "you": [0, 1, 3, 4, 5, 6, 8, 9, 10, 11, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 35, 36, 38, 39], "young": 0, "your": [1, 2, 4, 5, 6, 8, 11, 13, 15, 17, 19, 20, 21, 22, 23, 24, 31, 33, 34, 35, 36, 37, 38, 39], "your_model_object": 16, "yourself": [11, 13, 31, 33], "youtu": [32, 33, 35, 37, 39], "youtub": [23, 33, 34, 35, 37, 38, 39], "ypred": [6, 35, 36], "ypredict": [0, 13, 31, 32, 33, 34], "ypredict2": [13, 33, 34], "ypredictlasso": [5, 33], "ypredictol": [0, 5, 33], "ypredictown": [6, 32, 34], "ypredictownridg": [6, 32, 33, 34], "ypredictridg": [0, 5, 6, 32, 33, 34], "ypredictskl": [6, 32, 34], "ytest": [6, 35, 36], "ytick": [3, 6, 8, 9, 35, 36], "ytild": [0, 6, 31, 32, 35, 36], "ytildelasso": [5, 33], "ytildenp": [0, 31, 32], "ytildeol": [0, 5, 33], "ytildeownridg": [6, 32, 33, 34], "ytilderidg": [5, 6, 32, 33, 34], "ytrain": [6, 35, 36], "yuxi": 31, "yx": [24, 31], "yxor": [37, 39], "yy": [24, 31], "yz": [24, 31], "z": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 21, 22, 24, 28, 31, 32, 35, 36, 37, 38, 39], "z1": [21, 22], "z2": [21, 22], "z_": [1, 2, 12, 24, 31, 38, 39], "z_0": [24, 31, 38], "z_1": [24, 31, 38, 39], "z_2": [22, 24, 31, 38, 39], "z_c": [1, 39], "z_h": [1, 39], "z_hidden": 2, "z_i": [1, 12, 37, 39], "z_j": [1, 12], "z_k": [12, 32, 38, 39], "z_m": [1, 39], "z_matric": 39, "z_mod": 9, "z_o": [1, 39], "z_output": 2, "za": [], "zalando": 26, "zaman": 28, "zaxi": 6, "zero": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 21, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "zeros_lik": [4, 36, 37], "zeroth": 32, "zfill": 4, "zip": [4, 6, 21, 22, 36, 37], "zm_h": [0, 31], "zn": [], "zone": [], "zoom": 31, "zscout": [], "zx": [24, 31], "zy": [24, 31], "zz": [24, 31], "\u00f8yvind": [6, 32, 34], "\u03b4": 39}, "titles": ["3. Linear Regression", "14. Building a Feed Forward Neural Network", "15. Solving Differential Equations with Deep Learning", "16. Convolutional Neural Networks", "17. Recurrent neural networks: Overarching view", "4. Ridge and Lasso Regression", "5. Resampling Methods", "6. Logistic Regression", "8. Support Vector Machines, overarching aims", "9. Decision trees, overarching aims", "10. Ensemble Methods: From a Single Tree to Many Trees and Extreme Boosting, Meet the Jungle of Methods", "11. Basic ideas of the Principal Component Analysis (PCA)", "13. Neural networks", "7. Optimization, the central part of any Machine Learning algortithm", "12. Clustering and Unsupervised Learning", "Exercises week 34", "Exercises week 35", "Exercises week 36", "Exercises week 37", "Exercises week 38", "Exercises week 39", "Exercises week 41", "Exercises week 42", "Applied Data Analysis and Machine Learning", "2. Linear Algebra, Handling of Arrays and more Python Features", "Project 1 on Machine Learning, deadline October 6 (midnight), 2025", "Project 2 on Machine Learning, deadline November 10 (Midnight)", "Course setting", "1. Elements of Probability Theory and Statistical Data Analysis", "Teachers and Grading", "Textbooks", "Week 34: Introduction to the course, Logistics and Practicalities", "Week 35: From Ordinary Linear Regression to Ridge and Lasso Regression", "Week 36: Linear Regression and Gradient descent", "Week 37: Gradient descent methods", "Week 38: Statistical analysis, bias-variance tradeoff and resampling methods", "Week 39: Resampling methods and logistic regression", "Week 40: Gradient descent methods (continued) and start Neural networks", "Week 41 Neural networks and constructing a neural network code", "Week 42 Constructing a Neural Network code with examples"], "titleterms": {"": [8, 10, 33, 34, 35, 36, 37], "0": 39, "04": [], "05": [], "06": [], "07": [], "1": [0, 15, 16, 17, 18, 19, 20, 21, 22, 25, 26, 32, 38, 39], "10": [26, 38], "11": [], "13": 39, "15": [19, 35], "19": 19, "1a": 18, "2": [0, 15, 16, 17, 18, 19, 20, 21, 22, 26, 31, 32, 33, 38, 39], "20": [], "2017": [], "2018": [], "2019": [], "2023": 29, "2025": [25, 36, 37, 38, 39], "22": 36, "26": 36, "27": [], "29": 37, "2a": [], "2b": [], "3": [0, 15, 16, 17, 18, 19, 20, 21, 22, 32, 38, 39], "34": [15, 31], "35": [16, 32], "36": [17, 33], "37": [18, 34], "38": [19, 35], "39": [20, 36], "3a": 18, "3b": 18, "4": [0, 15, 16, 17, 18, 19, 20, 21, 22, 32, 39], "40": 37, "41": [21, 38], "42": [22, 39], "4a": 18, "4b": 18, "5": [0, 16, 18, 19, 20, 21, 22], "6": [21, 22, 25, 38], "7": [21, 22], "8": [22, 34], "A": [0, 1, 4, 8, 9, 31, 35, 36, 37, 39], "AND": 37, "And": [31, 32, 34], "But": 34, "In": [29, 38], "Ising": 6, "OR": 37, "The": [0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 15, 23, 31, 32, 33, 34, 35, 36, 37, 38, 39], "To": 31, "With": [4, 33], "a11i": [], "about": [26, 31, 32, 33], "abov": [33, 38, 39], "abstract": 20, "accuraci": 34, "across": 34, "activ": [1, 12, 21, 26, 37, 38, 39], "ad": [0, 6, 20, 25, 31, 32, 37, 38, 39], "adaboost": 10, "adagrad": [13, 34], "adam": [13, 34], "adapt": [10, 34], "add": [], "adjust": [1, 39], "advanc": 25, "adversari": 4, "again": [3, 9], "against": 26, "ai": [25, 26, 31], "aim": [8, 9, 21, 22, 31], "aka": 31, "al": 34, "algebra": [24, 31], "algorithm": [9, 10, 11, 12, 26, 31, 32, 33, 34, 38, 39], "algortithm": [13, 33, 36, 37], "all": [8, 38, 39], "an": [0, 4, 10, 15, 20, 31, 38], "analys": [5, 32, 33], "analysi": [0, 5, 6, 11, 23, 25, 26, 28, 31, 32, 33, 35, 36, 38], "analyt": [0, 16, 18, 26], "analyz": [26, 38, 39], "ani": [13, 22, 33, 36, 37], "anoth": [9, 33, 35, 36], "api": [], "appli": 23, "approach": [0, 8, 14, 31, 34, 35, 36], "approxim": [12, 38], "architectur": [1, 39], "arrai": [24, 31], "artifici": [37, 38], "assist": 29, "assumpt": 35, "august": [], "author": [], "autocorrel": 28, "autograd": [2, 13, 22, 34], "automat": [13, 34, 38], "avail": 20, "avali": [], "averag": 34, "b": [25, 26], "back": [1, 11, 12, 32, 33, 38, 39], "background": [23, 25, 26, 35], "backpropag": 22, "bag": 10, "base": [13, 34, 35], "basic": [0, 5, 7, 9, 10, 11, 24, 32, 33, 36, 37, 38], "batch": [1, 22, 34, 39], "bay": 5, "befor": 11, "bengio": 39, "beta": [], "better": [8, 37], "bia": [6, 19, 25, 34, 35, 36], "bias": [38, 39], "binari": [1, 39], "bind": 31, "bird": 10, "blind": [], "block": [], "boldsymbol": [18, 32, 35], "book": [19, 38, 39], "boost": 10, "bootstrap": [6, 10, 35, 36], "boston": [], "breast": 1, "brief": [31, 35, 36], "bring": [12, 38, 39], "browser": [], "bsd": [], "build": [1, 3, 9, 39], "c": [25, 26, 31], "calcul": [18, 32, 33], "can": [31, 34, 35, 36, 38], "cancer": [1, 7, 9, 11], "cart": 9, "case": [8, 10, 28, 32, 33, 34, 36, 37], "cdn": [], "cell": [], "central": [13, 23, 28, 33, 35, 36, 37], "chain": [12, 38, 39], "challeng": 34, "chang": 10, "changelog": [], "channel": 31, "chi": [0, 31], "choic": [17, 39], "choos": [1, 34, 39], "cifar01": 3, "citat": [], "class": [36, 37, 38], "classic": 11, "classif": [1, 9, 10, 26, 36, 37, 39], "classifi": [8, 36], "claus": [], "clip": [1, 39], "cluster": 14, "cnn": 3, "code": [1, 2, 5, 9, 11, 12, 13, 14, 15, 16, 20, 25, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39], "collect": [1, 3, 39], "color": [], "colorblind": [], "combin": 34, "commun": 31, "compact": [36, 37, 38, 39], "compar": [2, 10, 16], "comparison": [33, 34], "compet": 34, "compil": [], "complet": [32, 38, 39], "complex": [0, 6, 25, 32], "complic": [6, 38], "compon": 11, "comput": [9, 19, 34], "computation": [35, 36], "computerlab": 31, "con": [9, 34], "concept": 28, "condit": 33, "confid": 35, "conjug": 13, "consider": [38, 39], "constraint": 34, "construct": [38, 39], "contain": [], "content": [], "continu": 37, "contn": 31, "contrast": [], "contributor": [], "converg": 34, "convex": [8, 13, 33, 34], "convolut": [3, 12, 37, 38], "copyright": [], "core": [], "correct": 34, "correl": [11, 32, 37], "correspond": [], "cost": [1, 10, 32, 33, 34, 35, 36, 37, 38, 39], "count": 38, "cours": [23, 27, 30, 31], "covari": [5, 11, 28, 32], "cover": 31, "creat": [16, 20], "creator": [], "critic": 26, "cross": [6, 25, 35, 36, 37], "custom": 21, "cython": 31, "d": [25, 26], "dark": [], "data": [0, 1, 3, 6, 7, 9, 11, 15, 17, 18, 21, 23, 28, 31, 32, 36, 37, 38, 39], "dataset": [1, 3, 18, 39], "david": 31, "deadlin": [25, 26, 31], "deadllin": 29, "decai": [2, 34], "decis": [9, 10], "decomposit": [5, 11, 24, 32, 33], "deeep": [], "deep": [1, 2, 31, 34, 36, 37, 38, 39], "defin": [1, 31, 38, 39], "definit": [19, 38, 39], "deflist": [], "degre": [0, 17, 32], "deliver": [15, 16, 19, 20, 25, 26], "deliveri": [25, 26], "delta": 35, "dens": 0, "depend": [], "depth": 26, "deriv": [5, 12, 16, 17, 19, 32, 33, 34, 35, 38, 39], "descent": [2, 10, 13, 18, 25, 33, 34, 37], "design": 32, "detail": [3, 31], "develop": [1, 39], "diagon": 11, "differ": [8, 26, 34], "differenti": [2, 13, 34, 38], "diffus": 2, "dimens": 34, "dimension": [2, 3, 8, 18], "direct": [], "disadvantag": 9, "discret": 28, "discrimin": 31, "discuss": 37, "distribut": [5, 28, 35], "do": [1, 34, 37, 39], "document": 20, "doe": [32, 33, 37], "domain": 28, "down": [1, 39], "dropout": [1, 39], "e": [25, 26], "each": [21, 36], "economi": [32, 33], "electron": [25, 26], "element": [0, 28, 31], "elimin": 24, "elu": 39, "empir": 34, "energi": 31, "ensembl": 10, "entri": [38, 39], "entropi": [9, 36, 37], "environ": [0, 15], "equat": [0, 2, 12, 32, 33, 36, 37, 38, 39], "error": [0, 10, 31, 32, 33, 35, 36], "essenti": 31, "estim": 35, "et": 34, "etc": 31, "euler": 2, "evalu": [1, 26, 38, 39], "evid": 34, "exampl": [1, 2, 3, 4, 6, 7, 8, 9, 10, 31, 32, 33, 34, 35, 36, 37, 38, 39], "exercis": [0, 6, 15, 16, 17, 18, 19, 20, 21, 22, 32, 38], "expect": [19, 28, 35], "expens": [35, 36], "experi": 28, "explicit": [38, 39], "explod": 39, "explor": 0, "exponenti": [2, 34], "express": [16, 17, 19, 32, 36, 37, 38, 39], "extend": [33, 36, 37, 38], "extrapol": 4, "extrem": [10, 31], "ey": 10, "f": [25, 26], "fall": 29, "famili": [1, 31, 39], "famou": 24, "fantast": [32, 33], "faq": [], "featur": [9, 16, 24, 32], "februari": [], "feed": [1, 12, 22, 37, 38, 39], "figur": 20, "file": [], "fill": [], "final": [12, 32, 34, 38, 39], "find": [16, 18, 35], "fine": [1, 39], "first": [4, 12, 31, 33, 38, 39], "fit": [0, 10, 15, 16, 31, 33], "fix": [32, 33, 34], "float": 38, "fold": [35, 36], "forc": 3, "forest": 10, "form": 18, "format": [25, 26, 31], "formula": 18, "forward": [1, 2, 12, 22, 37, 38, 39], "foster": 31, "fourier": 3, "frank": 6, "freedom": [0, 17, 32], "frequent": [32, 34], "frequentist": [0, 31], "from": [5, 10, 12, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39], "full": [2, 34, 39], "function": [0, 1, 6, 7, 8, 10, 11, 12, 13, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39], "funtion": 39, "further": [3, 5, 32, 33], "g": [25, 26], "gan": 4, "gate": [37, 39], "gaussian": 24, "gd": [13, 34], "gener": [4, 9, 31, 36, 37, 38], "geometr": [11, 33], "get": [20, 38], "gini": 9, "github": 15, "glorot": 39, "goal": [15, 16, 17, 18, 19, 20], "good": [0, 20, 31], "goodfellow": 34, "gotthard": [], "grade": [29, 31], "gradient": [1, 2, 10, 13, 18, 22, 25, 26, 33, 34, 37, 38, 39], "greativ": [], "group": 36, "growth": 2, "guid": [], "h": 25, "ha": 23, "hand": [22, 38, 39], "handl": [24, 31], "happen": [35, 36], "hessian": [32, 33, 34], "hidden": [2, 38, 39], "high": [], "histogram": 35, "histori": [], "homogen": 39, "hous": [], "how": 16, "hyperbol": [37, 39], "hyperparamet": [1, 17, 39], "hyperplan": 8, "i": [0, 1, 31, 39], "id3": 9, "idea": 11, "ideal": 33, "ident": 35, "identifi": 35, "ii": 31, "iid": 35, "illustr": [33, 37, 38], "implement": [1, 16, 17, 18, 26, 39], "implic": [5, 32, 33], "import": [5, 24, 31, 32, 33, 38, 39], "improv": [1, 34, 39], "includ": [13, 25, 26, 34, 36, 37, 38], "incorpor": [], "increment": 11, "independ": 35, "index": 9, "inform": 29, "ingredi": 38, "init": 39, "input": [2, 21, 22, 38, 39], "insight": 39, "instal": [23, 25, 31], "instructor": 29, "intermedi": 38, "interpret": [5, 11, 19, 31, 32, 33, 35], "interv": 35, "introduc": [11, 13, 32], "introduct": [0, 6, 20, 23, 24, 25, 26, 31, 37, 38], "invers": [5, 24], "invert": [32, 33], "ipython": [], "iter": 10, "its": 32, "j": [], "jacobian": 32, "januari": [], "jax": 13, "job": 37, "julia": 31, "jungl": 10, "jupyt": [], "k": [35, 36, 38, 39], "kera": [1, 3, 39], "kernel": [8, 11], "l": [38, 39], "lab": [33, 34, 35, 36, 37, 38, 39], "lagrangian": 8, "lasso": [5, 6, 25, 32, 33], "last": [32, 34, 37, 38, 39], "later": [5, 32, 33], "layer": [1, 2, 3, 12, 21, 22, 38, 39], "layout": [38, 39], "learn": [0, 1, 2, 11, 13, 14, 15, 16, 17, 18, 19, 20, 23, 25, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39], "least": [5, 6, 16, 19, 25, 26, 31, 32, 33, 34], "lectur": [31, 33, 34, 35, 36, 37, 38, 39], "level": 10, "librari": [23, 26, 31], "licens": [], "light": [], "likelihood": [7, 35, 36, 37], "limit": [1, 13, 28, 33, 34, 35, 39], "linear": [0, 8, 13, 15, 24, 31, 32, 33, 36], "link": [5, 11, 30, 32, 35], "list": [38, 39], "literatur": [25, 26], "logist": [7, 31, 36, 37, 39], "loss": [32, 33, 34], "lu": 24, "ma": [], "machin": [0, 8, 13, 23, 25, 26, 31, 33, 36, 37], "machineri": 26, "made": 35, "main": [28, 31], "make": [0, 9, 10, 20, 32], "mani": [10, 12], "markdown": [], "mask": [], "maskedarrai": [], "mass": 31, "materi": [25, 26, 31, 32, 33, 34, 35, 36, 38, 39], "math": [5, 32, 33], "mathemat": [3, 5, 8, 32, 33, 37, 38, 39], "matplotlib": [], "matric": [5, 24, 31], "matrix": [1, 5, 11, 12, 16, 24, 31, 32, 33, 34, 37, 39], "matter": 0, "max": 32, "maximum": [35, 36, 37], "me": [], "mean": [0, 32, 33, 36], "measur": 37, "meet": [5, 10, 28, 31, 32], "memori": 34, "mercer": 8, "metadata": [], "method": [6, 9, 10, 13, 25, 26, 31, 33, 34, 35, 36, 37, 39], "metric": 19, "midnight": [25, 26], "min": 32, "mini": 34, "minibatch": 34, "minim": [31, 36, 37], "mit": [], "ml": 31, "mle": 35, "mlp": 12, "mnist": [3, 4], "mode": 38, "model": [0, 1, 4, 6, 12, 15, 17, 31, 37, 38, 39], "moment": 34, "momentum": [13, 25, 34], "mondai": [33, 34, 35, 37, 38], "moon": [8, 9], "more": [3, 6, 24, 25, 31, 32, 33, 34, 35, 36, 37, 38, 39], "motiv": 34, "move": 34, "multi": [37, 38, 39], "multiclass": 39, "multilay": [12, 37, 38], "multipl": [1, 3, 17, 21, 39], "multipli": 8, "multivari": 38, "myst": [], "ncsa": [], "need": [25, 31], "network": [1, 2, 3, 4, 7, 12, 26, 31, 34, 36, 37, 38, 39], "neural": [1, 2, 3, 4, 7, 12, 26, 31, 34, 37, 38, 39], "neuron": [37, 38], "new": [4, 18, 35, 38], "newton": [33, 34, 36, 37], "nn": [38, 39], "node": [38, 39], "noeds": 39, "non": [8, 34], "none": 34, "norm": 26, "normal": [0, 1, 35, 39], "notat": [12, 37], "note": [25, 26, 32, 33], "notebook": [], "novemb": 26, "now": [1, 9, 13, 33, 34, 35, 36], "nuclear": [0, 31], "nueral": 36, "numba": 31, "number": [0, 2, 22, 28, 32, 34, 38], "numer": [2, 25, 26, 28], "numpi": [24, 31], "object": [3, 22, 39], "observ": [38, 39], "obtain": 11, "octob": [25, 38, 39], "od": 2, "off": [6, 19, 25], "ol": [5, 6, 15, 16, 18, 25, 33, 35], "onc": 21, "one": [2, 12, 18, 22, 33, 38, 39], "ones": [37, 39], "open": [], "oper": [24, 38], "optim": [1, 8, 13, 18, 23, 31, 32, 33, 34, 36, 37, 38, 39], "option": [21, 22, 26], "order": [13, 18, 34], "ordinari": [5, 6, 16, 19, 25, 31, 32, 33, 34], "organ": [0, 31], "orient": [22, 39], "oslo": 30, "other": [4, 9, 11, 12, 24, 25, 26, 31, 37, 38, 39], "ouput": [38, 39], "our": [0, 4, 5, 11, 13, 25, 26, 31, 32, 33, 36, 37, 39], "outcom": [23, 31], "output": [2, 38, 39], "over": [38, 39], "overarch": [0, 4, 8, 9, 21, 22, 31, 32, 38], "overview": [10, 31, 34], "own": [0, 10, 11, 25, 26, 31, 32], "packag": [24, 31], "panda": [31, 32], "paper": 39, "parallel": 38, "paramet": [31, 32, 36, 37, 38, 39], "paramt": 18, "part": [13, 23, 25, 26, 33, 36, 37, 38, 39], "partial": 2, "pass": [1, 22, 39], "pca": 11, "pdf": 28, "percepetron": [38, 39], "perceptron": [12, 37, 38, 39], "perform": [1, 9, 39], "period": 3, "perspect": [1, 39], "pitaya": [], "plan": [32, 33, 34, 35, 36, 38], "plethora": 31, "plot": [35, 36], "point": [4, 38], "poisson": 2, "polici": [], "polynomi": [3, 16, 18, 33], "popul": 2, "popular": 31, "practic": [13, 29, 31, 34], "pre": [1, 3, 39], "preambl": [25, 26], "predict": [4, 21], "predictor": [36, 37], "preprocess": [32, 34], "prerequisit": [3, 23, 31], "present": 20, "princip": 11, "principl": 3, "pro": [9, 34], "probabl": [5, 28, 35], "problem": [1, 2, 13, 31, 32, 33, 34, 36, 37, 38, 39], "procedur": [9, 31], "process": [1, 3, 21, 39], "program": [2, 13, 25, 26, 33, 34, 38], "project": [6, 20, 25, 26, 29, 31], "prop": 13, "propag": [1, 12, 38, 39], "properti": [5, 28, 32, 33, 34, 36], "python": [0, 9, 15, 23, 24, 31], "quick": 8, "quickli": [], "r": 31, "random": [10, 11, 28], "raphson": [33, 36, 37], "rate": [25, 34, 39], "read": [9, 31, 32, 34, 35, 36, 37, 38, 39], "real": [6, 21, 31, 38], "recommend": [31, 32, 39], "record": [], "recurr": [4, 12, 37, 38], "reduc": [0, 32, 38], "reduct": 3, "refer": [25, 26], "referenc": 20, "reformul": 2, "regress": [0, 5, 6, 7, 9, 10, 13, 15, 17, 18, 19, 25, 26, 31, 32, 33, 34, 35, 36, 37], "regular": [1, 39], "relat": [], "relev": [30, 32, 37, 39], "relu": [1, 39], "remark": 3, "remind": [6, 8, 26, 31, 32, 33, 34, 38, 39], "replac": [13, 34], "report": [20, 25, 26], "repositori": [15, 35, 36], "requir": [2, 23, 26], "resampl": [6, 19, 25, 35, 36], "rescal": [6, 32], "residu": [32, 33], "resourc": 2, "result": [32, 33, 38, 39], "revers": 38, "revis": [], "revisit": [13, 33, 34, 36, 37], "rewrit": [31, 32, 35], "rewritten": [36, 37], "ridg": [0, 5, 6, 17, 18, 19, 25, 32, 33, 34], "rm": 13, "rmsprop": 34, "role": [], "root": 39, "rule": [12, 34, 38, 39], "rung": 25, "same": [13, 34, 35, 36], "sampl": 11, "scalabl": 34, "scale": [17, 18, 19, 32, 34], "schedul": [31, 39], "schemat": 9, "scheme": 2, "scienc": 31, "scikit": [0, 1, 11, 31, 32, 33, 34, 35, 36, 37, 39], "second": [13, 18, 34], "select": 36, "semest": 29, "sensit": 33, "septemb": [19, 33, 34, 35, 36, 37], "seriou": 38, "session": [33, 34, 35, 36, 37, 38, 39], "set": [0, 2, 3, 9, 12, 15, 27, 31, 32, 33, 38, 39], "setup": 15, "sgd": [13, 34], "should": [1, 26, 39], "show": [], "sigmoid": 39, "similar": [13, 34], "simpl": [0, 4, 9, 13, 18, 31, 32, 33, 34, 36, 38, 39], "simpler": 38, "simplest": 18, "singl": [10, 37, 38], "singular": [5, 11, 32, 33], "size": [32, 33, 34], "sklearn": 16, "slightli": 34, "smarter": 38, "smoothi": [], "sneak": 34, "soft": 8, "softmax": [1, 39], "softwar": [25, 26, 31], "solv": [2, 33, 36, 37], "solver": 13, "some": [13, 24, 32, 33, 36, 38], "sourc": [], "specifi": 2, "speed": 34, "sphinx": [], "split": [0, 15, 32], "squar": [0, 5, 6, 10, 16, 19, 25, 31, 32, 33, 34], "standard": [13, 32, 35], "start": [20, 37], "state": 0, "statist": [5, 6, 23, 28, 31, 35, 36], "steepest": [10, 13, 33], "step": [34, 35, 36], "stochast": [13, 25, 28, 34], "stop": 34, "strongli": [31, 34], "structur": [], "studi": 37, "suggest": [31, 37], "sum": [35, 36, 38, 39], "summari": [26, 29, 31], "superposit": 3, "supervis": [1, 39], "support": 8, "svd": [5, 32, 33], "synthet": [18, 36, 37], "systemat": 3, "t": 32, "take": 16, "taken": [31, 34], "teach": 29, "teacher": [29, 31], "team": [], "technic": 32, "techniqu": [6, 11, 25], "technologi": 23, "tensorflow": [1, 3, 39], "tent": [29, 31], "term": [35, 38, 39], "test": [0, 1, 15, 17, 26, 32, 39], "texmath": [], "text": 31, "textbook": [30, 31], "than": 33, "thank": [], "theorem": [5, 8, 11, 12, 28, 35, 38], "theoret": 34, "theori": 28, "theta": [18, 35], "thi": [21, 22, 31, 38], "three": [38, 39], "through": 38, "time": 34, "tip": [13, 34], "todo": [], "togeth": [12, 38, 39], "tool": [25, 26, 31], "top": [1, 39], "topic": 31, "toward": 11, "trade": [6, 19, 25], "tradeoff": [6, 35, 36], "train": [0, 1, 4, 15, 21, 22, 31, 32, 38, 39], "transform": 3, "translat": [], "tree": [9, 10], "tuesdai": [33, 37, 38, 39], "tune": [1, 39], "two": [3, 8, 22, 23, 26, 36, 37, 38, 39], "type": [2, 4, 12, 31, 37, 38], "uio": 31, "understand": [22, 35, 36], "univers": [12, 30, 38], "unsupervis": 14, "up": [0, 2, 9, 12, 15, 26, 31, 32, 33, 35, 36, 38, 39], "updat": [25, 34, 38, 39], "us": [0, 1, 2, 3, 7, 13, 16, 18, 19, 22, 23, 25, 26, 31, 32, 33, 34, 36, 37, 38, 39], "usag": [34, 39], "v": [3, 34], "valid": [6, 25, 35, 36], "valu": [5, 11, 19, 28, 32, 33, 35, 36], "vanish": 39, "vari": 34, "variabl": [28, 33], "varianc": [6, 19, 25, 35, 36], "variou": [0, 26, 35, 36], "vector": [8, 12, 16, 24, 31, 32, 37], "versu": 31, "video": [34, 35, 36, 37, 38, 39], "view": [0, 4, 10, 32, 38], "virtual": 15, "visual": [1, 9, 39], "wai": [9, 25, 35, 36, 38], "warm": 26, "wave": 2, "we": [31, 34, 38, 39], "wednesdai": [33, 37, 38, 39], "week": [15, 16, 17, 18, 19, 20, 21, 22, 31, 32, 33, 34, 35, 36, 37, 38, 39], "weekli": [], "weight": 39, "welcom": [], "what": [0, 31, 32, 33, 35, 36], "when": 34, "which": [1, 34, 39], "why": [31, 34, 35, 36, 37, 38], "wisconsin": 7, "word": 38, "workflow": [], "wrap": 35, "write": [4, 11, 20, 22, 25, 26, 33, 39], "x": 32, "xgboost": 10, "xor": [37, 39], "yaml": [], "yet": 33, "you": 26, "your": [0, 10, 16, 18, 25, 26, 32], "z_j": [38, 39]}})
\ No newline at end of file
+Search.setIndex({"alltitles": {"1a)": [[18, "a"]], "3a)": [[18, "id1"]], "3b)": [[18, "b"]], "4a)": [[18, "id2"]], "4b)": [[18, "id3"]], "A Classification Tree": [[9, "a-classification-tree"]], "A Frequentist approach to data analysis": [[0, "a-frequentist-approach-to-data-analysis"], [32, "a-frequentist-approach-to-data-analysis"]], "A better approach": [[8, "a-better-approach"]], "A first summary": [[32, "a-first-summary"]], "A more compact expression": [[37, "a-more-compact-expression"], [38, "a-more-compact-expression"]], "A new Cost Function": [[36, "a-new-cost-function"]], "A possible implementation of a neural network": [[41, "a-possible-implementation-of-a-neural-network"]], "A quick Reminder on Lagrangian Multipliers": [[8, "a-quick-reminder-on-lagrangian-multipliers"]], "A simple example": [[4, "a-simple-example"]], "A soft classifier": [[8, "a-soft-classifier"]], "A top-down perspective on Neural networks": [[1, "a-top-down-perspective-on-neural-networks"], [40, "a-top-down-perspective-on-neural-networks"]], "A way to Read the Bias-Variance Tradeoff": [[36, "a-way-to-read-the-bias-variance-tradeoff"], [37, "a-way-to-read-the-bias-variance-tradeoff"]], "ADAM algorithm, taken from Goodfellow et al": [[35, "adam-algorithm-taken-from-goodfellow-et-al"]], "ADAM optimizer": [[13, "adam-optimizer"], [35, "id2"]], "Accuracy": [[35, "accuracy"]], "Activation functions": [[12, "activation-functions"], [38, "activation-functions"], [40, "activation-functions"], [40, "id3"], [41, "activation-functions"], [41, "id1"]], "Activation functions, Logistic and Hyperbolic ones": [[38, "activation-functions-logistic-and-hyperbolic-ones"], [40, "activation-functions-logistic-and-hyperbolic-ones"]], "Activation functions, examples": [[41, "activation-functions-examples"]], "AdaGrad Properties": [[35, "adagrad-properties"]], "AdaGrad Update Rule Derivation": [[35, "adagrad-update-rule-derivation"]], "AdaGrad algorithm, taken from Goodfellow et al": [[35, "adagrad-algorithm-taken-from-goodfellow-et-al"]], "Adam Optimizer": [[35, "adam-optimizer"]], "Adam vs. AdaGrad and RMSProp": [[35, "adam-vs-adagrad-and-rmsprop"]], "Adam: Bias Correction": [[35, "adam-bias-correction"]], "Adam: Exponential Moving Averages (Moments)": [[35, "adam-exponential-moving-averages-moments"]], "Adam: Update Rule Derivation": [[35, "adam-update-rule-derivation"]], "Adaptive boosting: AdaBoost, Basic Algorithm": [[10, "adaptive-boosting-adaboost-basic-algorithm"]], "Adaptivity Across Dimensions": [[35, "adaptivity-across-dimensions"]], "Adding Neural Networks": [[38, "adding-neural-networks"]], "Adding a hidden layer": [[39, "adding-a-hidden-layer"], [40, "adding-a-hidden-layer"]], "Adding error analysis and training set up": [[32, "adding-error-analysis-and-training-set-up"], [33, "adding-error-analysis-and-training-set-up"]], "Adjust hyperparameters": [[1, "adjust-hyperparameters"], [40, "adjust-hyperparameters"]], "Algorithms and codes for Adagrad, RMSprop and Adam": [[35, "algorithms-and-codes-for-adagrad-rmsprop-and-adam"]], "Algorithms for Setting up Decision Trees": [[9, "algorithms-for-setting-up-decision-trees"]], "An Overview of Ensemble Methods": [[10, "an-overview-of-ensemble-methods"]], "An extrapolation example": [[4, "an-extrapolation-example"]], "An optimization/minimization problem": [[32, "an-optimization-minimization-problem"]], "Analyzing the last results": [[39, "analyzing-the-last-results"], [40, "analyzing-the-last-results"]], "And a similar example using Tensorflow with Keras": [[41, "and-a-similar-example-using-tensorflow-with-keras"]], "And finally \\boldsymbol{X}\\boldsymbol{X}^T": [[33, "and-finally-boldsymbol-x-boldsymbol-x-t"]], "And finally ADAM": [[35, "and-finally-adam"]], "And what about using neural networks?": [[32, "and-what-about-using-neural-networks"]], "Another Example from Scikit-Learn\u2019s Repository": [[36, "another-example-from-scikit-learn-s-repository"], [37, "another-example-from-scikit-learn-s-repository"]], "Another Example, now with a polynomial fit": [[34, "another-example-now-with-a-polynomial-fit"]], "Another example, the moons again": [[9, "another-example-the-moons-again"]], "Applied Data Analysis and Machine Learning": [[24, null]], "Artificial neurons": [[38, "artificial-neurons"], [39, "artificial-neurons"]], "Assumptions made": [[36, "assumptions-made"]], "Autocorrelation function": [[29, "autocorrelation-function"]], "Automatic differentiation": [[13, "automatic-differentiation"], [39, "automatic-differentiation"]], "Automatic differentiation through examples": [[39, "automatic-differentiation-through-examples"]], "Back propagation": [[41, "back-propagation"]], "Back propagation and automatic differentiation": [[41, "back-propagation-and-automatic-differentiation"]], "Back to Ridge and LASSO Regression": [[33, "back-to-ridge-and-lasso-regression"], [34, "back-to-ridge-and-lasso-regression"]], "Back to the Cancer Data": [[11, "back-to-the-cancer-data"]], "Background literature": [[26, "background-literature"], [27, "background-literature"]], "Bagging": [[10, "bagging"]], "Bagging Examples": [[10, "bagging-examples"]], "Basic Matrix Features": [[25, "basic-matrix-features"]], "Basic ideas of the Principal Component Analysis (PCA)": [[11, null]], "Basic math of the SVD": [[5, "basic-math-of-the-svd"], [33, "basic-math-of-the-svd"], [34, "basic-math-of-the-svd"]], "Basics": [[7, "basics"], [37, "basics"], [38, "basics"]], "Basics of a tree": [[9, "basics-of-a-tree"]], "Basics of an NN": [[39, "basics-of-an-nn"]], "Batch Normalization": [[1, "batch-normalization"], [40, "batch-normalization"]], "Batches and mini-batches": [[35, "batches-and-mini-batches"]], "Bayes\u2019 Theorem and Ridge and Lasso Regression": [[5, "bayes-theorem-and-ridge-and-lasso-regression"]], "Boosting, a Bird\u2019s Eye View": [[10, "boosting-a-bird-s-eye-view"]], "Bootstrap": [[6, "bootstrap"]], "Bringing it together": [[39, "bringing-it-together"], [40, "bringing-it-together"]], "Bringing it together, first back propagation equation": [[12, "bringing-it-together-first-back-propagation-equation"]], "Building a Feed Forward Neural Network": [[1, null]], "Building a neural network code": [[40, "building-a-neural-network-code"]], "Building a tree, regression": [[9, "building-a-tree-regression"]], "Building neural networks in Tensorflow and Keras": [[1, "building-neural-networks-in-tensorflow-and-keras"], [40, "building-neural-networks-in-tensorflow-and-keras"], [41, "building-neural-networks-in-tensorflow-and-keras"]], "Building our own neural network code": [[41, "building-our-own-neural-network-code"]], "But none of these can compete with Newton\u2019s method": [[35, "but-none-of-these-can-compete-with-newton-s-method"]], "CNNs in more detail, building convolutional neural networks in Tensorflow and Keras": [[3, "cnns-in-more-detail-building-convolutional-neural-networks-in-tensorflow-and-keras"]], "Cancer Data again now with Decision Trees and other Methods": [[9, "cancer-data-again-now-with-decision-trees-and-other-methods"]], "Chain rule": [[39, "chain-rule"]], "Chain rule, forward and reverse modes": [[39, "chain-rule-forward-and-reverse-modes"]], "Challenge: Choosing a Fixed Learning Rate": [[35, "challenge-choosing-a-fixed-learning-rate"]], "Choose cost function and optimizer": [[1, "choose-cost-function-and-optimizer"], [40, "choose-cost-function-and-optimizer"]], "Class of functions we can approximate": [[39, "class-of-functions-we-can-approximate"]], "Classical PCA Theorem": [[11, "classical-pca-theorem"]], "Classification and Regression, writing our own neural network code": [[27, "classification-and-regression-writing-our-own-neural-network-code"]], "Classification problems": [[37, "classification-problems"], [38, "classification-problems"]], "Clustering and Unsupervised Learning": [[14, null]], "Code Example for Cross-validation and k-fold Cross-validation": [[36, "code-example-for-cross-validation-and-k-fold-cross-validation"], [37, "code-example-for-cross-validation-and-k-fold-cross-validation"]], "Code example": [[39, "code-example"], [40, "code-example"]], "Code example for the Bootstrap method": [[36, "code-example-for-the-bootstrap-method"]], "Code for SVD and Inversion of Matrices": [[5, "code-for-svd-and-inversion-of-matrices"]], "Code with a Number of Minibatches which varies": [[35, "code-with-a-number-of-minibatches-which-varies"]], "Codes and Approaches": [[14, "codes-and-approaches"]], "Codes for the SVD": [[5, "codes-for-the-svd"], [33, "codes-for-the-svd"], [34, "codes-for-the-svd"]], "Coding Setup and Linear Regression": [[15, "coding-setup-and-linear-regression"]], "Collect and pre-process data": [[1, "collect-and-pre-process-data"], [40, "collect-and-pre-process-data"], [40, "id2"], [41, "collect-and-pre-process-data"]], "Communication channels": [[32, "communication-channels"]], "Compact expressions": [[39, "compact-expressions"], [40, "compact-expressions"]], "Compare Bagging on Trees with Random Forests": [[10, "compare-bagging-on-trees-with-random-forests"]], "Comparing with a numerical scheme": [[2, "comparing-with-a-numerical-scheme"], [41, "comparing-with-a-numerical-scheme"]], "Comparison with OLS": [[34, "comparison-with-ols"]], "Completing the list": [[39, "completing-the-list"], [40, "completing-the-list"]], "Computation of gradients": [[35, "computation-of-gradients"]], "Computing the Gini index": [[9, "computing-the-gini-index"]], "Conditions on convex functions": [[34, "conditions-on-convex-functions"]], "Confidence Intervals": [[36, "confidence-intervals"]], "Confusion Matrix": [[23, "confusion-matrix"]], "Conjugate gradient method": [[13, "conjugate-gradient-method"]], "Convergence rates": [[35, "convergence-rates"]], "Convex function": [[34, "convex-function"]], "Convex functions": [[13, "convex-functions"], [34, "convex-functions"]], "Convolution Examples: Polynomial multiplication": [[3, "convolution-examples-polynomial-multiplication"]], "Convolution Examples: Principle of Superposition and Periodic Forces (Fourier Transforms)": [[3, "convolution-examples-principle-of-superposition-and-periodic-forces-fourier-transforms"]], "Convolutional Neural Network": [[12, "convolutional-neural-network"], [38, "convolutional-neural-network"], [39, "convolutional-neural-network"]], "Convolutional Neural Networks": [[3, null]], "Correlation Function and Design/Feature Matrix": [[33, "correlation-function-and-design-feature-matrix"]], "Correlation Matrix": [[11, "correlation-matrix"], [33, "correlation-matrix"]], "Correlation Matrix with Pandas": [[33, "correlation-matrix-with-pandas"]], "Cost functions": [[40, "cost-functions"], [41, "cost-functions"]], "Counting the number of floating point operations": [[39, "counting-the-number-of-floating-point-operations"]], "Course Format": [[32, "course-format"]], "Course setting": [[28, null]], "Covariance Matrix Examples": [[33, "covariance-matrix-examples"]], "Covariance and Correlation Matrix": [[33, "covariance-and-correlation-matrix"]], "Cross-validation": [[6, "cross-validation"]], "Cross-validation in brief": [[36, "cross-validation-in-brief"], [37, "cross-validation-in-brief"]], "Cumulative Gain": [[23, "cumulative-gain"]], "Deadlines for projects (tentative)": [[32, "deadlines-for-projects-tentative"]], "Decision trees, overarching aims": [[9, null]], "Deep Neural Networks": [[35, "deep-neural-networks"]], "Deep learning methods": [[32, "deep-learning-methods"]], "Define model and architecture": [[1, "define-model-and-architecture"], [40, "define-model-and-architecture"]], "Defining intermediate operations": [[39, "defining-intermediate-operations"]], "Defining the cost function": [[1, "defining-the-cost-function"], [40, "defining-the-cost-function"]], "Defining the problem": [[41, "defining-the-problem"]], "Definitions": [[19, "definitions"], [39, "definitions"], [40, "definitions"]], "Deliverables": [[15, "deliverables"], [16, "deliverables"], [19, "deliverables"], [20, "deliverables"], [26, "deliverables"], [27, "deliverables"]], "Derivation of the AdaGrad Algorithm": [[35, "derivation-of-the-adagrad-algorithm"]], "Derivative of the cost function": [[39, "derivative-of-the-cost-function"], [40, "derivative-of-the-cost-function"]], "Derivatives and the chain rule": [[12, "derivatives-and-the-chain-rule"], [39, "derivatives-and-the-chain-rule"], [40, "derivatives-and-the-chain-rule"]], "Derivatives in terms of z_j^L": [[39, "derivatives-in-terms-of-z-j-l"], [40, "derivatives-in-terms-of-z-j-l"]], "Derivatives of the hidden layer": [[39, "derivatives-of-the-hidden-layer"], [40, "derivatives-of-the-hidden-layer"]], "Derivatives, example 1": [[33, "derivatives-example-1"]], "Deriving OLS from a probability distribution": [[5, "deriving-ols-from-a-probability-distribution"], [36, "deriving-ols-from-a-probability-distribution"]], "Deriving and Implementing Ordinary Least Squares": [[16, "deriving-and-implementing-ordinary-least-squares"]], "Deriving and Implementing Ridge Regression": [[17, "deriving-and-implementing-ridge-regression"]], "Deriving the Lasso Regression Equations": [[33, "deriving-the-lasso-regression-equations"], [34, "deriving-the-lasso-regression-equations"], [34, "id6"]], "Deriving the Ridge Regression Equations": [[33, "deriving-the-ridge-regression-equations"], [34, "deriving-the-ridge-regression-equations"], [34, "id3"]], "Deriving the back propagation code for a multilayer perceptron model": [[12, "deriving-the-back-propagation-code-for-a-multilayer-perceptron-model"]], "Developing a code for doing neural networks with back propagation": [[1, "developing-a-code-for-doing-neural-networks-with-back-propagation"], [40, "developing-a-code-for-doing-neural-networks-with-back-propagation"]], "Diagonalize the sample covariance matrix to obtain the principal components": [[11, "diagonalize-the-sample-covariance-matrix-to-obtain-the-principal-components"]], "Different kernels and Mercer\u2019s theorem": [[8, "different-kernels-and-mercer-s-theorem"]], "Disadvantages": [[9, "disadvantages"]], "Discriminative Modeling": [[32, "discriminative-modeling"]], "Discussing the correlation data": [[38, "discussing-the-correlation-data"]], "Does Logistic Regression do a better Job?": [[38, "does-logistic-regression-do-a-better-job"]], "Domains and probabilities": [[29, "domains-and-probabilities"]], "Dropout": [[1, "dropout"], [40, "dropout"]], "ELU function": [[40, "elu-function"], [41, "elu-function"]], "Economy-size SVD": [[33, "economy-size-svd"], [34, "economy-size-svd"]], "Elements of Probability Theory and Statistical Data Analysis": [[29, null]], "Empirical Evidence: Convergence Time and Memory in Practice": [[35, "empirical-evidence-convergence-time-and-memory-in-practice"]], "Ensemble Methods: From a Single Tree to Many Trees and Extreme Boosting, Meet the Jungle of Methods": [[10, null]], "Entropy and the ID3 algorithm": [[9, "entropy-and-the-id3-algorithm"]], "Essential elements of ML": [[32, "essential-elements-of-ml"]], "Evaluate model performance on test data": [[1, "evaluate-model-performance-on-test-data"], [40, "evaluate-model-performance-on-test-data"]], "Example 2": [[33, "example-2"]], "Example 3": [[33, "example-3"]], "Example 4": [[33, "example-4"]], "Example Matrix": [[33, "example-matrix"], [34, "example-matrix"]], "Example code for Bias-Variance tradeoff": [[36, "example-code-for-bias-variance-tradeoff"]], "Example code for Logistic Regression": [[37, "example-code-for-logistic-regression"], [38, "example-code-for-logistic-regression"]], "Example of discriminative modeling, taken from Generative Deep Learning by David Foster": [[32, "example-of-discriminative-modeling-taken-from-generative-deep-learning-by-david-foster"]], "Example of generative modeling, taken from Generative Deep Learning by David Foster": [[32, "example-of-generative-modeling-taken-from-generative-deep-learning-by-david-foster"]], "Example of own Standard scaling": [[33, "example-of-own-standard-scaling"]], "Example relevant for the exercises": [[33, "example-relevant-for-the-exercises"]], "Example: Exponential decay": [[2, "example-exponential-decay"], [41, "example-exponential-decay"]], "Example: Population growth": [[2, "example-population-growth"], [41, "example-population-growth"]], "Example: Solving the one dimensional Poisson equation": [[41, "example-solving-the-one-dimensional-poisson-equation"]], "Example: Solving the wave equation with Neural Networks": [[41, "example-solving-the-wave-equation-with-neural-networks"]], "Example: The diffusion equation": [[2, "example-the-diffusion-equation"], [41, "example-the-diffusion-equation"]], "Example: binary classification problem": [[1, "example-binary-classification-problem"], [40, "example-binary-classification-problem"]], "Examples": [[32, "examples"]], "Examples of XOR, OR and AND gates": [[38, "examples-of-xor-or-and-and-gates"]], "Examples of likelihood functions used in logistic regression and neural networks": [[7, "examples-of-likelihood-functions-used-in-logistic-regression-and-neural-networks"]], "Examples of likelihood functions used in logistic regression and nueral networks": [[37, "examples-of-likelihood-functions-used-in-logistic-regression-and-nueral-networks"]], "Exercise 1": [[21, "exercise-1"]], "Exercise 1 - Choice of model and degrees of freedom": [[17, "exercise-1-choice-of-model-and-degrees-of-freedom"]], "Exercise 1 - Finding the derivative of Matrix-Vector expressions": [[16, "exercise-1-finding-the-derivative-of-matrix-vector-expressions"]], "Exercise 1 - Github Setup": [[15, "exercise-1-github-setup"]], "Exercise 1 - Understand the feed forward pass": [[22, "exercise-1-understand-the-feed-forward-pass"]], "Exercise 1, scale your data": [[18, "exercise-1-scale-your-data"]], "Exercise 1: Creating the report document": [[20, "exercise-1-creating-the-report-document"]], "Exercise 1: Expectation values for ordinary least squares expressions": [[19, "exercise-1-expectation-values-for-ordinary-least-squares-expressions"]], "Exercise 1: Including more data": [[39, "exercise-1-including-more-data"]], "Exercise 1: Setting up various Python environments": [[0, "exercise-1-setting-up-various-python-environments"]], "Exercise 2": [[21, "exercise-2"]], "Exercise 2 - Deriving the expression for OLS": [[16, "exercise-2-deriving-the-expression-for-ols"]], "Exercise 2 - Deriving the expression for Ridge Regression": [[17, "exercise-2-deriving-the-expression-for-ridge-regression"]], "Exercise 2 - Gradient with one layer using autograd": [[22, "exercise-2-gradient-with-one-layer-using-autograd"]], "Exercise 2 - Setting up a Github repository": [[15, "exercise-2-setting-up-a-github-repository"]], "Exercise 2, calculate the gradients": [[18, "exercise-2-calculate-the-gradients"]], "Exercise 2: Adding good figures": [[20, "exercise-2-adding-good-figures"]], "Exercise 2: Expectation values for Ridge regression": [[19, "exercise-2-expectation-values-for-ridge-regression"]], "Exercise 2: Extended program": [[39, "exercise-2-extended-program"]], "Exercise 2: making your own data and exploring scikit-learn": [[0, "exercise-2-making-your-own-data-and-exploring-scikit-learn"]], "Exercise 3": [[21, "exercise-3"]], "Exercise 3 - Creating feature matrix and implementing OLS using the analytical expression": [[16, "exercise-3-creating-feature-matrix-and-implementing-ols-using-the-analytical-expression"]], "Exercise 3 - Fitting an OLS model to data": [[15, "exercise-3-fitting-an-ols-model-to-data"]], "Exercise 3 - Gradient with one layer writing backpropagation by hand": [[22, "exercise-3-gradient-with-one-layer-writing-backpropagation-by-hand"]], "Exercise 3 - Scaling data": [[17, "exercise-3-scaling-data"]], "Exercise 3 - Setting up a Python virtual environment": [[15, "exercise-3-setting-up-a-python-virtual-environment"]], "Exercise 3, using the analytical formulae for OLS and Ridge regression to find the optimal paramters \\boldsymbol{\\theta}": [[18, "exercise-3-using-the-analytical-formulae-for-ols-and-ridge-regression-to-find-the-optimal-paramters-boldsymbol-theta"]], "Exercise 3: Deriving the expression for the Bias-Variance Trade-off": [[19, "exercise-3-deriving-the-expression-for-the-bias-variance-trade-off"]], "Exercise 3: Normalizing our data": [[0, "exercise-3-normalizing-our-data"]], "Exercise 3: Writing an abstract and introduction": [[20, "exercise-3-writing-an-abstract-and-introduction"]], "Exercise 4 - Custom activation for each layer": [[21, "exercise-4-custom-activation-for-each-layer"]], "Exercise 4 - Fitting a polynomial": [[16, "exercise-4-fitting-a-polynomial"]], "Exercise 4 - Gradient with two layers writing backpropagation by hand": [[22, "exercise-4-gradient-with-two-layers-writing-backpropagation-by-hand"]], "Exercise 4 - Implementing Ridge Regression": [[17, "exercise-4-implementing-ridge-regression"]], "Exercise 4 - Testing multiple hyperparameters": [[17, "exercise-4-testing-multiple-hyperparameters"]], "Exercise 4 - The train-test split": [[15, "exercise-4-the-train-test-split"]], "Exercise 4, Implementing the simplest form for gradient descent": [[18, "exercise-4-implementing-the-simplest-form-for-gradient-descent"]], "Exercise 4: Adding Ridge Regression": [[0, "exercise-4-adding-ridge-regression"]], "Exercise 4: Computing the Bias and Variance": [[19, "exercise-4-computing-the-bias-and-variance"]], "Exercise 4: Making the code available and presentable": [[20, "exercise-4-making-the-code-available-and-presentable"]], "Exercise 5 - Comparing your code with sklearn": [[16, "exercise-5-comparing-your-code-with-sklearn"]], "Exercise 5 - Gradient with any number of layers writing backpropagation by hand": [[22, "exercise-5-gradient-with-any-number-of-layers-writing-backpropagation-by-hand"]], "Exercise 5 - Processing multiple inputs at once": [[21, "exercise-5-processing-multiple-inputs-at-once"]], "Exercise 5, Ridge regression and a new Synthetic Dataset": [[18, "exercise-5-ridge-regression-and-a-new-synthetic-dataset"]], "Exercise 5: Analytical exercises": [[0, "exercise-5-analytical-exercises"]], "Exercise 5: Interpretation of scaling and metrics": [[19, "exercise-5-interpretation-of-scaling-and-metrics"]], "Exercise 5: Referencing": [[20, "exercise-5-referencing"]], "Exercise 6 - Batched inputs": [[22, "exercise-6-batched-inputs"]], "Exercise 6 - Predicting on real data": [[21, "exercise-6-predicting-on-real-data"]], "Exercise 7 - Training": [[22, "exercise-7-training"]], "Exercise 7 - Training on real data (Optional)": [[21, "exercise-7-training-on-real-data-optional"]], "Exercise 8 (Optional) - Object orientation": [[22, "exercise-8-optional-object-orientation"]], "Exercise a)": [[23, "exercise-a"]], "Exercise b)": [[23, "exercise-b"]], "Exercise c) week 43": [[23, "exercise-c-week-43"]], "Exercise: Cross-validation as resampling techniques, adding more complexity": [[6, "exercise-cross-validation-as-resampling-techniques-adding-more-complexity"]], "Exercise: Analysis of real data": [[6, "exercise-analysis-of-real-data"]], "Exercise: Bias-variance trade-off and resampling techniques": [[6, "exercise-bias-variance-trade-off-and-resampling-techniques"]], "Exercise: Lasso Regression on the Franke function with resampling": [[6, "exercise-lasso-regression-on-the-franke-function-with-resampling"]], "Exercise: Ordinary Least Square (OLS) on the Franke function": [[6, "exercise-ordinary-least-square-ols-on-the-franke-function"]], "Exercise: Ridge Regression on the Franke function with resampling": [[6, "exercise-ridge-regression-on-the-franke-function-with-resampling"]], "Exercises": [[0, "exercises"], [23, "exercises"]], "Exercises and Projects": [[6, "exercises-and-projects"]], "Exercises and lab session week 43": [[41, "exercises-and-lab-session-week-43"]], "Exercises week 34": [[15, null]], "Exercises week 35": [[16, null]], "Exercises week 36": [[17, null]], "Exercises week 37": [[18, null]], "Exercises week 38": [[19, null]], "Exercises week 39": [[20, null]], "Exercises week 41": [[21, null]], "Exercises week 42": [[22, null]], "Exercises week 43": [[23, null]], "Expectation value and variance": [[36, "expectation-value-and-variance"]], "Expectation value and variance for \\boldsymbol{\\theta}": [[36, "expectation-value-and-variance-for-boldsymbol-theta"]], "Expectation values": [[29, "expectation-values"]], "Explicit derivatives": [[39, "explicit-derivatives"], [40, "explicit-derivatives"]], "Exploding gradients": [[40, "exploding-gradients"]], "Extending to more predictors": [[37, "extending-to-more-predictors"], [38, "extending-to-more-predictors"]], "Extending to more than one variable": [[34, "extending-to-more-than-one-variable"]], "Extremely useful tools, strongly recommended": [[32, "extremely-useful-tools-strongly-recommended"]], "Feed-forward neural networks": [[12, "feed-forward-neural-networks"], [38, "feed-forward-neural-networks"], [39, "feed-forward-neural-networks"]], "Feed-forward pass": [[1, "feed-forward-pass"], [40, "feed-forward-pass"]], "Final back propagating equation": [[12, "final-back-propagating-equation"], [39, "final-back-propagating-equation"], [40, "final-back-propagating-equation"]], "Final derivatives": [[39, "final-derivatives"]], "Final expression": [[39, "final-expression"], [40, "final-expression"]], "Final expressions for the biases of the hidden layer": [[39, "final-expressions-for-the-biases-of-the-hidden-layer"], [40, "final-expressions-for-the-biases-of-the-hidden-layer"]], "Final technicalities I": [[41, "final-technicalities-i"]], "Final technicalities II": [[41, "final-technicalities-ii"]], "Final technicalities III": [[41, "final-technicalities-iii"]], "Final technicalities IV": [[41, "final-technicalities-iv"]], "Finding the Limit": [[36, "finding-the-limit"]], "Fine-tuning neural network hyperparameters": [[1, "fine-tuning-neural-network-hyperparameters"], [40, "fine-tuning-neural-network-hyperparameters"]], "First network example, simple percepetron with one input": [[39, "first-network-example-simple-percepetron-with-one-input"]], "Fitting an Equation of State for Dense Nuclear Matter": [[0, "fitting-an-equation-of-state-for-dense-nuclear-matter"]], "Fixing the singularity": [[33, "fixing-the-singularity"], [34, "fixing-the-singularity"]], "Format for electronic delivery of report and programs": [[26, "format-for-electronic-delivery-of-report-and-programs"], [27, "format-for-electronic-delivery-of-report-and-programs"]], "Forward and reverse modes": [[39, "forward-and-reverse-modes"]], "Frequently used scaling functions": [[33, "frequently-used-scaling-functions"], [35, "frequently-used-scaling-functions"]], "From OLS to Ridge and Lasso": [[34, "from-ols-to-ridge-and-lasso"]], "From one to many layers, the universal approximation theorem": [[12, "from-one-to-many-layers-the-universal-approximation-theorem"]], "Full object-oriented implementation": [[40, "full-object-oriented-implementation"]], "Functionality in Scikit-Learn": [[33, "functionality-in-scikit-learn"], [35, "functionality-in-scikit-learn"]], "Further Dimensionality Remarks": [[3, "further-dimensionality-remarks"]], "Further properties (important for our analyses later)": [[5, "further-properties-important-for-our-analyses-later"], [33, "further-properties-important-for-our-analyses-later"], [34, "further-properties-important-for-our-analyses-later"]], "Gaussian Elimination": [[25, "gaussian-elimination"]], "General Features": [[9, "general-features"]], "General linear models and linear algebra": [[32, "general-linear-models-and-linear-algebra"]], "Generalizing the fitting procedure as a linear algebra problem": [[32, "generalizing-the-fitting-procedure-as-a-linear-algebra-problem"], [32, "id1"]], "Generative Adversarial Networks": [[4, "generative-adversarial-networks"]], "Generative Models": [[4, "generative-models"]], "Generative Versus Discriminative Modeling": [[32, "generative-versus-discriminative-modeling"]], "Geometric Interpretation and link with Singular Value Decomposition": [[11, "geometric-interpretation-and-link-with-singular-value-decomposition"]], "Getting serious, the back propagation equations for a neural network": [[39, "getting-serious-the-back-propagation-equations-for-a-neural-network"]], "Getting started with project 1": [[20, "getting-started-with-project-1"]], "Gradient Boosting, Classification Example": [[10, "gradient-boosting-classification-example"]], "Gradient Boosting, Examples of Regression": [[10, "gradient-boosting-examples-of-regression"]], "Gradient Clipping": [[1, "gradient-clipping"], [40, "gradient-clipping"]], "Gradient Descent Example": [[34, "id1"], [35, "id1"]], "Gradient boosting: Basics with Steepest Descent/Functional Gradient Descent": [[10, "gradient-boosting-basics-with-steepest-descent-functional-gradient-descent"]], "Gradient descent": [[2, "gradient-descent"], [41, "gradient-descent"]], "Gradient descent and Ridge": [[34, "gradient-descent-and-ridge"], [35, "gradient-descent-and-ridge"]], "Gradient descent and revisiting Ordinary Least Squares from last week": [[35, "gradient-descent-and-revisiting-ordinary-least-squares-from-last-week"]], "Gradient descent example": [[34, "gradient-descent-example"], [35, "gradient-descent-example"]], "Gradient expressions": [[39, "gradient-expressions"], [40, "gradient-expressions"]], "Grading": [[30, "grading"], [30, "id2"], [32, "grading"]], "Hidden layers": [[40, "hidden-layers"]], "Homogeneous data": [[40, "homogeneous-data"]], "How to take derivatives of Matrix-Vector expressions": [[16, "how-to-take-derivatives-of-matrix-vector-expressions"]], "Hyperplanes and all that": [[8, "hyperplanes-and-all-that"]], "Identifying Terms": [[36, "identifying-terms"]], "Illustration of a single perceptron model and a multi-perceptron model": [[38, "illustration-of-a-single-perceptron-model-and-a-multi-perceptron-model"], [39, "illustration-of-a-single-perceptron-model-and-a-multi-perceptron-model"]], "Important Matrix and vector handling packages": [[25, "important-matrix-and-vector-handling-packages"]], "Important observations": [[39, "important-observations"], [40, "important-observations"]], "Important technicalities: More on Rescaling data": [[33, "important-technicalities-more-on-rescaling-data"]], "Improving gradient descent with momentum": [[35, "improving-gradient-descent-with-momentum"]], "Improving performance": [[1, "improving-performance"], [40, "improving-performance"]], "In general not this simple": [[39, "in-general-not-this-simple"]], "In summary": [[30, "in-summary"]], "Including Stochastic Gradient Descent with Autograd": [[13, "including-stochastic-gradient-descent-with-autograd"], [35, "including-stochastic-gradient-descent-with-autograd"]], "Including more classes": [[37, "including-more-classes"], [38, "including-more-classes"]], "Incremental PCA": [[11, "incremental-pca"]], "Independent and Identically Distributed (iid)": [[36, "independent-and-identically-distributed-iid"]], "Inputs to the activation function": [[39, "inputs-to-the-activation-function"], [40, "inputs-to-the-activation-function"]], "Insights from the paper by Glorot and Bengio": [[40, "insights-from-the-paper-by-glorot-and-bengio"]], "Installing R, C++, cython or Julia": [[32, "installing-r-c-cython-or-julia"]], "Installing R, C++, cython, Numba etc": [[32, "installing-r-c-cython-numba-etc"]], "Instructor information": [[30, "instructor-information"]], "Interpretations and optimizing our parameters": [[32, "interpretations-and-optimizing-our-parameters"], [32, "id2"], [32, "id3"], [33, "interpretations-and-optimizing-our-parameters"], [33, "id1"], [33, "id2"]], "Interpreting the Ridge results": [[33, "interpreting-the-ridge-results"], [34, "interpreting-the-ridge-results"], [34, "id4"]], "Introducing JAX": [[13, "introducing-jax"]], "Introducing the Covariance and Correlation functions": [[11, "introducing-the-covariance-and-correlation-functions"], [33, "introducing-the-covariance-and-correlation-functions"]], "Introduction": [[0, "introduction"], [6, "introduction"], [24, "introduction"], [25, "introduction"]], "Introduction to Neural networks": [[38, "introduction-to-neural-networks"], [39, "introduction-to-neural-networks"]], "Introduction to numerical projects": [[26, "introduction-to-numerical-projects"], [27, "introduction-to-numerical-projects"]], "Is the Logistic activation function (Sigmoid) our choice?": [[40, "is-the-logistic-activation-function-sigmoid-our-choice"]], "Iterative Fitting, Classification and AdaBoost": [[10, "iterative-fitting-classification-and-adaboost"]], "Iterative Fitting, Regression and Squared-error Cost Function": [[10, "iterative-fitting-regression-and-squared-error-cost-function"]], "Kernel PCA": [[11, "kernel-pca"]], "Kernels and non-linearity": [[8, "kernels-and-non-linearity"]], "LU Decomposition, the inverse of a matrix": [[25, "lu-decomposition-the-inverse-of-a-matrix"]], "Lab sessions Tuesday and Wednesday": [[38, "lab-sessions-tuesday-and-wednesday"]], "Lab sessions on Tuesday and Wednesday": [[39, "lab-sessions-on-tuesday-and-wednesday"]], "Lab sessions week 39": [[37, "lab-sessions-week-39"]], "Lasso Regression": [[34, "lasso-regression"]], "Lasso case": [[34, "lasso-case"]], "Layers": [[1, "layers"], [40, "layers"]], "Layers used to build CNNs": [[3, "layers-used-to-build-cnns"]], "Layout of a neural network with three hidden layers": [[39, "layout-of-a-neural-network-with-three-hidden-layers"]], "Layout of a neural network with three hidden layers (last layer = l=L=4, first layer l=0)": [[40, "layout-of-a-neural-network-with-three-hidden-layers-last-layer-l-l-4-first-layer-l-0"]], "Layout of a simple neural network with no hidden layer": [[39, "layout-of-a-simple-neural-network-with-no-hidden-layer"], [40, "layout-of-a-simple-neural-network-with-no-hidden-layer"]], "Layout of a simple neural network with one hidden layer": [[39, "layout-of-a-simple-neural-network-with-one-hidden-layer"], [40, "layout-of-a-simple-neural-network-with-one-hidden-layer"]], "Layout of a simple neural network with two input nodes, one hidden layer and one output node": [[39, "layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-and-one-output-node"]], "Layout of a simple neural network with two input nodes, one hidden layer with two hidden noeds and one output node": [[40, "layout-of-a-simple-neural-network-with-two-input-nodes-one-hidden-layer-with-two-hidden-noeds-and-one-output-node"]], "Layout of input to first hidden layer l=1 from input layer l=0": [[40, "layout-of-input-to-first-hidden-layer-l-1-from-input-layer-l-0"]], "Learning goals": [[15, "learning-goals"], [16, "learning-goals"], [17, "learning-goals"], [18, "learning-goals"], [19, "learning-goals"], [20, "learning-goals"]], "Learning outcomes": [[24, "learning-outcomes"], [32, "learning-outcomes"]], "Learning rate methods": [[40, "learning-rate-methods"], [41, "learning-rate-methods"]], "Lecture Monday October 20": [[41, "lecture-monday-october-20"]], "Lecture Monday October 6": [[39, "lecture-monday-october-6"]], "Lecture Monday September 29, 2025": [[38, "lecture-monday-september-29-2025"]], "Lecture October 13, 2025": [[40, "lecture-october-13-2025"]], "Lecture material": [[37, "lecture-material"]], "Lecture material: Writing a code which implements a feed-forward neural network": [[40, "lecture-material-writing-a-code-which-implements-a-feed-forward-neural-network"]], "Lectures and ComputerLab": [[32, "lectures-and-computerlab"]], "Limitations of NNs": [[40, "limitations-of-nns"]], "Limitations of supervised learning with deep networks": [[1, "limitations-of-supervised-learning-with-deep-networks"], [40, "limitations-of-supervised-learning-with-deep-networks"]], "Linear Algebra, Handling of Arrays and more Python Features": [[25, null]], "Linear Regression": [[0, null]], "Linear Regression Problems": [[33, "linear-regression-problems"], [34, "linear-regression-problems"]], "Linear Regression and the SVD": [[34, "linear-regression-and-the-svd"]], "Linear Regression, basic elements": [[0, "linear-regression-basic-elements"]], "Linear classifier": [[37, "linear-classifier"]], "Linking Bayes\u2019 Theorem with Ridge and Lasso Regression": [[5, "linking-bayes-theorem-with-ridge-and-lasso-regression"]], "Linking the regression analysis with a statistical interpretation": [[5, "linking-the-regression-analysis-with-a-statistical-interpretation"], [36, "linking-the-regression-analysis-with-a-statistical-interpretation"]], "Linking with the SVD": [[5, "linking-with-the-svd"], [33, "linking-with-the-svd"]], "Links to relevant courses at the University of Oslo": [[31, "links-to-relevant-courses-at-the-university-of-oslo"]], "Logistic Regression": [[7, null], [7, "id1"], [37, "logistic-regression"]], "Logistic Regression, from last week": [[38, "logistic-regression-from-last-week"]], "Logistic function as the root of problems": [[40, "logistic-function-as-the-root-of-problems"]], "MNIST and GANs": [[4, "mnist-and-gans"]], "Machine Learning": [[32, "machine-learning"]], "Machine learning": [[24, "machine-learning"]], "Main textbooks": [[32, "main-textbooks"]], "Making a tree": [[9, "making-a-tree"]], "Making your own Bootstrap: Changing the Level of the Decision Tree": [[10, "making-your-own-bootstrap-changing-the-level-of-the-decision-tree"]], "Making your own test-train splitting": [[33, "making-your-own-test-train-splitting"]], "Material for exercises week 35": [[33, "material-for-exercises-week-35"]], "Material for lab sessions sessions Tuesday and Wednesday": [[34, "material-for-lab-sessions-sessions-tuesday-and-wednesday"]], "Material for lecture Monday September 2": [[34, "material-for-lecture-monday-september-2"]], "Material for lecture Monday September 8": [[35, "material-for-lecture-monday-september-8"]], "Material for the lab sessions": [[35, "material-for-the-lab-sessions"], [36, "material-for-the-lab-sessions"]], "Material for the lab sessions on Tuesday and Wednesday": [[40, "material-for-the-lab-sessions-on-tuesday-and-wednesday"]], "Material for the lecture on Monday October 6, 2025": [[39, "material-for-the-lecture-on-monday-october-6-2025"]], "Mathematical Interpretation of Ordinary Least Squares": [[5, "mathematical-interpretation-of-ordinary-least-squares"], [33, "mathematical-interpretation-of-ordinary-least-squares"], [34, "mathematical-interpretation-of-ordinary-least-squares"]], "Mathematical model": [[38, "mathematical-model"], [38, "id1"], [38, "id2"], [38, "id3"], [38, "id4"]], "Mathematical optimization of convex functions": [[8, "mathematical-optimization-of-convex-functions"]], "Mathematics of CNNs": [[3, "mathematics-of-cnns"]], "Mathematics of deep learning": [[39, "mathematics-of-deep-learning"], [40, "mathematics-of-deep-learning"]], "Mathematics of deep learning and neural networks": [[39, "mathematics-of-deep-learning-and-neural-networks"]], "Mathematics of the SVD and implications": [[5, "mathematics-of-the-svd-and-implications"], [33, "mathematics-of-the-svd-and-implications"], [34, "mathematics-of-the-svd-and-implications"]], "Matrices in Python": [[32, "matrices-in-python"]], "Matrix multiplication": [[1, "matrix-multiplication"], [40, "matrix-multiplication"]], "Matrix multiplications": [[40, "matrix-multiplications"]], "Matrix-vector notation": [[38, "matrix-vector-notation"]], "Matrix-vector notation and activation": [[12, "matrix-vector-notation-and-activation"], [38, "matrix-vector-notation-and-activation"]], "Maximum Likelihood Estimation (MLE)": [[36, "maximum-likelihood-estimation-mle"]], "Maximum likelihood": [[37, "maximum-likelihood"], [38, "maximum-likelihood"]], "Meet the covariance!": [[29, "meet-the-covariance"]], "Meet the Covariance Matrix": [[5, "meet-the-covariance-matrix"], [33, "meet-the-covariance-matrix"]], "Meet the Hessian Matrix": [[33, "meet-the-hessian-matrix"]], "Meet the Pandas": [[32, "meet-the-pandas"]], "Memory Usage and Scalability": [[35, "memory-usage-and-scalability"]], "Memory constraints": [[35, "memory-constraints"]], "Min-Max Scaling": [[33, "min-max-scaling"]], "Minimization process": [[41, "minimization-process"]], "Minimizing the cost function using gradient descent and automatic differentiation": [[41, "minimizing-the-cost-function-using-gradient-descent-and-automatic-differentiation"]], "Minimizing the cross entropy": [[37, "minimizing-the-cross-entropy"], [38, "minimizing-the-cross-entropy"]], "Momentum based GD": [[13, "momentum-based-gd"], [35, "momentum-based-gd"]], "More classes": [[37, "more-classes"], [38, "more-classes"]], "More complicated Example: The Ising model": [[6, "more-complicated-example-the-ising-model"]], "More complicated function": [[39, "more-complicated-function"]], "More considerations": [[39, "more-considerations"], [40, "more-considerations"]], "More details": [[41, "more-details"], [41, "id4"]], "More examples on bootstrap and cross-validation and errors": [[36, "more-examples-on-bootstrap-and-cross-validation-and-errors"], [37, "more-examples-on-bootstrap-and-cross-validation-and-errors"]], "More interpretations": [[33, "more-interpretations"], [34, "more-interpretations"], [34, "id5"]], "More limitations": [[40, "more-limitations"]], "More on Dimensionalities": [[3, "more-on-dimensionalities"]], "More on Rescaling data": [[6, "more-on-rescaling-data"]], "More on Steepest descent": [[34, "more-on-steepest-descent"]], "More on activation functions, output layers": [[40, "more-on-activation-functions-output-layers"], [41, "more-on-activation-functions-output-layers"]], "More on convex functions": [[34, "more-on-convex-functions"]], "More on the general approximation theorem": [[39, "more-on-the-general-approximation-theorem"]], "More preprocessing": [[33, "more-preprocessing"], [35, "more-preprocessing"]], "More technicalities": [[41, "more-technicalities"]], "More top-down perspectives": [[40, "more-top-down-perspectives"]], "Motivation for Adaptive Step Sizes": [[35, "motivation-for-adaptive-step-sizes"]], "Multiclass classification": [[40, "multiclass-classification"], [41, "multiclass-classification"]], "Multilayer perceptrons": [[12, "multilayer-perceptrons"], [38, "multilayer-perceptrons"], [39, "multilayer-perceptrons"]], "Multivariable functions": [[39, "multivariable-functions"]], "Network requirements": [[2, "network-requirements"], [41, "network-requirements"]], "Neural Networks vs CNNs": [[3, "neural-networks-vs-cnns"]], "Neural network types": [[38, "neural-network-types"], [39, "neural-network-types"]], "Neural networks": [[12, null]], "New expression for the derivative": [[39, "new-expression-for-the-derivative"]], "Non-Convex Problems": [[35, "non-convex-problems"]], "Note about SVD Calculations": [[33, "note-about-svd-calculations"], [34, "note-about-svd-calculations"]], "Note on Scikit-Learn": [[34, "note-on-scikit-learn"]], "Numerical experiments and the covariance, central limit theorem": [[29, "numerical-experiments-and-the-covariance-central-limit-theorem"]], "Numpy and arrays": [[25, "numpy-and-arrays"], [32, "numpy-and-arrays"]], "Numpy examples and Important Matrix and vector handling packages": [[32, "numpy-examples-and-important-matrix-and-vector-handling-packages"]], "Optimization and Deep learning": [[37, "optimization-and-deep-learning"], [38, "optimization-and-deep-learning"]], "Optimization and gradient descent, the central part of any Machine Learning algortithm": [[34, "optimization-and-gradient-descent-the-central-part-of-any-machine-learning-algortithm"]], "Optimization, the central part of any Machine Learning algortithm": [[13, null], [37, "optimization-the-central-part-of-any-machine-learning-algortithm"], [38, "optimization-the-central-part-of-any-machine-learning-algortithm"]], "Optimizing our parameters": [[32, "optimizing-our-parameters"]], "Optimizing our parameters, more details": [[32, "optimizing-our-parameters-more-details"]], "Optimizing the cost function": [[1, "optimizing-the-cost-function"], [40, "optimizing-the-cost-function"]], "Optimizing the parameters": [[39, "optimizing-the-parameters"], [40, "optimizing-the-parameters"]], "Optional (Note that you should include at least two of these in the report):": [[27, "optional-note-that-you-should-include-at-least-two-of-these-in-the-report"]], "Ordinary Differential Equations first": [[41, "ordinary-differential-equations-first"]], "Organizing our data": [[0, "organizing-our-data"], [32, "organizing-our-data"]], "Other Matrix and Vector Operations": [[25, "other-matrix-and-vector-operations"]], "Other Types of Recurrent Neural Networks": [[4, "other-types-of-recurrent-neural-networks"]], "Other courses on Data science and Machine Learning at UiO": [[32, "other-courses-on-data-science-and-machine-learning-at-uio"]], "Other courses on Data science and Machine Learning at UiO, contn": [[32, "other-courses-on-data-science-and-machine-learning-at-uio-contn"]], "Other ingredients of a neural network": [[39, "other-ingredients-of-a-neural-network"]], "Other measures in classification studies": [[38, "other-measures-in-classification-studies"]], "Other measures: Precision, Recall, and the F_1 Measure": [[23, "other-measures-precision-recall-and-the-f-1-measure"]], "Other parameters": [[39, "other-parameters"]], "Other popular texts": [[32, "other-popular-texts"]], "Other techniques": [[11, "other-techniques"]], "Other types of networks": [[12, "other-types-of-networks"], [38, "other-types-of-networks"], [39, "other-types-of-networks"]], "Other ways of visualizing the trees": [[9, "other-ways-of-visualizing-the-trees"]], "Our model for the nuclear binding energies": [[32, "our-model-for-the-nuclear-binding-energies"]], "Output layer": [[39, "output-layer"], [40, "output-layer"]], "Overarching aims of the exercises this week": [[21, "overarching-aims-of-the-exercises-this-week"], [22, "overarching-aims-of-the-exercises-this-week"]], "Overarching aims of the exercises weeks 43 and 44": [[23, "overarching-aims-of-the-exercises-weeks-43-and-44"]], "Overarching view of a neural network": [[39, "overarching-view-of-a-neural-network"]], "Overview of first week": [[32, "overview-of-first-week"]], "Overview video on Stochastic Gradient Descent (SGD)": [[35, "overview-video-on-stochastic-gradient-descent-sgd"]], "Own code for Ordinary Least Squares": [[32, "own-code-for-ordinary-least-squares"], [33, "own-code-for-ordinary-least-squares"]], "PCA and scikit-learn": [[11, "pca-and-scikit-learn"]], "Pandas AI": [[32, "pandas-ai"]], "Parameters of neural networks": [[39, "parameters-of-neural-networks"]], "Part a : Ordinary Least Square (OLS) for the Runge function": [[26, "part-a-ordinary-least-square-ols-for-the-runge-function"]], "Part a): Analytical warm-up": [[27, "part-a-analytical-warm-up"]], "Part b): Writing your own Neural Network code": [[27, "part-b-writing-your-own-neural-network-code"]], "Part b: Adding Ridge regression for the Runge function": [[26, "part-b-adding-ridge-regression-for-the-runge-function"]], "Part c): Testing against other software libraries": [[27, "part-c-testing-against-other-software-libraries"]], "Part c: Writing your own gradient descent code": [[26, "part-c-writing-your-own-gradient-descent-code"]], "Part d): Testing different activation functions and depths of the neural network": [[27, "part-d-testing-different-activation-functions-and-depths-of-the-neural-network"]], "Part d: Including momentum and more advanced ways to update the learning the rate": [[26, "part-d-including-momentum-and-more-advanced-ways-to-update-the-learning-the-rate"]], "Part e): Testing different norms": [[27, "part-e-testing-different-norms"]], "Part e: Writing our own code for Lasso regression": [[26, "part-e-writing-our-own-code-for-lasso-regression"]], "Part f): Classification analysis using neural networks": [[27, "part-f-classification-analysis-using-neural-networks"]], "Part f: Stochastic gradient descent": [[26, "part-f-stochastic-gradient-descent"]], "Part g) Critical evaluation of the various algorithms": [[27, "part-g-critical-evaluation-of-the-various-algorithms"]], "Part g: Bias-variance trade-off and resampling techniques": [[26, "part-g-bias-variance-trade-off-and-resampling-techniques"]], "Part h): Cross-validation as resampling techniques, adding more complexity": [[26, "part-h-cross-validation-as-resampling-techniques-adding-more-complexity"]], "Partial Differential Equations": [[2, "partial-differential-equations"], [41, "partial-differential-equations"]], "Plan for week 39, September 22-26, 2025": [[37, "plan-for-week-39-september-22-26-2025"]], "Plan for week 41, October 6-10": [[39, "plan-for-week-41-october-6-10"]], "Plans for week 35": [[33, "plans-for-week-35"]], "Plans for week 36": [[34, "plans-for-week-36"]], "Plans for week 37, lecture Monday": [[35, "plans-for-week-37-lecture-monday"]], "Plans for week 38, lecture Monday September 15": [[36, "plans-for-week-38-lecture-monday-september-15"]], "Plans for week 43": [[41, "plans-for-week-43"]], "Plotting the Histogram": [[36, "plotting-the-histogram"]], "Plotting the mean value for each group": [[37, "plotting-the-mean-value-for-each-group"]], "Practical tips": [[13, "practical-tips"], [35, "practical-tips"]], "Practicalities": [[30, "practicalities"], [30, "id1"]], "Preamble: Note on writing reports, using reference material, AI and other tools": [[26, "preamble-note-on-writing-reports-using-reference-material-ai-and-other-tools"], [27, "preamble-note-on-writing-reports-using-reference-material-ai-and-other-tools"]], "Predicting New Points With A Trained Recurrent Neural Network": [[4, "predicting-new-points-with-a-trained-recurrent-neural-network"]], "Preprocessing our data": [[33, "preprocessing-our-data"]], "Prerequisites": [[32, "prerequisites"]], "Prerequisites and background": [[24, "prerequisites-and-background"]], "Prerequisites: Collect and pre-process data": [[3, "prerequisites-collect-and-pre-process-data"]], "Probability Distribution Functions": [[29, "probability-distribution-functions"]], "Program example for gradient descent with Ridge Regression": [[34, "program-example-for-gradient-descent-with-ridge-regression"], [35, "program-example-for-gradient-descent-with-ridge-regression"]], "Program for stochastic gradient": [[13, "program-for-stochastic-gradient"]], "Project 1 on Machine Learning, deadline October 6 (midnight), 2025": [[26, null]], "Project 2 on Machine Learning, deadline November 10 (Midnight)": [[27, null]], "Properties of PDFs": [[29, "properties-of-pdfs"]], "Pros and cons": [[35, "pros-and-cons"]], "Pros and cons of trees, pros": [[9, "pros-and-cons-of-trees-pros"]], "Python installers": [[24, "python-installers"], [32, "python-installers"]], "RMS prop": [[13, "rms-prop"]], "RMSProp algorithm, taken from Goodfellow et al": [[35, "rmsprop-algorithm-taken-from-goodfellow-et-al"]], "RMSProp: Adaptive Learning Rates": [[35, "rmsprop-adaptive-learning-rates"]], "RMSprop for adaptive learning rate with Stochastic Gradient Descent": [[35, "rmsprop-for-adaptive-learning-rate-with-stochastic-gradient-descent"]], "ROC Curve": [[23, "roc-curve"]], "Random Numbers": [[29, "random-numbers"]], "Random forests": [[10, "random-forests"]], "Randomized PCA": [[11, "randomized-pca"]], "Reading material": [[32, "reading-material"]], "Reading recommendations": [[40, "reading-recommendations"]], "Reading recommendations:": [[33, "reading-recommendations"]], "Reading suggestions week 34": [[32, "reading-suggestions-week-34"]], "Readings and Videos": [[36, "readings-and-videos"]], "Readings and Videos, logistic regression": [[37, "readings-and-videos-logistic-regression"]], "Readings and Videos, resampling methods": [[37, "readings-and-videos-resampling-methods"]], "Readings and Videos:": [[35, "readings-and-videos"], [39, "readings-and-videos"]], "Readings and videos": [[40, "readings-and-videos"]], "Recurrent neural networks": [[12, "recurrent-neural-networks"], [38, "recurrent-neural-networks"], [39, "recurrent-neural-networks"]], "Recurrent neural networks: Overarching view": [[4, null]], "Reducing the number of degrees of freedom, overarching view": [[0, "reducing-the-number-of-degrees-of-freedom-overarching-view"], [33, "reducing-the-number-of-degrees-of-freedom-overarching-view"]], "Reducing the number of operations": [[39, "reducing-the-number-of-operations"]], "Reformulating the problem": [[2, "reformulating-the-problem"], [41, "reformulating-the-problem"]], "Regression Case": [[10, "regression-case"]], "Regression analysis and resampling methods": [[26, "regression-analysis-and-resampling-methods"]], "Regression analysis, overarching aims": [[32, "regression-analysis-overarching-aims"]], "Regression analysis, overarching aims II": [[32, "regression-analysis-overarching-aims-ii"]], "Regularization": [[1, "regularization"], [40, "regularization"]], "Relevance": [[38, "relevance"], [40, "relevance"]], "Reminder about the gradient machinery from project 1": [[27, "reminder-about-the-gradient-machinery-from-project-1"]], "Reminder from last week": [[33, "reminder-from-last-week"]], "Reminder from last week: First network example, simple percepetron with one input": [[40, "reminder-from-last-week-first-network-example-simple-percepetron-with-one-input"]], "Reminder on Newton-Raphson\u2019s method": [[34, "reminder-on-newton-raphson-s-method"]], "Reminder on Statistics": [[6, "reminder-on-statistics"]], "Reminder on books with hands-on material and codes": [[39, "reminder-on-books-with-hands-on-material-and-codes"], [40, "reminder-on-books-with-hands-on-material-and-codes"]], "Reminder on different scaling methods": [[35, "reminder-on-different-scaling-methods"]], "Reminder on the chain rule and gradients": [[39, "reminder-on-the-chain-rule-and-gradients"]], "Replace or not": [[13, "replace-or-not"], [35, "replace-or-not"]], "Required Analysis:": [[27, "required-analysis"]], "Required Technologies": [[24, "required-technologies"]], "Resampling Methods": [[6, null]], "Resampling and the Bias-Variance Trade-off": [[19, "resampling-and-the-bias-variance-trade-off"]], "Resampling approaches can be computationally expensive": [[36, "resampling-approaches-can-be-computationally-expensive"], [37, "resampling-approaches-can-be-computationally-expensive"]], "Resampling methods": [[6, "id1"], [36, "resampling-methods"], [36, "id2"], [37, "resampling-methods"], [37, "id1"]], "Resampling methods: Bootstrap": [[36, "resampling-methods-bootstrap"], [37, "resampling-methods-bootstrap"]], "Resampling methods: Bootstrap approach": [[36, "resampling-methods-bootstrap-approach"]], "Resampling methods: Bootstrap background": [[36, "resampling-methods-bootstrap-background"]], "Resampling methods: Bootstrap steps": [[36, "resampling-methods-bootstrap-steps"]], "Resampling methods: More Bootstrap background": [[36, "resampling-methods-more-bootstrap-background"]], "Residual Error": [[33, "residual-error"], [34, "residual-error"]], "Resources on differential equations and deep learning": [[2, "resources-on-differential-equations-and-deep-learning"], [41, "resources-on-differential-equations-and-deep-learning"]], "Revisiting Ordinary Least Squares": [[34, "revisiting-ordinary-least-squares"]], "Revisiting our Linear Regression Solvers": [[13, "revisiting-our-linear-regression-solvers"]], "Revisiting our Logistic Regression case": [[37, "revisiting-our-logistic-regression-case"], [38, "revisiting-our-logistic-regression-case"]], "Rewriting the Covariance and/or Correlation Matrix": [[33, "rewriting-the-covariance-and-or-correlation-matrix"]], "Rewriting the \\delta-function": [[36, "rewriting-the-delta-function"]], "Rewriting the fitting procedure as a linear algebra problem": [[32, "rewriting-the-fitting-procedure-as-a-linear-algebra-problem"]], "Rewriting the fitting procedure as a linear algebra problem, more details": [[32, "rewriting-the-fitting-procedure-as-a-linear-algebra-problem-more-details"]], "Ridge Regression": [[34, "ridge-regression"]], "Ridge and LASSO Regression": [[33, "ridge-and-lasso-regression"], [34, "ridge-and-lasso-regression"], [34, "id2"]], "Ridge and Lasso Regression": [[5, null], [5, "id1"]], "SGD example": [[35, "sgd-example"]], "SGD vs Full-Batch GD: Convergence Speed and Memory Comparison": [[35, "sgd-vs-full-batch-gd-convergence-speed-and-memory-comparison"]], "SVD analysis": [[34, "svd-analysis"]], "Same code but now with momentum gradient descent": [[13, "same-code-but-now-with-momentum-gradient-descent"], [35, "same-code-but-now-with-momentum-gradient-descent"], [35, "id3"], [35, "id4"]], "Schedule first week": [[32, "schedule-first-week"]], "Schematic Regression Procedure": [[9, "schematic-regression-procedure"]], "Second moment of the gradient": [[35, "second-moment-of-the-gradient"]], "September 15-19": [[19, "september-15-19"]], "Setting up a Multi-layer perceptron model for classification": [[40, "setting-up-a-multi-layer-perceptron-model-for-classification"]], "Setting up the Back propagation algorithm": [[12, "setting-up-the-back-propagation-algorithm"]], "Setting up the Back propagation algorithm, part 3": [[39, "setting-up-the-back-propagation-algorithm-part-3"], [40, "setting-up-the-back-propagation-algorithm-part-3"], [41, "setting-up-the-back-propagation-algorithm-part-3"]], "Setting up the Matrix to be inverted": [[33, "setting-up-the-matrix-to-be-inverted"], [34, "setting-up-the-matrix-to-be-inverted"]], "Setting up the back propagation algorithm": [[39, "setting-up-the-back-propagation-algorithm"]], "Setting up the back propagation algorithm and algorithm for a feed forward NN, initalizations": [[40, "setting-up-the-back-propagation-algorithm-and-algorithm-for-a-feed-forward-nn-initalizations"], [41, "setting-up-the-back-propagation-algorithm-and-algorithm-for-a-feed-forward-nn-initalizations"]], "Setting up the back propagation algorithm, part 1": [[40, "setting-up-the-back-propagation-algorithm-part-1"], [41, "setting-up-the-back-propagation-algorithm-part-1"]], "Setting up the back propagation algorithm, part 2": [[39, "setting-up-the-back-propagation-algorithm-part-2"], [40, "setting-up-the-back-propagation-algorithm-part-2"], [41, "setting-up-the-back-propagation-algorithm-part-2"]], "Setting up the code": [[41, "setting-up-the-code"]], "Setting up the equations for a neural network": [[39, "setting-up-the-equations-for-a-neural-network"], [40, "setting-up-the-equations-for-a-neural-network"]], "Setting up the network using Autograd": [[41, "setting-up-the-network-using-autograd"]], "Setting up the network using Autograd; The full program": [[2, "setting-up-the-network-using-autograd-the-full-program"], [41, "setting-up-the-network-using-autograd-the-full-program"]], "Setting up the network using Autograd; The trial solution": [[41, "setting-up-the-network-using-autograd-the-trial-solution"]], "Setting up the problem": [[41, "setting-up-the-problem"]], "Setup of Network": [[41, "setup-of-network"]], "Similar (second order function now) problem but now with AdaGrad": [[13, "similar-second-order-function-now-problem-but-now-with-adagrad"], [35, "similar-second-order-function-now-problem-but-now-with-adagrad"]], "Simple Python Code to read in Data and perform Classification": [[9, "simple-python-code-to-read-in-data-and-perform-classification"]], "Simple case": [[33, "simple-case"], [34, "simple-case"]], "Simple code for solving the above problem": [[34, "simple-code-for-solving-the-above-problem"]], "Simple example": [[37, "simple-example"], [39, "simple-example"]], "Simple example code": [[35, "simple-example-code"]], "Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression": [[34, "simple-example-to-illustrate-ordinary-least-squares-ridge-and-lasso-regression"]], "Simple geometric interpretation": [[34, "simple-geometric-interpretation"]], "Simple linear regression model using scikit-learn": [[0, "simple-linear-regression-model-using-scikit-learn"], [32, "simple-linear-regression-model-using-scikit-learn"]], "Simple neural network and the back propagation equations": [[39, "simple-neural-network-and-the-back-propagation-equations"], [40, "simple-neural-network-and-the-back-propagation-equations"]], "Simple one-dimensional second-order polynomial": [[18, "simple-one-dimensional-second-order-polynomial"]], "Simple program": [[34, "simple-program"], [35, "simple-program"]], "Simpler examples first, and automatic differentiation": [[39, "simpler-examples-first-and-automatic-differentiation"]], "Slightly different approach": [[35, "slightly-different-approach"]], "Smarter way of evaluating the above function": [[39, "smarter-way-of-evaluating-the-above-function"]], "Sneaking in automatic differentiation using Autograd": [[35, "sneaking-in-automatic-differentiation-using-autograd"]], "Software and needed installations": [[26, "software-and-needed-installations"], [32, "software-and-needed-installations"]], "Solving Differential Equations with Deep Learning": [[2, null]], "Solving differential equations with Deep Learning": [[41, "solving-differential-equations-with-deep-learning"]], "Solving the equation using Autograd": [[41, "solving-the-equation-using-autograd"]], "Solving the one dimensional Poisson equation": [[2, "solving-the-one-dimensional-poisson-equation"]], "Solving the wave equation - the full program using Autograd": [[41, "solving-the-wave-equation-the-full-program-using-autograd"]], "Solving the wave equation with Neural Networks": [[2, "solving-the-wave-equation-with-neural-networks"]], "Solving using Newton-Raphson\u2019s method": [[37, "solving-using-newton-raphson-s-method"], [38, "solving-using-newton-raphson-s-method"]], "Some famous Matrices": [[25, "some-famous-matrices"]], "Some parallels from real analysis": [[39, "some-parallels-from-real-analysis"]], "Some selected properties": [[37, "some-selected-properties"]], "Some simple problems": [[13, "some-simple-problems"], [34, "some-simple-problems"]], "Some useful matrix and vector expressions": [[33, "some-useful-matrix-and-vector-expressions"]], "Splitting our Data in Training and Test data": [[0, "splitting-our-data-in-training-and-test-data"], [33, "splitting-our-data-in-training-and-test-data"]], "Standard Approach based on the Normal Distribution": [[36, "standard-approach-based-on-the-normal-distribution"]], "Standard steepest descent": [[13, "standard-steepest-descent"]], "Statistical analysis": [[36, "statistical-analysis"], [37, "statistical-analysis"]], "Statistical analysis and optimization of data": [[24, "statistical-analysis-and-optimization-of-data"], [32, "statistical-analysis-and-optimization-of-data"]], "Steepest descent": [[13, "steepest-descent"], [34, "steepest-descent"]], "Stochastic Gradient Descent": [[35, "stochastic-gradient-descent"]], "Stochastic Gradient Descent (SGD)": [[13, "stochastic-gradient-descent-sgd"], [35, "stochastic-gradient-descent-sgd"]], "Stochastic variables and the main concepts, the discrete case": [[29, "stochastic-variables-and-the-main-concepts-the-discrete-case"]], "Strongly Convex Case": [[35, "strongly-convex-case"]], "Suggested readings and videos": [[38, "suggested-readings-and-videos"]], "Summary of methods to implement and analyze": [[27, "summary-of-methods-to-implement-and-analyze"]], "Summing up": [[36, "summing-up"], [37, "summing-up"]], "Support Vector Machines, overarching aims": [[8, null]], "Synthetic data generation": [[37, "synthetic-data-generation"], [38, "synthetic-data-generation"]], "Systematic reduction": [[3, "systematic-reduction"]], "Teachers": [[32, "teachers"]], "Teachers and Grading": [[30, null]], "Teaching Assistants Fall semester 2023": [[30, "teaching-assistants-fall-semester-2023"]], "Technicalities": [[41, "technicalities"]], "Tensorflow": [[40, "tensorflow"], [41, "tensorflow"]], "Tentative deadllines for projects": [[30, "tentative-deadllines-for-projects"]], "Testing the Means Squared Error as function of Complexity": [[0, "testing-the-means-squared-error-as-function-of-complexity"], [33, "testing-the-means-squared-error-as-function-of-complexity"]], "Testing the XOR gate and other gates": [[40, "testing-the-xor-gate-and-other-gates"], [41, "testing-the-xor-gate-and-other-gates"]], "Textbooks": [[31, null]], "The back propagation equations for a neural network": [[40, "the-back-propagation-equations-for-a-neural-network"]], "The Algorithm before theorem": [[11, "the-algorithm-before-theorem"]], "The Breast Cancer Data, now with Keras": [[1, "the-breast-cancer-data-now-with-keras"]], "The CART algorithm for Classification": [[9, "the-cart-algorithm-for-classification"]], "The CART algorithm for Regression": [[9, "the-cart-algorithm-for-regression"]], "The CIFAR01 data set": [[3, "the-cifar01-data-set"]], "The Central Limit Theorem": [[36, "the-central-limit-theorem"]], "The Hessian matrix": [[34, "the-hessian-matrix"], [35, "the-hessian-matrix"]], "The Hessian matrix for Ridge Regression": [[34, "the-hessian-matrix-for-ridge-regression"], [35, "the-hessian-matrix-for-ridge-regression"]], "The Jacobian": [[33, "the-jacobian"]], "The MNIST dataset again": [[3, "the-mnist-dataset-again"]], "The Neural Network": [[40, "the-neural-network"], [41, "the-neural-network"]], "The OLS case": [[34, "the-ols-case"]], "The RELU function family": [[1, "the-relu-function-family"], [40, "the-relu-function-family"], [41, "the-relu-function-family"]], "The Ridge case": [[34, "the-ridge-case"]], "The SVD, a Fantastic Algorithm": [[33, "the-svd-a-fantastic-algorithm"], [34, "the-svd-a-fantastic-algorithm"]], "The Softmax function": [[1, "the-softmax-function"], [40, "the-softmax-function"]], "The \\chi^2 function": [[0, "the-chi-2-function"], [32, "the-chi-2-function"], [32, "id4"], [32, "id5"], [32, "id6"], [32, "id7"], [32, "id8"]], "The analytical solution": [[41, "the-analytical-solution"]], "The approximation theorem in words": [[39, "the-approximation-theorem-in-words"]], "The bias-variance tradeoff": [[6, "the-bias-variance-tradeoff"], [36, "the-bias-variance-tradeoff"], [37, "the-bias-variance-tradeoff"]], "The code for solving the ODE": [[2, "the-code-for-solving-the-ode"], [41, "the-code-for-solving-the-ode"]], "The complete code with a simple data set": [[33, "the-complete-code-with-a-simple-data-set"]], "The cost function rewritten": [[37, "the-cost-function-rewritten"], [38, "the-cost-function-rewritten"]], "The cost/loss function": [[33, "the-cost-loss-function"]], "The course has two central parts": [[24, "the-course-has-two-central-parts"]], "The derivative of the Logistic funtion": [[40, "the-derivative-of-the-logistic-funtion"]], "The derivative of the cost/loss function": [[34, "the-derivative-of-the-cost-loss-function"], [35, "the-derivative-of-the-cost-loss-function"]], "The derivatives": [[39, "the-derivatives"], [40, "the-derivatives"]], "The equations": [[34, "the-equations"]], "The equations for ordinary least squares": [[33, "the-equations-for-ordinary-least-squares"]], "The equations to solve": [[37, "the-equations-to-solve"], [38, "the-equations-to-solve"]], "The first Case": [[34, "the-first-case"]], "The function to solve for": [[41, "the-function-to-solve-for"]], "The gradient step": [[35, "the-gradient-step"]], "The ideal": [[34, "the-ideal"]], "The logistic function": [[7, "the-logistic-function"], [37, "the-logistic-function"]], "The mean squared error and its derivative": [[33, "the-mean-squared-error-and-its-derivative"]], "The moons example": [[8, "the-moons-example"]], "The multilayer perceptron (MLP)": [[12, "the-multilayer-perceptron-mlp"]], "The network with one input layer, specified number of hidden layers, and one output layer": [[2, "the-network-with-one-input-layer-specified-number-of-hidden-layers-and-one-output-layer"], [41, "the-network-with-one-input-layer-specified-number-of-hidden-layers-and-one-output-layer"]], "The optimization problem": [[39, "the-optimization-problem"]], "The ouput layer": [[39, "the-ouput-layer"], [40, "the-ouput-layer"]], "The plethora of machine learning algorithms/methods": [[32, "the-plethora-of-machine-learning-algorithms-methods"]], "The problem to solve for": [[41, "the-problem-to-solve-for"]], "The program using Autograd": [[41, "the-program-using-autograd"]], "The same example but now with cross-validation": [[36, "the-same-example-but-now-with-cross-validation"], [37, "the-same-example-but-now-with-cross-validation"]], "The sensitiveness of the gradient descent": [[34, "the-sensitiveness-of-the-gradient-descent"]], "The singular value decomposition": [[5, "the-singular-value-decomposition"], [33, "the-singular-value-decomposition"], [34, "the-singular-value-decomposition"]], "The specific equation to solve for": [[41, "the-specific-equation-to-solve-for"]], "The training": [[39, "the-training"], [40, "the-training"]], "The trial solution": [[41, "the-trial-solution"], [41, "id2"], [41, "id3"], [41, "id5"]], "The two-dimensional case": [[8, "the-two-dimensional-case"]], "Theoretical Convergence Speed and convex optimization": [[35, "theoretical-convergence-speed-and-convex-optimization"]], "Time decay rate": [[35, "time-decay-rate"]], "To our real data: nuclear binding energies. Brief reminder on masses and binding energies": [[32, "to-our-real-data-nuclear-binding-energies-brief-reminder-on-masses-and-binding-energies"]], "Topics covered in this course: Statistical analysis and optimization of data": [[32, "topics-covered-in-this-course-statistical-analysis-and-optimization-of-data"]], "Towards the PCA theorem": [[11, "towards-the-pca-theorem"]], "Train and test datasets": [[1, "train-and-test-datasets"], [40, "train-and-test-datasets"]], "Two parameters": [[37, "two-parameters"], [38, "two-parameters"]], "Two-dimensional Objects": [[3, "two-dimensional-objects"]], "Type of problem": [[2, "type-of-problem"], [41, "type-of-problem"]], "Types of Machine Learning": [[32, "types-of-machine-learning"]], "Understanding what happens": [[36, "understanding-what-happens"], [37, "understanding-what-happens"]], "Universal approximation theorem": [[39, "universal-approximation-theorem"]], "Updating the gradients": [[39, "updating-the-gradients"], [40, "updating-the-gradients"], [41, "updating-the-gradients"]], "Usage of the above learning rate schedulers": [[40, "usage-of-the-above-learning-rate-schedulers"], [41, "usage-of-the-above-learning-rate-schedulers"]], "Use the books!": [[19, "use-the-books"]], "Useful Python libraries": [[24, "useful-python-libraries"], [32, "useful-python-libraries"]], "Using Autograd": [[13, "using-autograd"]], "Using Automatic differentiation": [[41, "using-automatic-differentiation"]], "Using Keras": [[40, "using-keras"], [41, "using-keras"]], "Using Pytorch with the full MNIST data set": [[41, "using-pytorch-with-the-full-mnist-data-set"]], "Using Scikit-learn": [[38, "using-scikit-learn"]], "Using forward Euler to solve the ODE": [[2, "using-forward-euler-to-solve-the-ode"], [41, "using-forward-euler-to-solve-the-ode"]], "Using gradient descent methods, limitations": [[13, "using-gradient-descent-methods-limitations"], [34, "using-gradient-descent-methods-limitations"], [35, "using-gradient-descent-methods-limitations"]], "Using the chain rule and summing over all k entries": [[39, "using-the-chain-rule-and-summing-over-all-k-entries"], [40, "using-the-chain-rule-and-summing-over-all-k-entries"]], "Using the correlation matrix": [[38, "using-the-correlation-matrix"]], "Vanishing gradients": [[40, "vanishing-gradients"]], "Various steps in cross-validation": [[36, "various-steps-in-cross-validation"], [37, "various-steps-in-cross-validation"]], "Visualization": [[1, "visualization"], [1, "id1"], [40, "visualization"], [40, "id1"]], "Visualizing the Tree, Classification": [[9, "visualizing-the-tree-classification"]], "Week 34: Introduction to the course, Logistics and Practicalities": [[32, null]], "Week 35: From Ordinary Linear Regression to Ridge and Lasso Regression": [[33, null]], "Week 36: Linear Regression and Gradient descent": [[34, null]], "Week 37: Gradient descent methods": [[35, null]], "Week 38: Statistical analysis, bias-variance tradeoff and resampling methods": [[36, null]], "Week 39: Resampling methods and logistic regression": [[37, null]], "Week 40: Gradient descent methods (continued) and start Neural networks": [[38, null]], "Week 41 Neural networks and constructing a neural network code": [[39, null]], "Week 42 Constructing a Neural Network code with examples": [[40, null]], "Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations": [[41, null]], "Weights and biases": [[40, "weights-and-biases"]], "What Is Generative Modeling?": [[32, "what-is-generative-modeling"]], "What does it mean?": [[33, "what-does-it-mean"], [34, "what-does-it-mean"]], "What is Machine Learning?": [[0, "what-is-machine-learning"]], "What is a good model?": [[0, "what-is-a-good-model"], [32, "what-is-a-good-model"]], "What is a good model? Can we define it?": [[32, "what-is-a-good-model-can-we-define-it"]], "When do we stop?": [[35, "when-do-we-stop"]], "Which activation function should I use?": [[1, "which-activation-function-should-i-use"]], "Which activation function should we use?": [[40, "which-activation-function-should-we-use"], [41, "which-activation-function-should-we-use"]], "Why Combine Momentum and RMSProp?": [[35, "why-combine-momentum-and-rmsprop"]], "Why Linear Regression (aka Ordinary Least Squares and family)": [[32, "why-linear-regression-aka-ordinary-least-squares-and-family"]], "Why multilayer perceptrons?": [[38, "why-multilayer-perceptrons"], [39, "why-multilayer-perceptrons"]], "Why resampling methods": [[36, "why-resampling-methods"]], "Why resampling methods ?": [[36, "id1"], [37, "why-resampling-methods"]], "Why the jacobian?": [[41, "why-the-jacobian"]], "Wisconsin Cancer Data": [[7, "wisconsin-cancer-data"]], "With Lasso Regression": [[34, "with-lasso-regression"]], "Wrapping it up": [[36, "wrapping-it-up"]], "Writing Our First Generative Adversarial Network": [[4, "writing-our-first-generative-adversarial-network"]], "Writing our own PCA code": [[11, "writing-our-own-pca-code"]], "Writing the Cost Function": [[34, "writing-the-cost-function"]], "XGBoost: Extreme Gradient Boosting": [[10, "xgboost-extreme-gradient-boosting"]], "Yet another Example": [[34, "yet-another-example"]], "a) Expression for Ridge regression": [[17, "a-expression-for-ridge-regression"]], "scikit-learn implementation": [[1, "scikit-learn-implementation"], [40, "scikit-learn-implementation"]]}, "docnames": ["chapter1", "chapter10", "chapter11", "chapter12", "chapter13", "chapter2", "chapter3", "chapter4", "chapter5", "chapter6", "chapter7", "chapter8", "chapter9", "chapteroptimization", "clustering", "exercisesweek34", "exercisesweek35", "exercisesweek36", "exercisesweek37", "exercisesweek38", "exercisesweek39", "exercisesweek41", "exercisesweek42", "exercisesweek43", "intro", "linalg", "project1", "project2", "schedule", "statistics", "teachers", "textbooks", "week34", "week35", "week36", "week37", "week38", "week39", "week40", "week41", "week42", "week43"], "envversion": {"sphinx": 62, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1}, "filenames": ["chapter1.ipynb", "chapter10.ipynb", "chapter11.ipynb", "chapter12.ipynb", "chapter13.ipynb", "chapter2.ipynb", "chapter3.ipynb", "chapter4.ipynb", "chapter5.ipynb", "chapter6.ipynb", "chapter7.ipynb", "chapter8.ipynb", "chapter9.ipynb", "chapteroptimization.ipynb", "clustering.ipynb", "exercisesweek34.ipynb", "exercisesweek35.ipynb", "exercisesweek36.ipynb", "exercisesweek37.ipynb", "exercisesweek38.ipynb", "exercisesweek39.ipynb", "exercisesweek41.ipynb", "exercisesweek42.ipynb", "exercisesweek43.ipynb", "intro.md", "linalg.ipynb", "project1.ipynb", "project2.ipynb", "schedule.md", "statistics.ipynb", "teachers.md", "textbooks.md", "week34.ipynb", "week35.ipynb", "week36.ipynb", "week37.ipynb", "week38.ipynb", "week39.ipynb", "week40.ipynb", "week41.ipynb", "week42.ipynb", "week43.ipynb"], "indexentries": {}, "objects": {}, "objnames": {}, "objtypes": {}, "terms": {"": [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 12, 13, 15, 16, 17, 19, 21, 22, 23, 24, 25, 26, 27, 29, 30, 32, 33, 39, 40, 41], "0": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 41], "00": [0, 1, 5, 11, 32, 33, 39, 40], "000": [1, 3, 40], "000000": [], "00000000e": [], "001": [2, 8, 13, 21, 34, 35, 41], "004": 5, "004113634617443131": 33, "004113634617443139": 33, "00411363461744314": 33, "004113634617443147": 33, "005b82": [], "00622f": [], "00727646693": [0, 32], "0072b2": [], "00749c": [], "0076268": 21, "008561": [], "0086649156": [0, 32], "00e0e0": [], "01": [0, 1, 2, 5, 9, 11, 13, 17, 31, 32, 33, 35, 37, 38, 39, 40, 41], "010726": [], "0110": 29, "01719003e": [], "02": [0, 4, 7, 12, 32, 37, 38, 40], "02334824": [], "023b95": [], "024c1a": [], "025": 27, "02857": 4, "02f": 6, "03077640549": 4, "03097597e": [], "031": 5, "04": 11, "0458": 9, "05": [4, 6], "0550ae": [], "05767": 39, "062292565": 4, "062435": [], "06730814": [], "07": [], "0713": [0, 32], "07285": 3, "08": 29, "08078025e": [], "080808": [], "08336233266": 4, "08376632": 33, "083766322923899": 33, "0837663229239043": 33, "0917": 9, "0969da4a": [], "0d1117": [], "0n": [0, 32], "0x113e21950": 17, "1": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 23, 25, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38], "10": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 21, 22, 23, 25, 26, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41], "100": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 25, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "1000": [0, 1, 2, 4, 5, 8, 11, 13, 14, 18, 19, 21, 23, 24, 27, 29, 32, 34, 35, 37, 38, 40, 41], "10000": [2, 5, 6, 10, 11, 13, 29, 36, 41], "100000": 8, "10001": 10, "1001": 29, "1002": 29, "1003": 29, "1005": 29, "1007": [36, 37], "1009": 29, "101": 16, "1011": 29, "1013": 29, "1013904243": 29, "1015": 29, "102": 16, "1023": 29, "1024": 3, "1026": 29, "1027": 29, "103": [1, 40], "1030": 29, "1037": 29, "1038": 29, "1040": 29, "1047": 29, "107": 16, "108": [], "10e": [40, 41], "10th": 9, "10x": [0, 27, 32], "10y": 27, "11": [0, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 23, 25, 26, 27, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "110": [], "1100": 29, "1101": 29, "111": [1, 7, 12, 37, 38, 39, 40], "112": 16, "11340253": [], "11590451": [], "116": 16, "116329": [], "116633": [], "117": 16, "118": 16, "12": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 18, 21, 23, 25, 26, 27, 29, 31, 32, 33, 34, 35, 36, 38, 40, 41], "120": 3, "121": [8, 9, 10, 16], "1215pm": [30, 32], "122": [8, 9, 10], "124": [0, 32], "125": 16, "127": [4, 16], "128": [3, 4, 13, 35], "129": 16, "1298": 9, "12pm": [30, 32], "13": [0, 2, 9, 12, 22, 23, 25, 27, 29, 32, 38, 41], "131": 16, "133": [7, 37], "135": 16, "136": 16, "14": [0, 2, 4, 6, 8, 9, 10, 12, 25, 27, 29, 31, 33, 36, 37, 41], "141": 16, "1412": 35, "141414": [], "143": 16, "1446729567": 4, "149": 16, "14g": [6, 36], "15": [0, 2, 4, 6, 7, 8, 9, 12, 13, 26, 27, 29, 32, 34, 35, 37, 38, 41], "150": [4, 8, 21, 37, 38], "1502": 39, "152": 16, "153760": [], "156": 16, "157": [], "158": [], "159": 16, "15g": [6, 36], "15pm": 32, "16": [1, 2, 3, 4, 5, 8, 9, 10, 21, 29, 32, 34, 36, 41], "160": 16, "1603": 3, "161": 16, "162": 16, "16231451": 4, "163": 16, "16384": 3, "164": 16, "167": 16, "17": [1, 2, 8, 22, 29, 40, 41], "172": 16, "173": 16, "175": [36, 37], "176": 16, "178": 16, "179": 16, "1797": [1, 40], "18": [2, 6, 7, 8, 9, 10, 29, 32, 36, 37, 41], "1807": 4, "181036": [], "18392847": [], "18c1c4": [], "19": [2, 29, 32, 36, 41], "192": [36, 37], "1940": [], "1943": [12, 38, 39], "19569961": 33, "19680801": [], "1970": [25, 32], "1973": 9, "1979": [6, 36], "1989": 39, "1991": 39, "1_1": [12, 38], "1_2": [12, 38], "1_3": [12, 38], "1cm": [0, 8, 10, 29, 32, 39, 40], "1d": [1, 2, 3, 37, 38, 40, 41], "1e": [2, 4, 13, 14, 35, 37, 38, 40, 41], "1e10": 14, "1e1e1": [], "1e4": 6, "1f": 1, "1ffvbn0xlhv": 22, "1k": 25, "1n": [0, 32], "1x": [0, 32], "1zkibvqf": 21, "2": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 23, 24, 25, 26, 29, 31, 35, 36, 37, 38], "20": [0, 1, 2, 6, 7, 8, 16, 17, 23, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40], "200": [0, 2, 3, 4, 8, 9, 10, 37, 38, 41], "2000": [0, 33], "2001": [], "2004": [13, 34], "2006": 31, "2007": [], "20072279": [], "2008": [32, 35], "2009": [], "2010": [1, 40], "2011": [1, 35, 40], "2012": 35, "2013": [], "2014": [4, 35], "2015": [1, 40, 41], "2016": [0, 32], "2017": 41, "2018": [0, 6, 33, 36, 37], "2019": [], "2020": [], "2021": [6, 14, 33, 35], "2022": [27, 32, 39, 40], "2023": [40, 41], "2024": [21, 36], "2025": [18, 21, 22, 23, 27, 32, 33, 34, 35, 36, 41], "21": [0, 1, 5, 7, 9, 12, 23, 25, 32, 33, 34, 37, 38, 39, 40], "2116753732": 4, "215pm": [30, 32], "2167072": [], "22": [0, 1, 5, 12, 13, 23, 25, 32, 33, 34, 38, 40], "221": 8, "225": 4, "22948497": [], "23": [1, 12, 23, 25, 38, 40], "24": [0, 1, 23, 25, 32, 40], "242424": [], "24292f": [], "25": [2, 3, 4, 5, 6, 8, 9, 11, 33, 41], "250": [2, 4, 7, 9, 37, 41], "25000": [], "250154": [], "252124": [], "253775": [], "255": [3, 27, 41], "256": [4, 35], "25x": [26, 27], "26": [], "26303845": [], "264": [], "265": [], "265109911": 4, "266": [], "269": [], "27": [1, 40], "270": [], "278": [34, 35], "27n_": 29, "28": [1, 3, 4, 40, 41], "283": [34, 35], "2830637392": 4, "2861": 29, "2873": 9, "2882": 29, "2886": 29, "2890": [0, 32], "2892": 29, "29": 33, "2915": 29, "2931": 32, "29364655": [], "294399745619595": [], "296247": [], "2968": 32, "2980": [21, 32], "298273": [], "298375": [], "2990": 32, "2_": [12, 38], "2_1": [12, 38], "2_2": [12, 38], "2_3": [12, 38], "2_i": [12, 38], "2_m": [6, 29, 36], "2_t": 13, "2_x": 29, "2a": 17, "2a1968": [], "2b": 29, "2b2b2b": [], "2c8f433990d1": 35, "2cm": 8, "2d": [1, 3, 11, 12, 24, 27, 32, 37, 38, 39, 40], "2e": [6, 36, 37], "2f": [0, 7, 9, 10, 11, 12, 23, 32, 37, 38, 41], "2g": [2, 41], "2g_i": [2, 41], "2k": 3, "2m": [6, 36], "2mvizaqfst8": 33, "2n": [0, 2, 3, 32, 33, 41], "2nd": 9, "2p": [29, 39], "2pt": 4, "2x": [0, 3, 8, 13, 32, 39], "2x_ix_jy_iy_j": 8, "2x_j": 8, "2xb": 39, "2y_i": 10, "2y_j": 8, "3": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 23, 24, 25, 26, 27, 28, 29, 30, 32, 34, 35, 36, 37, 38], "30": [0, 1, 4, 6, 7, 10, 13, 30, 35, 36, 37, 38, 40, 41], "300": [37, 38], "30000": [0, 32], "3072": 3, "31": [12, 23, 25, 29, 38], "315": [6, 33, 35], "3155": [0, 5, 6, 33, 34, 35, 36, 37], "32": [3, 4, 6, 12, 13, 23, 25, 29, 35, 38], "3200": [1, 40], "3250": [1, 40], "3297": [], "33": [12, 23, 25, 30, 38], "3303": [], "3310": [], "332331": [], "333": [7, 37], "3331": [], "3337": [], "34": 25, "3436": [0, 32], "3437": [0, 32], "35": [0, 6, 26, 32, 34, 35], "3581341341": 4, "359": [5, 34], "36": [0, 5, 6, 18, 26, 29], "37": [26, 34, 36, 37], "370782966": 4, "38": [26, 29], "387": [36, 37], "39": [0, 26, 27, 30, 32], "3d": [2, 3, 4, 6, 13, 16, 36, 37, 41], "3d73a9": [], "3f": [1, 3, 9, 40, 41], "3n": 25, "3x": [2, 8, 41], "3x_0x_1": 39, "3x_i": [2, 41], "3y": 8, "4": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 25, 26, 27, 29, 32, 34, 35, 36, 37, 38, 39, 41], "40": [1, 6, 30, 32, 36, 37, 40, 41], "400": 4, "4000": 32, "40008b9a5380fcacce3976bf7c08af5b": 35, "4050": [31, 32], "41": [23, 25, 27, 41], "4155": [2, 15, 41], "41589548": [], "42": [1, 4, 8, 9, 10, 23, 25, 27, 37, 38, 39, 41], "43": [0, 7, 25], "4310": 32, "436462435": 4, "437a6b": [], "44": [0, 25, 34, 35, 41], "45": [30, 32], "46": [30, 32], "462": [7, 37], "468": 41, "47": [30, 32], "473d18": [], "479465113": 4, "47958494": [], "48": [], "48257387": [30, 32], "49": [5, 6, 11], "49152": 3, "4940954": [0, 32], "4990": 29, "4992": 29, "4997": 29, "4c4b4be8": [], "4c4c7f": [9, 10], "4d": 3, "4f": [6, 27, 37, 38, 41], "4pm": [30, 32], "4y": 8, "4y_i": 10, "5": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "50": [1, 2, 3, 4, 6, 7, 8, 10, 13, 27, 32, 33, 35, 36, 38, 39, 40, 41], "500": [1, 3, 4, 6, 9, 10, 13, 35, 36, 37, 40], "5000": [26, 27], "5018": 29, "506": [], "507d50": [9, 10], "50j": 13, "50x10": [1, 40], "51": 10, "510": [1, 40], "512132": [], "515151": [], "5177783846": 4, "52": 37, "53": [9, 37], "5391cf": [], "54": [6, 29], "5411205": [], "54894451": [], "55": [1, 40], "56": [1, 40], "56469864": 21, "56536": [0, 32], "569": 1, "57": [0, 8, 30, 32], "571": [5, 34], "576": 36, "58": [10, 30, 32], "58a6ff70": [], "591317992": 4, "5ca7e4": [], "5cm": 29, "5f": [8, 35], "5x": [8, 18], "5y": 8, "6": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 18, 25, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41], "60": [1, 3], "60000": 4, "6019067271": 4, "60610368": 21, "606439": [], "61362": 27, "622cbc": [], "625": [7, 37], "63": [1, 40], "64": [1, 3, 4, 13, 25, 32, 35, 40, 41], "64x50": [1, 40], "65": [1, 8, 9, 40], "66666691": [], "66707b": [], "66ccee": [], "66e9ec": [], "6730c5": [], "6887363571": 4, "69": [16, 29], "69069n_": 29, "691": [], "6980": 35, "6e7681": [], "6e7781": [], "6f98b3": [], "6n_": 29, "7": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 25, 26, 27, 29, 31, 32, 33, 35, 36, 37, 38, 39, 40, 41], "70": [1, 7, 37, 40], "702c00": [], "70653767": 4, "71": [1, 40], "724": 3, "72f088": [], "73": [], "7304881": [], "737373": [], "75": [5, 6, 8, 11, 36], "76": [30, 32, 37], "765": [7, 37], "77": [30, 32], "7718": 9, "7782028952": 4, "77893972": [], "78": [], "784": 41, "797979": [], "7998f2": [], "79c0ff": [], "7d7d58": [9, 10], "7ee787": [], "7f4707": [], "8": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 18, 19, 21, 25, 27, 29, 30, 32, 34, 37, 38, 40, 41], "80": [0, 1, 5, 8, 17, 33, 40], "800": [4, 7, 37], "8045e5": [], "81": [1, 40], "815am": [30, 32], "81b19b": [], "8250df": [], "84858": [36, 37], "85": [1, 40], "8702784034": 4, "8786ac": [], "88": 32, "8a4600": [], "8b949e": [], "8c8c8c": [], "8f": [6, 36, 37], "8g": [6, 36], "8n": 25, "8x8": [1, 40, 41], "9": [0, 1, 2, 4, 5, 6, 7, 8, 9, 11, 12, 13, 25, 29, 32, 35, 37, 38, 40, 41], "90": 1, "9040": 9, "91": [30, 32], "912583": [], "91cbff": [], "92": [30, 32], "93": 16, "931": [0, 32], "933": [5, 34], "937": 29, "938": 29, "939": [0, 29, 32], "94": 29, "95": [1, 11, 36, 40], "953800": [], "954": 29, "955820c21e8b": 4, "9579870417283": 21, "96": [6, 36], "960": 29, "961": 29, "962": 29, "9649652536": 4, "96611194e": [], "974eb7": [], "978": [36, 37], "9780387310732": 31, "9780387848570": 31, "9781098134174": 32, "9781492032632": 31, "9781801819312": 32, "97898392": 33, "98": [0, 1, 16, 40], "985": 29, "986": 29, "98661b": [], "989": 29, "9898ff": [9, 10], "99": [13, 16, 35, 36], "991": 29, "992": 29, "993": 29, "996": 5, "996b00": [], "999": [9, 29, 35, 40, 41], "999999": [], "9e86c8": [], "9e8741": [], "9f4e55": [], "9x": 6, "9y": 6, "A": [2, 3, 5, 6, 7, 10, 11, 12, 13, 15, 16, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 39], "AND": [2, 41], "AS": [], "AT": [], "And": [0, 3, 4, 5, 6, 9, 13, 20, 22, 24, 26, 27, 29, 34], "As": [0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 13, 15, 16, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "At": [0, 4, 6, 13, 20, 23, 32, 35], "BE": [0, 32], "BUT": [], "BY": [], "Be": [2, 18, 24, 32, 41], "Being": 13, "But": [0, 1, 2, 3, 5, 6, 9, 10, 16, 21, 27, 29, 33, 36, 37, 40, 41], "By": [0, 3, 5, 6, 12, 13, 17, 19, 23, 25, 32, 33, 34, 35, 36, 38], "FOR": [], "For": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "IF": [6, 33, 35], "IN": 31, "If": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 18, 21, 22, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "In": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41], "Ising": [5, 12, 33, 34, 38, 39], "It": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 18, 20, 21, 22, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "Its": [1, 2, 4, 11, 40, 41], "NO": [], "NOT": [], "No": [6, 9, 32, 33, 35, 38, 40, 41], "Not": [0, 1, 5, 6, 33, 34, 35, 36, 38, 40, 41], "OF": [], "ON": [], "OR": 29, "Of": 29, "On": [0, 3, 26, 29, 30, 31, 32, 35, 36], "One": [0, 1, 3, 4, 5, 6, 7, 8, 11, 12, 13, 17, 29, 33, 34, 35, 36, 37, 38, 39, 40], "Or": [0, 1, 6, 32, 40], "SUCH": [], "Such": [0, 6, 12, 16, 29, 35, 36, 37, 38, 39, 40], "THE": [], "TO": [40, 41], "That": [0, 5, 7, 10, 11, 12, 14, 26, 27, 29, 32, 36, 37, 38, 39, 40], "The": [4, 10, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31], "Then": [0, 1, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 23, 25, 32, 34, 35, 36, 39, 40, 41], "There": [0, 3, 4, 5, 6, 8, 9, 11, 12, 14, 15, 25, 26, 27, 29, 30, 32, 33, 34, 35, 38, 39], "These": [0, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 17, 18, 22, 23, 25, 26, 27, 29, 30, 32, 33, 34, 35, 39, 40, 41], "To": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 20, 21, 22, 23, 25, 27, 29, 33, 34, 35, 36, 37, 38, 39, 40, 41], "WITH": [], "Will": [37, 38], "With": [0, 5, 6, 8, 9, 10, 11, 12, 14, 16, 19, 21, 25, 26, 27, 29, 32, 33, 36, 37, 38, 39, 40, 41], "_": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 21, 23, 25, 26, 32, 33, 34, 35, 36, 37, 38, 40, 41], "_0": [5, 8, 10, 11, 13, 33, 34], "_1": [2, 5, 6, 8, 10, 11, 12, 13, 14, 23, 25, 33, 34, 35, 39, 40, 41], "_2": [2, 5, 8, 11, 12, 13, 25, 33, 35, 38, 41], "_3": 25, "_4": 25, "_9": [13, 35], "__array_finalize__": [], "__class__": [10, 40, 41], "__doc__": [6, 36, 37], "__future__": [8, 9, 39], "__getattribute__": [], "__import__": [], "__init__": [1, 22, 37, 38, 40, 41], "__main__": [2, 41], "__name__": [2, 10, 40, 41], "__new__": [], "__path__": [], "_accuraci": [40, 41], "_add_intercept": [37, 38], "_auto1": [2, 3, 4, 5, 6, 7, 12, 13, 25, 29, 33, 34, 37, 38, 39, 40, 41], "_auto10": [6, 12], "_auto11": 6, "_auto12": 6, "_auto2": [2, 3, 4, 5, 6, 12, 13, 25, 29, 38, 39, 40, 41], "_auto3": [3, 4, 5, 6, 12, 13, 25, 38, 39, 40], "_auto4": [4, 6, 12, 13, 25, 38], "_auto5": [4, 6, 12, 13, 25, 38], "_auto6": [4, 6, 12, 25, 38], "_auto7": [4, 6, 12, 25, 38], "_auto8": [6, 12], "_auto9": [6, 12], "_backpropag": [40, 41], "_build": [0, 24, 26, 27, 31, 32, 40, 41], "_c": [1, 40], "_center": [], "_compile_transl": [], "_compon": 11, "_da": 22, "_data": [], "_depth": 9, "_export": [15, 16, 19], "_feed_forward_sav": 22, "_feedforward": [40, 41], "_format": [40, 41], "_fraction": 9, "_i": [0, 1, 2, 5, 6, 7, 8, 11, 12, 13, 19, 23, 26, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "_j": [0, 1, 2, 3, 5, 6, 8, 13, 19, 26, 33, 34, 35, 36, 37, 40, 41], "_k": [13, 34, 35, 40, 41], "_l": [12, 38, 39, 40, 41], "_lambda": 6, "_leaf": 9, "_m": 10, "_mask": [], "_multilayer_perceptron": [], "_n": [2, 5, 8, 11, 13, 33, 34, 35, 41], "_node": 9, "_norm": [], "_p": [5, 8, 33, 34], "_parse_numpydoc_see_also_sect": [], "_progress_bar": [40, 41], "_pydevd_bundl": [], "_ratio": 11, "_sampl": 9, "_set_classif": [40, 41], "_sigmoid": [37, 38], "_softmax": [37, 38], "_split": [6, 9, 26], "_t": [13, 35], "_test": [6, 26], "_varianc": 11, "_weight": 9, "a0": 3, "a0111f": [], "a0faa0": [9, 10], "a1": [0, 21, 22, 32], "a11": [], "a12236": [], "a2": [0, 21, 22, 32], "a25e53": [], "a2bffc": [], "a3": [0, 32], "a4": [0, 32], "a5d6ff": [], "a_": [0, 1, 16, 25, 32, 33, 39, 40], "a_0": [0, 32, 39, 40], "a_1": [39, 40], "a_1a": [0, 32], "a_2": [39, 40], "a_2a": [0, 32], "a_3": [0, 32], "a_3a": [0, 32], "a_4": [0, 32], "a_4a": [0, 32], "a_h": [1, 40], "a_i": [0, 1, 2, 12, 32, 39, 40, 41], "a_j": [1, 12, 39, 40, 41], "a_k": [0, 1, 12, 39, 40], "a_matric": [40, 41], "aa": [], "aaa": [], "aaron": 31, "ab": [0, 2, 5, 13, 14, 32, 33, 35, 39, 41], "ab6369": [], "ab_channel": [24, 38, 39, 40, 41], "abandon": [1, 40], "abe338": [], "abid": 29, "abil": [0, 10], "abl": [0, 1, 4, 5, 6, 7, 10, 12, 13, 16, 18, 20, 21, 26, 33, 34, 35, 37, 38, 39, 40], "about": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 19, 20, 22, 23, 24, 25, 26, 30, 35, 36, 37, 38, 40, 41], "abov": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 27, 29, 31, 32, 33, 35, 36, 37, 38], "abovement": [6, 26, 32, 36, 37], "abscissa": [13, 34], "absent": 35, "absolut": [0, 2, 5, 6, 13, 32, 33, 34, 36, 37, 41], "absorb": [33, 34], "abstract": [1, 35, 37, 40, 41], "abund": 35, "ac": [], "acc_bin": [37, 38], "acc_multi": [37, 38], "acceler": [13, 35], "accept": [0, 3, 6, 9, 21, 26, 33, 35], "access": [3, 11, 29, 32, 35], "accid": [4, 6, 36, 37], "accompani": [0, 32, 33], "accomplish": [8, 9, 13, 35], "accord": [0, 1, 2, 5, 6, 9, 12, 13, 14, 29, 32, 34, 35, 36, 38, 39, 40, 41], "accordingli": 11, "account": [0, 3, 5, 13, 15, 16, 20, 23, 29, 32, 35], "accumul": [12, 13, 29, 35, 38, 39, 40, 41], "accur": [0, 3, 4, 6, 10, 13, 35, 36, 37], "accuraci": [0, 1, 3, 4, 5, 6, 7, 9, 10, 11, 12, 21, 23, 27, 32, 33, 34, 37, 38, 39, 40, 41], "accuracy_scor": [0, 1, 10, 21, 22, 27, 32, 37, 38, 40], "accuracy_score_numpi": [1, 40], "acheiv": 21, "achiev": [0, 1, 5, 6, 8, 12, 25, 32, 35, 36, 37, 38, 39, 40], "aco": 29, "acquaint": 24, "acquir": [1, 24, 32, 40], "acr": [], "across": [1, 3, 6, 9, 17, 23, 24, 32, 36, 40], "act": [1, 3, 23, 25, 27, 35, 40, 41], "act_func": [40, 41], "act_func_deriv": [40, 41], "actic": 21, "action": 29, "activ": [0, 2, 3, 4, 9, 15, 22, 28, 30, 32, 35], "activation_d": 22, "activation_func": [21, 22], "activest": [], "actual": [0, 1, 4, 5, 6, 8, 11, 15, 16, 18, 21, 23, 25, 29, 32, 33, 34, 35, 36, 40], "ad": [1, 3, 4, 5, 8, 13, 15, 16, 25, 34, 35, 36, 37, 41], "ada_clf": 10, "adaboostclassifi": 10, "adadelta": [13, 35], "adagrad": [26, 36, 39, 40, 41], "adagradmomentum": [40, 41], "adam": [1, 3, 4, 21, 26, 27, 32, 36, 39, 40, 41], "adam_schedul": [40, 41], "adap": 39, "adapt": [4, 6, 13, 17, 27, 31, 34, 36, 37, 39, 41], "add": [0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 15, 16, 17, 18, 20, 21, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "add6ff": [], "add_": [], "add_subplot": [1, 7, 12, 14, 37, 38, 40], "add_suplot": 41, "addendum": 5, "addeventlisten": [], "addit": [0, 2, 3, 5, 6, 7, 8, 9, 10, 12, 13, 15, 21, 24, 25, 26, 27, 29, 30, 31, 32, 33, 36, 37, 38, 39, 40, 41], "addition": [12, 13, 34, 35, 38, 39], "address": [1, 9, 11, 13, 32, 35, 40], "adjac": [3, 12, 38, 39], "adjoint": [5, 33], "adjust": [0, 5, 12, 13, 34, 35, 38], "admir": [0, 32], "advanc": [4, 6, 12, 31, 32, 35, 36, 37, 38, 39], "advantag": [1, 3, 5, 6, 10, 13, 19, 25, 27, 34, 35, 36, 37, 40], "adversari": 32, "advis": [], "afecionado": 32, "affect": [3, 15, 19, 40, 41], "affin": [0, 3, 8, 11, 33, 39], "afford": 3, "aficionado": 32, "aforement": 14, "african": [], "after": [0, 1, 2, 4, 5, 6, 9, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 39, 40, 41], "afterward": [0, 32], "ag": [0, 7, 32, 33, 37], "ag_0": [2, 41], "again": [0, 1, 4, 5, 6, 7, 8, 10, 11, 12, 13, 26, 27, 29, 32, 33, 34, 36, 37, 38, 39, 40, 41], "against": [1, 4, 7, 10, 37, 40], "agegroup": [7, 37], "agegroupmean": [7, 37], "aggreg": [9, 10, 35], "agorithm": 10, "agre": [5, 6, 29, 33, 34, 35, 36], "agreement": [13, 35], "ahead": 9, "ai": [0, 31], "aid": [11, 20, 35], "aim": [0, 1, 4, 6, 7, 11, 14, 16, 17, 19, 20, 24, 25, 26, 27, 33, 36, 37, 38, 39, 40], "ainv": 5, "airplan": 3, "aka": [5, 27], "al": [0, 2, 4, 16, 17, 20, 27, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41], "alarm": [5, 7], "aldo": 33, "alexsmola": 41, "algebra": [0, 3, 5, 13, 24, 33, 34, 36], "algorithm": [0, 1, 2, 4, 5, 6, 7, 8, 13, 14, 16, 24, 25, 26, 29, 31, 36, 37, 38], "align": [0, 2, 5, 6, 7, 8, 13, 29, 32, 33, 34, 36, 37, 38, 41], "all": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 41], "allclos": 21, "allevi": [1, 13, 34, 40], "alloc": [3, 25], "allow": [0, 1, 2, 3, 5, 6, 8, 10, 13, 15, 23, 24, 25, 26, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "almost": [0, 1, 6, 8, 11, 13, 29, 34, 35, 36, 37, 38, 40], "alon": [2, 9, 35, 41], "along": [2, 3, 4, 5, 6, 9, 10, 11, 15, 20, 21, 22, 24, 25, 32, 33, 34, 36, 37, 40, 41], "alpha": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 13, 14, 23, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41], "alpha_": [10, 35], "alpha_0": 3, "alpha_1": 3, "alpha_2": 3, "alpha_i": [3, 13], "alpha_k": 13, "alpha_m": 10, "alpha_n": 3, "alpha_opt": 13, "alreadi": [2, 3, 4, 5, 6, 10, 12, 15, 22, 24, 25, 29, 32, 33, 34, 37, 38, 39, 41], "also": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "alter": [1, 40], "altern": [0, 1, 4, 5, 6, 8, 9, 11, 13, 15, 18, 23, 25, 26, 32, 33, 35, 36, 37, 40], "although": [0, 1, 5, 6, 8, 10, 13, 16, 19, 20, 32, 35, 36, 37, 39, 40, 41], "alwai": [0, 3, 5, 6, 12, 13, 16, 19, 21, 22, 26, 27, 29, 32, 33, 34, 35, 36, 38, 39], "am": 4, "ambit": [39, 40], "ame2016": [0, 32], "american": [], "amjith": [], "among": [0, 3, 5, 9, 10, 12, 23, 25, 32, 33, 38, 39], "amongst": [5, 36], "amount": [0, 1, 3, 4, 6, 8, 10, 14, 24, 36, 37, 39, 40, 41], "an": [1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 33, 34, 35, 36, 37, 38, 40, 41], "an_": 29, "anaconda": [0, 1, 24, 26, 32, 40, 41], "analogi": 13, "analys": [6, 36, 37], "analysi": [1, 3, 4, 7, 14, 19, 23, 25, 31, 35, 38, 40], "analyt": [2, 3, 5, 6, 7, 12, 13, 17, 22, 24, 26, 32, 33, 34, 35, 36, 37, 38, 39], "analyz": [0, 1, 3, 4, 5, 6, 16, 26, 29, 33, 34, 35, 41], "andrew": [1, 40], "angl": [0, 3, 9, 33, 35], "anharmon": 3, "ani": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 19, 21, 29, 32, 33, 35, 36, 39, 40, 41], "anim": [4, 12, 38, 39], "ann": [12, 38, 39], "annot": [0, 1, 3, 7, 8, 32, 38, 40, 41], "announc": 32, "anom": [], "anomali": [], "anonym": 18, "anoth": [0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 25, 26, 27, 29, 32, 33, 35, 39, 40, 41], "ansatz": [0, 18, 32], "answer": [0, 1, 3, 5, 6, 19, 22, 25, 26, 27, 30, 32, 36, 40], "antialias": [2, 6, 41], "anticip": 4, "anymor": [1, 8, 40], "anyon": [4, 8, 15], "anyth": [1, 15, 16, 21, 22, 29, 40, 41], "anytim": [30, 32], "anywai": [], "apach": [1, 40, 41], "apart": [11, 13, 34, 35], "api": [1, 24, 32, 40, 41], "appar": [2, 41], "appear": [0, 1, 3, 13, 25, 29, 39, 40, 41], "append": [1, 3, 4, 8, 9, 13, 19, 21, 22, 32, 35, 37, 38, 40, 41], "appendic": [26, 27], "appendix": 26, "appli": [0, 1, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 18, 26, 27, 29, 31, 32, 33, 35, 36, 37, 38, 39, 40], "applic": [0, 1, 3, 4, 5, 6, 7, 9, 12, 13, 16, 25, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "apply_gradi": 4, "approach": [1, 2, 4, 5, 6, 9, 10, 11, 12, 13, 15, 16, 18, 21, 24, 26, 29, 31, 33, 34, 39, 40, 41], "approch": 26, "appropri": [2, 6, 9, 12, 13, 17, 24, 29, 35, 36, 37, 38, 41], "approv": 32, "approx": [0, 2, 3, 6, 10, 11, 13, 18, 26, 29, 32, 34, 35, 36, 41], "approxim": [0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 13, 19, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41], "apt": [0, 24, 26, 32], "aq": 29, "ar": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "aragorn": 32, "arang": [1, 3, 4, 6, 7, 9, 10, 12, 13, 32, 35, 37, 38, 40, 41], "arbitrari": [1, 4, 6, 8, 12, 13, 29, 34, 36, 38, 39, 40, 41], "arbitrarili": [0, 1, 11, 32, 35, 40], "arc": 6, "architectur": [3, 4, 12, 27, 39, 41], "archiv": [26, 27], "area": [0, 3, 6, 23, 31, 32], "argmax": [1, 11, 21, 37, 38, 40], "argmin": [4, 10, 14], "argsort": 11, "argu": [1, 13, 27, 40], "arguement": 19, "argument": [0, 2, 3, 5, 11, 12, 13, 17, 21, 32, 33, 35, 36, 38, 39, 40, 41], "aris": [0, 6, 12, 13, 29, 32, 34, 36, 37], "arithmet": [0, 13, 25, 32], "arm": [6, 33, 35], "armadillo": 25, "armin": [], "arnulf": [39, 40], "around": [0, 1, 4, 5, 6, 11, 18, 21, 22, 26, 27, 29, 32, 36, 37, 38, 39, 40], "arrai": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 16, 18, 21, 23, 24, 26, 29, 33, 34, 35, 36, 37, 38, 39, 40, 41], "arrang": [3, 32], "array_equ": [37, 38], "arraybox": 13, "arriv": [0, 6, 9, 11, 19, 25, 29, 32, 36], "arrow": [12, 38, 39, 40, 41], "arrowprop": 8, "art": [0, 1, 24, 40], "articl": [0, 3, 4, 6, 10, 19, 27, 32, 33, 34, 35, 36, 37], "artifici": [0, 2, 7, 12, 31, 32, 37, 41], "artificialneuron": [12, 38, 39], "arug": 13, "arxiv": [3, 4, 35, 39], "as_fram": 27, "asarrai": [0, 6, 9, 33, 35], "asid": 33, "ask": [5, 6, 11, 12, 15, 19, 26, 27, 36, 39, 40], "aspect": [0, 6, 24, 32, 33, 39, 40], "assembl": 3, "assembli": [0, 32], "assert": [4, 40, 41], "assess": [0, 6, 26, 32, 33, 36, 37], "asset": [], "assici": 4, "assign": [0, 7, 8, 9, 12, 13, 14, 15, 28, 30, 31, 32, 37, 38, 40], "associ": [0, 6, 9, 12, 14, 29, 32, 36, 37, 38, 39], "assum": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 19, 25, 26, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "assumpt": [0, 3, 5, 6, 9, 11, 29, 32, 33, 37], "ast": [0, 5, 6, 32, 36], "astyp": [4, 9, 10, 37, 38, 41], "asymmetri": [0, 32], "asymptot": [4, 6, 35, 36, 37], "atom": [0, 32], "attain": 35, "attempt": [0, 4, 6, 7, 8, 10, 32, 33, 35, 37, 39, 40], "attend": 32, "attent": [0, 25, 32], "attract": [0, 10, 32], "attribut": [0, 9, 22, 32, 40, 41], "auc": 23, "audi": [0, 32], "audio": [3, 4], "august": [32, 33], "aurelien": [0, 31, 32], "austfjel": 6, "auth": 15, "authent": 15, "author": [0, 1, 10, 29, 40], "authour": 32, "auto": [9, 10, 27, 29, 40, 41], "auto_exampl": [21, 26, 33], "autocor": 29, "autocorrelation_tim": 29, "autocorrelform": 29, "autocovari": 29, "autoencod": [4, 24, 32], "autoencond": 24, "autograd": [21, 24, 27, 32, 39, 40], "autograd_compliant_predict": 22, "autograd_gradi": 22, "autograd_one_lay": 22, "autom": [0, 24, 31, 32], "automac": 25, "automag": 32, "automat": [0, 1, 2, 3, 4, 11, 16, 21, 22, 24, 25, 27, 32, 38, 40], "automobil": 3, "autonom": 4, "avail": [0, 1, 4, 6, 10, 11, 23, 24, 25, 26, 27, 28, 30, 31, 32, 36, 37, 40, 41], "avali": [20, 26, 27], "averag": [0, 1, 3, 6, 9, 10, 13, 14, 23, 29, 30, 32, 33, 36, 37, 40, 41], "avg_loss": 41, "avoid": [0, 4, 5, 6, 9, 11, 13, 18, 21, 25, 33, 35, 36, 37, 40, 41], "awai": [2, 3, 6, 33, 35, 39, 41], "awar": [2, 10, 41], "award": [30, 32], "ax": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 20, 21, 25, 26, 27, 32, 36, 37, 38, 40, 41], "axes3d": [2, 6, 13, 34, 35, 41], "axes_grid1": 6, "axhlin": 8, "axi": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 18, 21, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "axiom": 5, "axvlin": [4, 8], "axvspan": 4, "b": [0, 1, 3, 4, 5, 6, 8, 9, 10, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40], "b1": [8, 21, 22], "b19db4": [], "b1bac4": [], "b2": [8, 21, 22], "b3": 8, "b35900": [], "b89784": [], "b_": [0, 1, 25, 39, 40], "b_0": [0, 39], "b_1": [0, 2, 12, 13, 35, 38, 39, 40, 41], "b_2": [0, 13, 39, 40], "b_5": [13, 35], "b_g": [21, 22], "b_group": 9, "b_i": [0, 1, 2, 12, 32, 38, 39, 40, 41], "b_ia_": [0, 32], "b_ia_i": 0, "b_index": 9, "b_j": [1, 12, 38, 39, 40, 41], "b_k": [0, 1, 12, 13, 35, 38, 39, 40], "b_m": [12, 38], "b_score": 9, "b_valu": 9, "ba": 35, "babcock": 32, "bach": 35, "bachelor": [28, 30], "back": [0, 3, 4, 5, 6, 8, 9, 10, 15, 16, 21, 25, 27, 29, 32, 35], "backbon": 25, "backend": [1, 4, 40, 41], "background": [31, 32, 40], "backprogag": 22, "backpropag": [1, 21, 27, 35, 39, 40, 41], "backpropog": 22, "backslash": [], "backtrack": 9, "backup": 25, "backward": [1, 2, 4, 12, 22, 25, 35, 39, 40, 41], "bad": [6, 17, 27, 33, 40, 41], "badli": 29, "bag": [9, 24, 32], "bag_clf": 10, "baggin": 32, "baggingboot": 10, "baggingclassifi": 10, "baggingtre": 10, "bailei": [], "balanc": [6, 23, 35, 36, 37], "ballpark": 18, "baluka": 41, "band": 25, "bandwidth": 25, "banner": [], "bar": [0, 6, 11, 26, 32, 40, 41], "barber": 31, "bare": [4, 10], "base": [0, 1, 3, 4, 5, 7, 8, 9, 10, 14, 15, 16, 17, 24, 29, 30, 31, 32, 33, 34, 37, 38, 39, 40], "baselin": 23, "basi": [5, 7, 8, 10, 11, 12, 13, 25, 33, 34, 37, 38, 39], "basic": [6, 8, 12, 13, 14, 15, 24, 26, 27, 29, 32, 36, 40, 41], "basin": 35, "batch": [3, 4, 11, 12, 13, 21, 34, 37, 38, 41], "batch_shap": 4, "batch_siz": [1, 3, 4, 40, 41], "batchnorm": 4, "bay": [7, 37, 38], "baydin": 39, "bayesian": [5, 24, 31, 32], "bbbbbb": [], "beauti": [], "becam": [], "becaus": [0, 1, 2, 3, 4, 5, 6, 8, 9, 12, 13, 14, 32, 33, 34, 35, 36, 37, 38, 40, 41], "becom": [0, 1, 2, 5, 6, 7, 9, 12, 13, 19, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "been": [0, 1, 2, 3, 4, 5, 6, 11, 12, 13, 19, 20, 24, 25, 26, 27, 32, 33, 35, 36, 38, 39, 40, 41], "befor": [0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 25, 26, 29, 32, 33, 35, 36, 37, 38, 39, 40, 41], "beforehand": [0, 29, 32], "began": [], "begin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 22, 23, 25, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "beginn": 27, "behav": [1, 6, 13, 34, 36, 37, 40], "behavior": [0, 1, 13, 32, 34, 35, 40], "behaviour": [12, 35, 38, 39, 40], "behind": [0, 1, 6, 8, 13, 32, 34, 40], "being": [0, 1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 17, 20, 29, 32, 33, 34, 35, 37, 38, 39, 40, 41], "believ": [9, 25], "belong": [7, 8, 9, 13, 14, 34, 37, 38, 40, 41], "below": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 18, 21, 22, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "benchmark": [10, 27], "benefici": [1, 13, 40], "benefit": [0, 1, 4, 11, 13, 24, 32, 34, 35, 40], "bengio": [1, 27, 31, 32, 33, 35], "benign": [1, 7, 38], "benno": [39, 40], "berner": [39, 40], "besid": [4, 5, 34], "bessel": [5, 33, 36], "best": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 18, 21, 23, 27, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41], "beta": [1, 3, 10, 11, 13, 16, 17, 19, 32, 33, 34, 40, 41], "beta1": [], "beta2": [], "beta_": [3, 13, 17, 33], "beta_0": [1, 3, 13, 33, 40], "beta_1": [1, 3, 10, 13, 33, 35, 40], "beta_1m_": 35, "beta_1x_i": 13, "beta_2": [3, 13, 35], "beta_2v_": 35, "beta_3": 3, "beta_i": [3, 35], "beta_j": [13, 33], "beta_k": 13, "beta_linreg": 13, "beta_m": 10, "beta_mg_m": 10, "beta_n": 3, "better": [0, 1, 2, 3, 4, 6, 9, 10, 11, 12, 13, 19, 20, 22, 23, 32, 33, 35, 36, 40, 41], "between": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "beyond": [0, 1, 5, 6, 8, 13, 32, 33, 34, 35, 40], "bf": [13, 14, 25, 29, 34], "bf5400": [], "bg": 32, "bgd": [13, 35], "bia": [0, 1, 2, 3, 5, 8, 9, 10, 12, 13, 20, 21, 22, 27, 32, 33, 34, 38, 39, 40, 41], "bias": [1, 2, 3, 5, 6, 9, 12, 19, 21, 22, 27, 35, 36, 38, 41], "bib": [], "bibliographi": [26, 27], "bibtex": [], "big": [0, 1, 2, 5, 6, 14, 19, 35, 36, 40, 41], "bigger": [1, 6, 33, 40], "bigl": 23, "bigr": [12, 23, 38], "bike": 9, "bilbo": 32, "billion": [3, 12, 24, 35, 38, 39], "bin": [7, 29, 38], "binari": [0, 3, 5, 7, 9, 10, 12, 23, 27, 32, 37, 38, 41], "binary_cross_entropi": [37, 38], "binary_result": [37, 38], "binarycrossentropi": 4, "bind": 0, "binomi": [24, 29, 32], "binsboot": [6, 36], "bioinformat": 0, "biolog": [1, 12, 38, 39, 40], "bios1100": [24, 32], "bird": [0, 3], "birth": 32, "bishop": [31, 32], "bit": [1, 4, 19, 21, 25, 29, 32, 40, 41], "bitwis": 29, "bivari": [2, 41], "bk": [13, 35], "bla": [25, 32], "black": [8, 9, 14], "blame": [], "block": [6, 10, 24, 25, 29, 32, 36, 37], "blockquot": [], "blog": [27, 32], "blogpost": 4, "blue": [0, 3], "bm": [], "bmatrix": [0, 1, 3, 5, 7, 8, 11, 13, 25, 32, 33, 34, 35, 37, 38, 39, 40], "bmi": [1, 40], "bodi": [0, 1, 4, 12, 38, 39, 40], "bold": 1, "boldfac": [0, 5, 16, 33, 34], "boldsymbol": [0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 13, 14, 16, 17, 19, 26, 32, 34, 35, 37, 38, 39, 40, 41], "boltzmann": [12, 24, 32, 38, 39], "book": [17, 26, 27, 31, 32, 33, 36, 37, 41], "book1": 31, "bool": [], "boolean": [4, 17], "boost": [1, 9, 24, 32, 40], "boostrap": 10, "bootstrap": [1, 13, 19, 24, 26, 32, 35, 40, 41], "born": 35, "borrow": 32, "boston_dataset": [], "bot": 8, "both": [0, 1, 4, 5, 6, 8, 9, 10, 13, 14, 15, 16, 17, 19, 23, 24, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41], "bottl": [7, 37, 38], "bottou": 35, "bound": [8, 12, 35, 38, 39, 40, 41], "boundari": [2, 4, 8, 11, 12, 41], "bousquet": 35, "bower": [], "box": [4, 9, 21, 22], "boyd": [8, 13, 34], "bracket": [4, 29], "brain": [1, 7, 12, 37, 38, 39, 40, 41], "branch": [9, 32], "break": [0, 4, 6, 11, 14, 32, 35], "breast": [5, 7, 11, 38], "breviti": 13, "brew": [0, 24, 26, 32], "brg": 8, "brian": [], "brief": [26, 27, 33], "briefli": [0, 16, 19, 27, 32, 36], "bring": [0, 5, 6, 10, 27, 33, 35], "britt": [30, 32], "broad": 0, "broadcast": 21, "broadli": 32, "brought": [13, 24, 32], "brownle": 4, "browser": [15, 32], "brute": [3, 5, 11, 33, 39], "bsd": [], "budget": 35, "buffer_s": 4, "bug": [], "bugfix": [], "bui": 4, "build": [0, 4, 5, 6, 10, 16, 22, 25, 29, 32, 36, 37, 38, 39], "buildmodel_tutori": 27, "built": [1, 3, 4, 6, 36, 37, 40, 41], "bunch": 11, "bundl": [], "busi": [], "bxe2t": [38, 39, 40], "byte": [25, 32], "c": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41], "c1": [8, 11], "c2": [8, 11], "c4a2f5": [], "c5e478": [], "c9d1d9": [], "c_": [8, 9, 10, 13, 29, 34, 35], "c_0": 29, "c_1": [12, 38], "c_2": [12, 38], "c_3": [12, 38], "c_4": [12, 38], "c_i": [12, 13, 35, 38], "c_k": 29, "ca": [1, 32], "caab6d": [], "cach": 10, "cal": [0, 8, 10, 12, 13, 34, 35, 39, 40, 41], "calcul": [0, 1, 2, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 19, 22, 25, 27, 29, 32, 35, 36, 37, 38, 39, 40, 41], "california": [26, 27], "call": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 19, 21, 23, 24, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "callabl": [40, 41], "calor": [0, 33], "caltech": [], "cambridg": [13, 31, 34, 39, 40], "can": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 33, 34, 38, 40, 41], "cancel": [0, 13, 32, 33], "cancer": [5, 10, 23, 38], "cancerpd": [7, 38], "candid": [8, 9, 10, 35], "cannot": [0, 1, 4, 5, 6, 7, 8, 9, 26, 29, 33, 34, 35, 38, 40], "canopi": [0, 24, 26, 32], "canva": [15, 16, 19, 20, 26, 27, 32], "cap": 5, "capabl": [0, 1, 8, 13, 24, 32], "capac": [2, 30, 41], "capita": [], "caption": [20, 26, 27], "captur": [4, 11, 12, 23, 32, 38, 39], "car": [3, 4], "card": [0, 7, 32, 37, 38], "cardin": [1, 40], "care": [11, 15, 19, 22, 35], "carefulli": [13, 35], "carlo": [0, 6, 24, 29, 31, 32, 36, 37], "carri": [2, 6, 7, 26, 36, 37, 38, 41], "cart": 10, "case": [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 23, 24, 25, 26, 27, 32, 36, 39, 40, 41], "casella": 31, "cast": [1, 40], "cat": [3, 4], "catch": 0, "categor": [0, 1, 3, 9, 11, 32, 37, 38, 40, 41], "categori": [0, 1, 3, 7, 10, 12, 14, 32, 37, 38, 39, 40], "categorical_cross_entropi": [37, 38], "categorical_crossentropi": [1, 3, 40, 41], "caus": [0, 5, 6, 29, 32, 33, 34, 35, 36, 37], "causal": 0, "causat": [0, 32], "cax": 1, "cb": [6, 32], "cbar": 1, "cc": [0, 1, 5, 13, 23, 32, 33, 34, 35, 39, 40, 41], "cc398b": [], "ccbb44": [], "ccc": [5, 12, 23, 34, 38], "cdf": 29, "cdot": [0, 2, 6, 12, 13, 14, 25, 29, 32, 34, 35, 36, 38, 41], "celebr": [13, 34], "cell": [4, 21, 22], "center": [0, 1, 6, 7, 8, 9, 11, 14, 18, 26, 29, 32, 33, 35, 36, 37, 38, 40], "central": [0, 3, 5, 6, 8, 16, 20, 25, 27, 32, 33, 39, 40], "centroid": [14, 29], "centroid_differ": 14, "centuri": 3, "certain": [0, 3, 6, 7, 9, 21, 29, 32, 33, 36, 37, 38], "certainti": 36, "cf": [], "cf222e": [], "cffi": [], "cg": 13, "cha": [], "chain": [0, 1, 13, 22, 24, 29, 32], "challeng": [15, 39], "chanc": [1, 5, 13, 29, 35, 40], "chang": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 13, 14, 15, 16, 19, 21, 22, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "changeabl": 27, "changelog": [], "channel": 3, "chap4": [39, 40], "chapter": [0, 6, 10, 11, 16, 17, 19, 25, 26, 27, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "chapter3": [0, 26], "charact": [0, 3, 5, 32, 33, 34], "character": [8, 9, 10, 12, 29, 38, 40, 41], "characterist": [0, 1, 3, 10, 13, 23, 32, 40, 41], "charg": [0, 32], "charl": [], "charset": [], "chart": 23, "chase": 4, "chatgpt": [15, 26, 27], "chd": [7, 37], "chddata": [7, 37], "cheap": [5, 33, 34, 35], "cheaper": [1, 13, 35, 40], "check": [1, 3, 4, 5, 11, 13, 15, 16, 19, 21, 22, 25, 32, 35, 37, 38, 40, 41], "checkmark": 3, "checkpoint": 4, "checkpoint_dir": 4, "checkpoint_prefix": 4, "chen": 10, "cheng": 33, "chiaramont": [2, 41], "childcar": 16, "children": 16, "choic": [0, 1, 2, 3, 4, 6, 9, 12, 13, 14, 20, 25, 27, 32, 33, 34, 35, 36, 37, 38, 41], "choleski": [5, 25, 33, 34], "choos": [2, 3, 6, 9, 10, 11, 13, 14, 15, 18, 19, 21, 26, 27, 34, 36, 37, 38, 41], "chosen": [0, 1, 2, 6, 8, 9, 10, 13, 16, 29, 32, 34, 35, 36, 37, 40, 41], "chosen_datapoint": [1, 40], "christian": 31, "christoph": [31, 32], "chunk": 35, "cifar": 3, "cifar10": 3, "circ": [1, 12, 35, 39, 40], "circl": [0, 8, 12, 33, 35, 38, 39], "circuit": 3, "circumfer": 9, "circumv": [1, 5, 13, 33, 34, 35, 40], "citat": [], "cite": [20, 26, 27], "ckpt": 4, "cl": [37, 38], "claim": [], "clarifi": 21, "clariti": 29, "class": [0, 1, 3, 4, 6, 7, 8, 9, 11, 12, 13, 21, 22, 23, 29, 32, 36, 40, 41], "class0": [37, 38], "class1": [37, 38], "class_nam": [3, 9], "class_to_index": [37, 38], "class_val": 9, "class_valu": 9, "classic": [7, 9, 13, 27, 38], "classif": [0, 3, 5, 6, 7, 8, 11, 12, 21, 23, 24, 26, 31, 32, 33, 36], "classifi": [0, 1, 4, 7, 9, 10, 11, 23, 27, 32, 38, 40, 41], "classificaton": [1, 40], "classifii": 10, "claus": [], "clean": [1, 40], "clear": [1, 5, 10, 12, 13, 35, 40, 41], "clearli": [0, 3, 5, 6, 7, 8, 29, 33, 34, 36, 37, 38], "clever": [1, 10, 40], "clf": [0, 6, 8, 9, 10, 32, 33], "clf3": 0, "clf_lasso": 6, "clf_ridg": 6, "cli": 15, "click": [], "climb": 23, "clip": [3, 29, 35, 37, 38], "clock": 35, "clone": [15, 30], "close": [0, 1, 2, 4, 6, 8, 9, 11, 12, 13, 14, 18, 29, 31, 32, 34, 35, 36, 38, 39, 40, 41], "closer": [3, 5, 13, 33, 34, 35], "closest": [8, 11, 13, 14], "closur": [24, 32], "cloud": [24, 32], "cluster": [0, 1, 4, 6, 11, 24, 32, 36, 37, 38, 40], "cluster_label": 14, "cm": [1, 2, 3, 6, 8, 13, 34, 35, 40, 41], "cmap": [0, 1, 2, 3, 4, 6, 8, 9, 10, 32, 40, 41], "cmap_arg": 6, "cmd": [9, 15], "cn_": 29, "cnn": [12, 38, 39], "cnn_kera": 3, "cntk": [24, 32], "co": [0, 2, 3, 6, 9, 13, 32, 36, 37, 41], "code": [0, 3, 4, 6, 7, 8, 18, 19, 21, 22, 23, 24, 25, 29, 31], "codebas": [40, 41], "codec": [], "coef": [0, 32], "coef0": 8, "coef_": [0, 5, 6, 8, 9, 13, 16, 32, 33, 34, 35], "coeff": 5, "coeffici": [0, 3, 5, 6, 7, 8, 9, 13, 18, 25, 32, 33, 35, 36, 37, 38], "coerc": [0, 6, 32, 36, 37], "coin": [10, 29], "coin_toss": 10, "col": [0, 11, 32, 33], "colab": [21, 22, 24, 32], "cold": 9, "colinear": [], "collabor": [20, 26, 27], "collaps": 8, "collect": [2, 6, 10, 11, 17, 24, 29, 31, 32, 36, 37, 39], "collinear": [5, 33, 34], "color": [0, 3, 4, 6, 8, 9, 10, 29, 35], "color_channel": 3, "color_cod": 6, "colorbar": [1, 6, 20], "coloumn": [40, 41], "colsample_bytre": 10, "colsaobject": 10, "column": [0, 1, 2, 5, 6, 7, 8, 9, 11, 12, 16, 17, 18, 19, 25, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "columntransform": 9, "com": [4, 6, 15, 16, 19, 20, 21, 22, 24, 26, 27, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41], "combin": [1, 2, 5, 6, 7, 10, 15, 18, 22, 23, 29, 36, 37, 40, 41], "come": [0, 1, 3, 4, 5, 12, 13, 14, 15, 23, 27, 32, 33, 34, 35, 38, 39, 40, 41], "comfort": [], "command": [0, 1, 15, 40, 41], "comment": [0, 4, 5, 6, 20, 26, 27], "commerci": [0, 24, 26, 32], "commit": 15, "commod": [0, 32], "common": [0, 1, 3, 5, 6, 7, 9, 11, 13, 14, 16, 23, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40], "commonli": [0, 1, 4, 6, 7, 9, 13, 14, 33, 35, 36, 37, 38, 40], "commonmark": [], "commun": [0, 12, 15, 26, 38, 39], "commut": 3, "commutatitav": 3, "compact": [0, 1, 3, 5, 6, 7, 9, 11, 12, 13, 14, 21, 32, 33, 36], "compair": 0, "compar": [0, 3, 4, 5, 6, 11, 13, 18, 23, 25, 26, 27, 32, 33, 34, 35, 36, 37, 39], "comparison": [2, 4, 13, 27, 41], "compat": [7, 37, 38], "compens": 35, "compet": 0, "competit": 10, "compil": [0, 1, 3, 4, 13, 24, 25, 32, 40, 41], "compl": 21, "complet": [0, 2, 3, 4, 9, 12, 15, 16, 17, 18, 19, 20, 21, 22, 32, 38, 41], "completenn": [12, 38], "complex": [1, 5, 8, 9, 11, 12, 13, 16, 19, 27, 32, 34, 35, 36, 37, 40], "complianc": [], "complic": [0, 1, 9, 13, 26, 27, 32, 34, 35, 36, 37, 40], "compoment": 33, "compon": [0, 1, 3, 4, 5, 6, 7, 9, 14, 16, 24, 32, 33, 34, 36, 38, 39, 40, 41], "components_": 11, "compos": [9, 12, 13, 14, 24, 32, 38, 39, 41], "compphys": [0, 6, 16, 20, 24, 26, 27, 28, 30, 31, 32, 33, 34, 37, 38, 40, 41], "compress": [0, 32, 33], "compris": 6, "compromis": [5, 23, 33, 34], "compulsori": [24, 32], "comput": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41], "computation": [0, 3, 6, 9, 13, 29, 32, 34, 35, 39], "computationalscienceuio": 32, "compute_gradi": 22, "computerlab": [26, 27], "con": 27, "concaten": [2, 4, 6, 14, 37, 38, 41], "concav": [1, 13, 33, 34], "concentr": 10, "concept": [0, 2, 23, 24, 32, 33, 41], "conceptu": [12, 13, 34, 38, 39], "concern": [0, 1, 4, 7, 32, 34, 37, 38, 40], "concic": 32, "conclud": [0, 5, 13, 35], "conclus": [1, 40], "cond": [2, 41], "conda": [0, 1, 24, 26, 32, 40, 41], "condis": 33, "condit": [0, 2, 4, 5, 6, 8, 9, 11, 13, 29, 32, 33, 35, 36, 41], "conduct": 24, "condwav": [2, 41], "confid": [0, 5, 6, 7, 8, 19, 23, 32, 33, 37, 38], "config": 41, "configur": [3, 23, 41], "confirm": [5, 12, 21, 38], "conform": [], "confus": [5, 6, 7, 10, 25, 27, 33, 36], "confusion_matrix": 9, "congruenti": 29, "conjug": [4, 8], "conjugaci": 13, "conjunct": 3, "connect": [0, 1, 3, 4, 9, 11, 12, 13, 25, 32, 33, 34, 38, 39, 40, 41], "consensu": 35, "consequ": [5, 6, 8, 10, 12, 13, 33, 34, 35, 36], "consequenti": [], "conserv": [5, 14, 33, 34], "consid": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 12, 13, 16, 19, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "consider": [0, 1, 5, 13, 32, 33, 34, 36], "consist": [1, 2, 3, 4, 6, 12, 13, 26, 27, 29, 33, 34, 36, 37, 38, 39, 40, 41], "consol": [], "const": [], "constant": [0, 2, 4, 5, 6, 8, 12, 13, 16, 18, 29, 32, 33, 34, 35, 38, 39, 40, 41], "constitu": [0, 32], "constitut": [2, 6, 36, 37, 41], "constrain": [1, 3, 5, 7, 11, 34, 37, 40], "constraint": [5, 6, 8, 13, 33, 34, 36], "construct": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 23, 25, 29, 32, 33, 36, 38], "constructor": [], "consult": 27, "consum": 35, "contact": [0, 32], "contain": [0, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 18, 19, 21, 25, 26, 27, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "contemporari": 32, "content": [1, 15, 20, 24, 25, 32, 34, 35], "context": [6, 10, 13, 22, 26, 34, 35, 36, 37, 39], "contigu": 25, "contin": 19, "continu": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 19, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 39, 40, 41], "contour": [9, 10, 13], "contourf": [8, 9, 10], "contract": [], "contrast": [1, 4, 9, 10, 12, 32, 35, 38, 39, 40], "contribut": [0, 3, 5, 13, 18, 29, 32, 33, 34, 35], "contributor": [0, 26], "control": [0, 1, 3, 9, 13, 15, 23, 24, 32, 40], "conv": [3, 4], "conv2d": [3, 4], "conv2dtranspos": 4, "convei": 32, "conveni": [5, 6, 12, 13, 25, 26, 27, 32, 34, 35, 36, 38], "convent": [12, 33], "converg": [1, 2, 4, 5, 8, 13, 14, 18, 33, 34, 39, 40, 41], "convergencewarn": [], "convers": [20, 35], "convert": [0, 1, 4, 5, 9, 11, 13, 25, 32, 33, 34, 37, 38], "converttomatrix": 4, "convex": [4, 5, 7, 33, 37, 38], "convinc": [13, 23, 34], "convolut": [1, 4, 24, 32, 40], "cool": [4, 9], "coolwarm": 6, "coordin": [5, 12, 14, 33, 34, 35, 38], "coorel": [], "copi": [0, 1, 14, 15, 33, 37, 38, 40, 41], "copyright": [], "core": 10, "corel": 32, "coronari": [7, 37], "corr": [5, 7, 11, 33, 38], "correalt": [11, 24], "correct": [0, 1, 2, 3, 4, 5, 7, 13, 15, 19, 20, 21, 22, 23, 25, 29, 32, 33, 34, 36, 37, 38, 40, 41], "correctli": [1, 2, 6, 7, 10, 18, 19, 21, 22, 23, 26, 27, 36, 37, 40, 41], "correl": [0, 1, 3, 5, 6, 7, 10, 12, 13, 24, 29, 32, 34, 35, 36, 39], "correlation_matrix": [5, 7, 11, 33, 38], "correspond": [0, 3, 5, 6, 8, 9, 11, 12, 24, 25, 26, 27, 29, 32, 33, 34, 36, 38, 39], "cortex": [12, 38, 39], "cosin": [3, 6, 36, 37], "cost": [0, 2, 3, 5, 6, 7, 8, 9, 12, 13, 16, 17, 18, 19, 21, 22, 26, 27, 32], "cost_autograd": 22, "cost_deep_grad": [2, 41], "cost_der": 22, "cost_fun": 22, "cost_func": [40, 41], "cost_func_deriv": [40, 41], "cost_funct": [2, 41], "cost_function_deep": [2, 41], "cost_function_deep_grad": [2, 41], "cost_function_grad": [2, 41], "cost_function_train": [40, 41], "cost_function_v": [40, 41], "cost_grad": [2, 22, 41], "cost_histori": [], "cost_ol": [], "cost_one_lay": 22, "cost_ridg": [], "cost_sum": [2, 41], "cost_two_lay": 22, "costcrossentropi": [40, 41], "costli": 35, "costlogreg": [40, 41], "costol": [13, 35, 40, 41], "could": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "coulomb": [0, 32], "count": [0, 9, 15, 23, 26, 27, 28, 29, 30, 32], "counter": [26, 27], "counteract": 35, "counterpart": 32, "countor": 13, "coupl": [4, 5, 6, 21, 36], "cours": [0, 1, 3, 5, 11, 15, 16, 17, 19, 20, 21, 26, 27, 30, 33, 36, 37, 40, 41], "coursework": 15, "courvil": [27, 31, 32, 33, 35], "cov": [5, 6, 11, 25, 29, 32, 33, 36], "cov_xi": [5, 11, 33], "cov_xx": [5, 11, 33], "cov_yi": [5, 11, 33], "covari": [0, 7, 24, 25, 32, 34, 38], "covariance_matrix": [5, 11, 14], "cover": [0, 5, 24, 26, 27, 30, 31, 33, 34, 36], "covert": [0, 32], "covxi": 29, "covxx": 29, "covxz": 29, "covyi": 29, "covyz": 29, "covzz": 29, "cpu": [1, 40, 41], "cqofi41lfdw": [39, 40], "craft": 3, "crash": 35, "creat": [1, 3, 4, 5, 9, 10, 11, 12, 15, 18, 19, 21, 22, 24, 32, 35, 37, 38, 39, 40, 41], "create_biases_and_weight": [1, 40], "create_convolutional_neural_network_kera": 3, "create_lay": [21, 22], "create_layers_batch": 21, "create_neural_network_kera": [1, 40, 41], "create_x": [5, 11, 40, 41], "creation": [], "credit": [0, 7, 30, 32, 37, 38], "crim": [], "crime": [], "criteria": [0, 4, 9, 10, 14, 29, 32], "criterion": [9, 10, 13, 18, 34, 35, 39, 41], "critic": [6, 26, 33], "critiqu": [26, 27], "cross": [0, 1, 3, 7, 9, 10, 13, 15, 21, 22, 23, 24, 27, 29, 32, 33, 34, 35, 40, 41], "cross_entropi": [4, 21], "cross_val_scor": [6, 36, 37], "cross_valid": [7, 10, 23, 38], "crossentropyloss": 41, "crossvalid": [6, 36, 37], "crucial": [1, 29, 35, 40], "cs231": 3, "cs231n": 41, "cs231n_2017_lecture4": 41, "csr_matrix": [25, 32], "css": [], "csv": [0, 4, 6, 7, 9, 36, 37, 38], "ctnk": [1, 40, 41], "cube": 39, "cubic": 0, "cuda": 41, "culprit": [], "cumbersom": [5, 36], "cuml": 23, "cumprod": [], "cumsum": [10, 11, 32], "cumul": [7, 10, 29, 35], "cumulative_heads_ratio": 10, "cuomo": 41, "cup": 5, "current": [1, 2, 3, 4, 13, 14, 15, 16, 31, 34, 35, 37, 38, 40, 41], "curs": [0, 33], "curv": [6, 7, 10, 12, 26, 37, 38, 40], "curvatur": [13, 34, 35], "custom": [6, 14], "custom_cmap": [9, 10], "custom_cmap2": [9, 10], "custom_lin": [], "cut": 23, "cutpoint": 9, "cv": [6, 7, 10, 23, 36, 37, 38], "cvxbook": [13, 34], "cvxopt": [5, 8, 33], "cybenko": 39, "cycl": [1, 12, 38, 39, 40], "cycler": [], "d": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 25, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "d1": [], "d166a3": [], "d2": [], "d2_g_t": [2, 41], "d2a8ff": [], "d4d0ab": [], "d71835": [], "d9dee3": [], "d_f": [13, 34], "d_g_t": [2, 41], "d_net_out": [2, 41], "da": [3, 22, 39], "da_1": 22, "dagger": [5, 25, 33, 34], "dai": [1, 9, 24, 40], "damag": [], "damp": 3, "darget": 9, "darkr": 29, "dat": [0, 32], "dat_id": [0, 6, 7, 9, 32, 36, 37], "data": [2, 4, 5, 8, 10, 12, 13, 14, 16, 19, 20, 22, 23, 25, 26, 27, 31, 34, 35, 36], "data1": 14, "data2": 14, "data3": 14, "data4": 14, "data_id": [0, 6, 7, 9, 32, 36, 37], "data_indic": [1, 40], "data_panda": 32, "data_path": [0, 6, 7, 9, 32, 36, 37], "databas": [1, 40, 41], "datafil": [0, 6, 7, 9, 32, 36, 37], "datafram": [0, 4, 5, 7, 9, 11, 32, 33, 38], "dataload": 41, "datapoint": [1, 5, 6, 7, 11, 13, 16, 34, 35, 36, 37, 40, 41], "datasci": [15, 16, 19], "dataset": [0, 4, 6, 7, 8, 9, 10, 11, 13, 14, 16, 21, 22, 23, 26, 27, 32, 34, 35, 36, 37, 38, 41], "datatyp": 4, "date": [15, 18, 21, 22, 23, 26, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "daughter": 10, "davi": [], "david": 31, "davison": [36, 37], "db": [22, 39], "db_1": 22, "dbb7ff": [], "dbh": [1, 40], "dbo": [1, 40], "dc": 22, "dc5e85cd93c3": 27, "dc_da": 22, "dc_da1": 22, "dc_da2": 22, "dc_db": 22, "dc_db1": 22, "dc_db2": 22, "dc_dw": 22, "dc_dw1": 22, "dc_dw2": 22, "dc_dz": 22, "dc_dz1": 22, "dc_dz2": 22, "dcc6e0": [], "dcomposit": 25, "ddot": [2, 41], "de": 35, "dead": [1, 40, 41], "deadlin": [15, 20, 21, 22, 23], "deal": [0, 1, 3, 5, 6, 8, 11, 13, 14, 19, 25, 29, 32, 33, 34, 35, 39, 40, 41], "dealt": 0, "debt": [7, 37, 38], "debug": [0, 5, 6, 33, 34, 35, 36, 37, 40, 41], "debugg": [], "decad": [0, 3, 35], "decai": [0, 13, 29, 32], "decemb": [30, 32], "decent": 10, "decid": [0, 2, 3, 5, 6, 9, 18, 33, 34, 35, 36, 37, 40, 41], "decim": [0, 32, 40, 41], "decis": [0, 1, 8, 11, 24, 31, 32, 40], "decision_funct": 8, "decision_tre": 9, "decisiontreeclassifi": [9, 10], "decisiontreeregressor": [0, 9, 10], "declar": [0, 4, 20, 23, 25, 32], "declare_namespac": [], "decompos": [5, 6, 25, 33, 34, 39], "decomposit": [0, 6, 12, 32, 38, 39], "decompost": [5, 33, 34], "deconvolut": 3, "decorrel": [10, 13, 35], "decreas": [1, 2, 4, 5, 6, 10, 11, 13, 19, 23, 34, 35, 36, 37, 40, 41], "dedic": 20, "deduc": [0, 32], "deep": [3, 7, 12, 13, 24, 27, 31, 33, 34], "deep_neural_network": [2, 41], "deep_param": [2, 41], "deep_tree_clf": [9, 10], "deep_tree_clf1": 9, "deep_tree_clf2": 9, "deepcopi": [40, 41], "deepen": [5, 24, 32], "deeper": [0, 3, 4, 32], "deepimag": 41, "deeplearningbook": [27, 31, 32, 34, 35], "deer": 3, "def": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 16, 17, 21, 22, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "def_covari": 29, "default": [0, 1, 2, 4, 6, 7, 25, 27, 32, 33, 37, 38, 40, 41], "default_tim": 4, "defect": [5, 33, 34], "defici": [5, 33, 34], "defin": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 25, 26, 29, 33, 34, 35, 36, 37, 38], "definit": [1, 2, 5, 6, 7, 8, 10, 11, 12, 13, 23, 25, 29, 33, 34, 35, 36, 37, 38, 41], "defint": 29, "defualt": [40, 41], "degre": [3, 5, 6, 8, 9, 10, 11, 15, 16, 19, 20, 26, 29, 32, 34, 35, 36, 37], "deisenroth": 33, "del": 1, "delet": [6, 15], "delimit": 4, "deliv": [15, 26, 27, 28, 32], "delta": [0, 2, 3, 6, 8, 12, 13, 14, 32, 35, 39, 40, 41], "delta_": [1, 25, 39, 40], "delta_0": [3, 39], "delta_1": [3, 39, 40], "delta_2": [3, 39, 40], "delta_2a_1": [39, 40], "delta_3": 3, "delta_4": 3, "delta_5": 3, "delta_h": [0, 1, 32, 40], "delta_i": [39, 40], "delta_j": [3, 12, 39, 40, 41], "delta_k": [12, 39, 40, 41], "delta_l": [1, 3, 40], "delta_matrix": [40, 41], "delta_momentum": [13, 35], "delta_n": [0, 3, 32], "delug": 24, "delv": 0, "demand": [13, 34], "demonstr": [0, 3, 5, 6, 7, 11, 12, 19, 24, 32, 33, 34, 35, 36, 37, 38, 40, 41], "demystifi": [38, 39, 40], "den": 4, "denomin": [1, 5, 35, 40], "denot": [1, 2, 6, 7, 13, 29, 34, 35, 37, 38, 40, 41], "dens": [1, 3, 4, 40, 41], "densiti": [0, 2, 6, 29, 36, 37, 41], "depart": [30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "depend": [0, 1, 2, 4, 5, 6, 7, 8, 11, 12, 13, 15, 16, 24, 25, 26, 29, 32, 33, 34, 35, 37, 38, 39, 40, 41], "depict": 29, "deploy": [0, 24, 26, 32], "depth": [0, 3, 9, 10, 25, 36, 40], "der": [], "deriv": [0, 1, 2, 6, 7, 8, 10, 11, 13, 18, 22, 24, 26, 27, 32, 37, 38, 41], "derivati": 13, "derivative_fn": 13, "derivb1": [39, 40], "derivb2": [39, 40], "derivw1": [39, 40], "derivw2": [39, 40], "descend": [5, 9, 11, 33, 34], "descent": [0, 1, 3, 7, 8, 12, 22, 27, 32, 33, 37, 39, 40], "describ": [0, 2, 4, 5, 6, 8, 10, 11, 12, 13, 19, 20, 23, 25, 26, 27, 32, 35, 36, 38, 39, 41], "descript": [0, 8, 9, 20, 26, 27, 32, 40, 41], "design": [0, 1, 3, 4, 5, 6, 7, 10, 11, 12, 13, 17, 18, 26, 27, 32, 34, 35, 36, 37, 38, 39, 40, 41], "designmatrix": [0, 32], "desir": [0, 2, 4, 5, 13, 14, 32, 33, 34, 35, 40, 41], "desktop": 15, "despit": [1, 12, 35, 38, 40], "destroi": 25, "det": [5, 25, 33, 34], "detail": [0, 6, 11, 13, 14, 18, 21, 22, 25, 26, 33, 34, 35, 40], "detect": [3, 8, 12, 38, 39], "determin": [0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 18, 23, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "determinist": [7, 13, 29, 34, 35, 37, 39], "deternin": 39, "dev": [1, 26, 27, 40], "develop": [0, 3, 5, 8, 10, 11, 12, 24, 25, 26, 27, 32, 33, 38, 39, 41], "deviat": [0, 1, 2, 4, 5, 6, 17, 18, 19, 26, 29, 32, 33, 35, 36, 37, 40, 41], "devic": 41, "devis": [12, 38, 39], "df": [4, 8, 11, 13, 23, 32, 39], "df1": 32, "di": [], "diag": [5, 8, 33, 34, 35], "diagnost": [1, 10, 40], "diagon": [0, 5, 7, 13, 18, 19, 23, 25, 29, 32, 33, 34, 35, 37, 38, 40, 41], "diagonaliz": [5, 33, 34], "diagram": 10, "diagsvd": 6, "dice": [6, 29, 36], "dict": [6, 8, 40, 41], "dictionari": [40, 41], "did": [0, 1, 5, 6, 7, 10, 11, 14, 16, 22, 26, 27, 32, 36, 37, 38, 40, 41], "didn": 41, "die": [1, 40, 41], "diff": [2, 39, 41], "diff1": [2, 41], "diff2": [2, 41], "diff_ag": [2, 41], "diffeent": 8, "differ": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 29, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41], "different": [39, 40, 41], "differenti": [0, 3, 16, 21, 22, 24, 25, 27, 32, 33, 34, 38, 40], "difficult": [0, 1, 6, 10, 13, 29, 32, 35, 36, 37, 40], "difficulti": [0, 1, 13, 32, 34, 35, 40], "diffonedim": [2, 41], "digit": [0, 1, 3, 4, 6, 23, 27, 30, 32, 40, 41], "digress": 39, "dilemma": [13, 35], "dilut": [1, 40], "dim": [4, 11, 14, 25, 40, 41], "dimens": [0, 1, 2, 3, 4, 5, 8, 11, 14, 16, 25, 32, 33, 34, 39, 40, 41], "dimension": [0, 4, 5, 6, 9, 11, 13, 14, 19, 24, 25, 26, 27, 32, 33, 34, 35, 36], "dimensionless": [0, 3, 32], "diment": 25, "diminish": 35, "dimnsion": 4, "diod": 3, "direct": [0, 1, 2, 4, 11, 12, 13, 14, 32, 33, 34, 35, 38, 39, 40, 41], "directli": [1, 4, 5, 6, 18, 22, 29, 33, 34, 40, 41], "directori": [], "disabl": 41, "disadvantag": [0, 27, 32, 35], "disappear": [3, 6, 36], "disc_loss": 4, "disc_tap": 4, "discard": [6, 11, 35, 36, 37], "disciplin": [0, 3, 12, 38, 39], "disclaim": 29, "discontinu": 39, "discord": [21, 32], "discourag": [13, 15, 34], "discov": [0, 32], "discover": 5, "discret": [1, 3, 5, 7, 13, 37, 38, 40], "discrimin": [4, 7, 10, 11, 23, 37, 38], "discriminator_loss": 4, "discriminator_loss_list": 4, "discriminator_model": 4, "discriminator_optim": 4, "discuss": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 18, 19, 20, 23, 24, 25, 26, 27, 29, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41], "diseas": [7, 37, 38], "disguis": [6, 33, 35], "disk": 35, "disord": [1, 7, 37, 38], "dispai": [38, 39], "displai": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 26, 29, 32, 33, 35, 36, 37, 38, 39, 40, 41], "displaystyl": [0, 5, 17, 32, 33, 34, 35], "disregard": [0, 32], "dissimilar": [11, 14], "dist": 14, "distanc": [8, 9, 11, 14, 29], "distance_list": 9, "distinct": [3, 7, 8, 9, 10, 14, 37, 38], "distinctli": 8, "distinguish": [0, 4, 7, 8, 29, 32, 38], "distplot": [], "distribut": [0, 1, 4, 6, 7, 10, 11, 13, 14, 18, 19, 21, 24, 25, 26, 27, 32, 33, 34, 35, 37, 40], "distrubut": [0, 24, 26, 32], "div": [], "dive": [0, 8, 25, 32], "diverg": [1, 13, 34, 35, 40], "divid": [0, 1, 3, 5, 6, 7, 8, 9, 11, 12, 18, 19, 23, 27, 29, 32, 33, 35, 36, 37, 38, 39, 40], "divis": [6, 8, 9, 13, 18, 25, 29, 35, 36, 37, 39, 40, 41], "dl": [], "dm": [], "dna": [7, 37, 38], "dnn": [0, 1, 2, 4, 12, 32, 38, 39, 40, 41], "dnn1": 4, "dnn2_gru2": 4, "dnn_kera": [1, 40, 41], "dnn_model": 1, "dnn_numpi": [1, 40], "dnn_scikit": [0, 1, 32, 40], "do": [0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 25, 26, 27, 32, 33, 34, 36, 37, 39, 41], "doc": [0, 15, 16, 19, 24, 26, 27, 28, 30, 31, 32, 40, 41], "document": [4, 13, 15, 41], "docutil": [], "doe": [0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 15, 16, 17, 18, 19, 21, 22, 25, 26, 27, 29, 32, 35, 36, 37, 39, 40, 41], "doesn": [3, 9, 12, 32, 35, 39, 40], "dog": [1, 3, 4, 40], "dollar": [], "domain": [5, 8, 13, 26, 27, 34, 36], "domcontentload": [], "domin": [0, 23, 32], "don": [0, 1, 3, 5, 6, 8, 11, 13, 15, 16, 21, 23, 24, 26, 27, 32, 33, 35, 40, 41], "done": [0, 2, 3, 4, 5, 6, 9, 10, 11, 13, 16, 20, 22, 25, 26, 32, 33, 34, 35, 36, 37, 39, 40, 41], "dot": [0, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 18, 25, 26, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "doubl": [3, 4, 16, 25, 32], "doubli": [1, 40], "doubt": [26, 27], "down": [0, 3, 6, 9, 11, 12, 13, 34, 35, 38, 41], "download": [0, 1, 3, 5, 6, 15, 20, 25, 31, 32, 40, 41], "downsampl": 3, "downscal": 27, "dozen": [1, 40], "dq": [6, 36], "draft": 20, "drag": 13, "dragon": [], "dramat": 11, "drastic": 4, "draw": [4, 6, 10, 13, 34, 36, 37], "drawback": [0, 1, 3, 13, 33, 34, 35, 40], "drawn": [1, 4, 6, 7, 11, 29, 32, 36, 37, 38, 40], "drive": [3, 4, 21, 22], "driven": 3, "drop": [0, 1, 5, 6, 11, 13, 29, 32, 33, 34, 36, 40], "dropna": [0, 6, 32, 36, 37], "dropout": 4, "dt": [2, 3, 13, 29, 39, 41], "dtype": [0, 1, 3, 4, 14, 25, 32, 37, 38, 39, 40, 41], "dual": [], "dub": [0, 32], "duboi": [], "due": [1, 2, 5, 6, 8, 10, 12, 13, 18, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "dugard": [], "dummi": [], "dure": [0, 1, 3, 4, 8, 9, 11, 20, 24, 26, 27, 32, 35, 36, 37, 38, 40, 41], "dw": 22, "dw_1": 22, "dwell": [], "dwh": [1, 40], "dwo": [1, 40], "dx": [2, 3, 8, 29, 39, 41], "dx_1": 29, "dx_1p": [6, 36], "dx_2p": [6, 36], "dx_mp": [6, 36], "dx_n": 29, "dxp": [6, 36], "dy": [1, 8, 29, 40, 41], "dynam": 4, "dz": [8, 22], "dz_1": 22, "dz_2": 22, "e": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "e1e1e1": [], "e_": [0, 2, 32, 41], "e_z": 21, "each": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 22, 23, 24, 25, 27, 28, 29, 30, 32, 33, 34, 35, 36, 38, 39, 40, 41], "eager": 36, "eapprox": [0, 32], "earli": [1, 13, 35, 40], "earlier": [0, 5, 7, 8, 9, 11, 12, 13, 19, 20, 21, 22, 32, 33, 37, 38, 39, 40], "earthexplor": 6, "eas": [6, 9, 14, 36], "easi": [0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 21, 22, 24, 25, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "easier": [5, 6, 8, 9, 13, 15, 20, 21, 22, 26, 27, 29, 32, 33, 34, 36, 37], "easiest": [13, 18, 37, 38], "easili": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 25, 26, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "eastern": [30, 32], "ebind": [0, 32], "eblock": 9, "ec8e2c": [], "econom": [], "econometr": 32, "economi": 5, "ecosystem": [24, 32], "ect": 28, "edg": 3, "edgecolor": [6, 36, 37], "edit": [21, 22], "editor": [15, 20], "edu": [13, 26, 27, 34, 41], "educ": [0, 26, 27, 32, 36], "ee6677": [], "eff": 29, "effect": [1, 4, 10, 13, 16, 17, 18, 29, 35, 40, 41], "effic": [1, 40], "effici": [0, 3, 10, 13, 21, 22, 24, 25, 29, 32, 35, 37, 38, 39], "effort": 19, "efron": [6, 36, 37], "egrad": 13, "eig": [5, 11, 13, 25, 29, 32, 33, 34, 35], "eigen": 29, "eigenpair": [5, 11, 33, 34], "eigenvalu": [0, 5, 8, 11, 13, 25, 32, 33, 34, 35], "eigenvector": [5, 11, 13, 33, 34], "eight": [25, 32], "eigval": [25, 29, 32], "eigvalu": [11, 13, 34, 35], "eigvec": [25, 29, 32], "eigvector": [11, 13, 34, 35], "eir": [30, 32], "eispack": [25, 32], "either": [1, 5, 6, 7, 8, 9, 10, 11, 13, 18, 19, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40], "eivind": 30, "eivinsto": 30, "ekstr\u00f8m": 4, "elabor": 29, "elarn": 3, "electr": [0, 3, 12, 32, 38, 39], "electron": 32, "eleg": 11, "element": [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 19, 20, 21, 24, 25, 26, 27, 31, 33, 35, 36, 37, 38, 39, 40, 41], "elementari": [10, 13, 25, 39], "elementwis": [3, 13], "elementwise_grad": [2, 13, 22, 40, 41], "elessar": 32, "elif": [14, 40, 41], "elim": 25, "elimin": [3, 8], "elin": [30, 32], "ell_": [], "ellipsi": 16, "els": [1, 3, 4, 7, 9, 12, 13, 16, 22, 25, 37, 38, 40, 41], "elu": 1, "elus": [0, 32], "em": 23, "email": [20, 21, 28, 30, 32], "emb": [], "embark": 39, "embed": [0, 11, 33], "embeddings_fig5_349758607": 27, "embodi": [6, 26, 36, 37], "emit": 29, "emner": 31, "emph": 35, "emphas": [0, 10, 24, 32], "emphasi": [0, 24, 31, 32], "empir": [1, 11, 29, 40], "emploi": [0, 1, 5, 6, 11, 13, 27, 29, 32, 33, 34, 36, 40], "employ": 0, "empti": [6, 10, 15, 36, 37, 40, 41], "emul": [12, 38, 39], "en": [24, 26, 31], "enabl": [11, 35, 40, 41], "enbodi": [6, 36], "encod": [0, 3, 5, 9, 11, 14, 32, 33, 34, 37, 38], "encompass": [0, 26, 29], "encount": [0, 1, 5, 7, 13, 15, 21, 26, 29, 32, 33, 34, 35, 37, 38, 40], "encourag": [15, 26, 27], "end": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 20, 22, 23, 25, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "endblock": [], "endfor": [], "endif": [], "endors": [], "endpoint": [3, 6], "energi": [0, 4, 6, 36, 37], "enforc": [12, 38, 39], "eng": 31, "engin": [0, 1, 3, 4, 24, 32, 40], "english": [26, 27], "enjoi": 35, "enocurag": [26, 27], "enorm": 3, "enough": [0, 6, 13, 27, 32, 34, 35, 36], "ensembl": [1, 9, 32, 40], "ensur": [0, 1, 2, 3, 5, 6, 11, 13, 18, 29, 33, 34, 35, 36, 37, 39, 40, 41], "entail": 32, "enter": [5, 6, 33, 34, 35], "enthought": [0, 24, 26, 32], "entir": [1, 3, 7, 9, 21, 24, 29, 32, 35, 37, 40, 41], "entireti": [], "entiti": [9, 12, 25, 32], "entri": [0, 5, 8, 11, 12, 23, 25, 32, 33, 35, 36], "entropi": [1, 3, 7, 10, 13, 21, 22, 27, 32, 34, 35, 40, 41], "enumer": [0, 1, 2, 3, 4, 6, 8, 21, 32, 33, 35, 37, 38, 40, 41], "env": 29, "environ": [2, 21, 22, 24, 26, 32, 41], "environemnt": 15, "eo": [0, 6, 36, 37], "eol": 0, "eosfit": 0, "epoch": [0, 1, 3, 4, 12, 13, 21, 32, 35, 37, 38, 40, 41], "eppstein": [], "epsilon": [0, 5, 6, 7, 13, 26, 32, 33, 34, 35, 36, 37, 38, 39], "epsilon_": [0, 32], "epsilon_0": [0, 32], "epsilon_1": [0, 32], "epsilon_2": [0, 32], "epsilon_i": [0, 32, 33], "eq": [3, 13, 14, 25, 29, 34], "eqnarrai": [3, 5, 6, 36], "equal": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 13, 14, 16, 18, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 39, 40, 41], "equat": [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 17, 19, 25, 29, 32, 35, 36], "equilibrium": [2, 12, 38, 39, 41], "equiv": [3, 13, 25, 29, 34, 35], "equival": [0, 1, 5, 7, 8, 11, 13, 23, 24, 25, 27, 32, 33, 34, 35, 36, 40], "equivel": [19, 21, 22], "eqynreyrxni": 40, "eras": [], "erf": 29, "eriador": 32, "eric": [40, 41], "err": [0, 10], "err_": [6, 36, 37], "err_sqr": [2, 41], "errat": [13, 34, 35], "erron": [2, 41], "error": [1, 2, 4, 5, 6, 7, 9, 11, 12, 13, 15, 16, 17, 18, 19, 21, 23, 24, 25, 26, 27, 29, 35, 38, 39, 40, 41], "error_estimate_corr_tim": 29, "error_hidden": [1, 40], "error_output": [1, 40], "escap": [13, 34, 35], "escapehtml": [], "especi": [1, 3, 9, 12, 13, 15, 18, 26, 27, 35, 38, 39, 40, 41], "essenti": [0, 5, 6, 9, 10, 12, 14, 15, 26, 27, 29, 33, 34, 35, 38, 39, 40], "establish": [0, 6, 10, 11, 16, 26, 27], "estim": [0, 1, 5, 6, 7, 10, 11, 13, 24, 29, 32, 33, 34, 35, 37, 38, 40], "estimated_mse_fold": [6, 36, 37], "estimated_mse_kfold": [6, 36, 37], "estimated_mse_sklearn": [6, 36, 37], "et": [0, 2, 4, 16, 17, 20, 27, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41], "eta": [0, 1, 3, 8, 12, 13, 18, 27, 32, 34, 35, 39, 40, 41], "eta0": [8, 13], "eta_": 13, "eta_j": 35, "eta_t": [13, 35], "eta_v": [0, 1, 3, 32, 40, 41], "etc": [0, 1, 3, 5, 7, 8, 9, 11, 12, 13, 14, 24, 25, 26, 27, 29, 33, 34, 35, 37, 38, 40, 41], "ethic": 24, "etsim": 36, "euclidean": [0, 14, 33, 35], "euler": [], "eval": 41, "evalu": [0, 2, 3, 4, 5, 6, 9, 13, 15, 16, 17, 19, 21, 23, 26, 29, 32, 33, 34, 35, 36, 37, 38, 41], "evalut": [13, 26], "even": [0, 1, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 22, 24, 25, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40], "evenli": 4, "event": [5, 7, 10, 29, 36, 37], "eventu": [0, 5, 6, 11, 12, 13, 26, 27, 30, 33, 34, 35, 36, 37, 38, 39], "everi": [0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 21, 24, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "everyth": [4, 12, 16, 18, 21, 39, 40], "everywher": [4, 13, 34], "evolv": 0, "exact": [0, 5, 11, 12, 13, 25, 29, 32, 33, 35, 39, 40], "exactli": [0, 3, 4, 6, 12, 18, 24, 33, 35, 36, 38, 39, 40], "exam": 32, "examin": [6, 36, 37], "exampl": [0, 5, 11, 12, 13, 15, 16, 18, 20, 23, 24, 25, 26, 27, 29, 31], "exce": [1, 12, 13, 35, 38, 39, 40], "exceed": 35, "excel": [0, 1, 4, 5, 10, 20, 26, 27, 32, 33, 40], "except": [3, 4, 6, 8, 9, 25, 40, 41], "excess": [0, 32], "exchang": 35, "excit": 0, "exclud": [1, 6, 12, 26, 27, 33, 35, 36, 37, 38, 40], "exclus": [0, 1, 3, 6, 29, 32, 36, 37, 40, 41], "execut": [2, 5, 13, 15, 33, 34, 35, 41], "exemplari": [], "exemplifi": [13, 35], "exercic": [30, 32], "exercis": [5, 24, 26, 27, 28, 30, 32, 34, 35, 36, 37, 38, 40], "exercisesweek41": 27, "exercisesweek42": [27, 40], "exhaust": [6, 35, 36, 37], "exhibit": [0, 5, 6, 8, 32, 33, 36], "exist": [0, 1, 2, 3, 5, 6, 7, 8, 9, 13, 19, 25, 26, 27, 32, 34, 35, 36, 37, 40, 41], "exit": [5, 25, 33, 34], "exp": [0, 1, 2, 5, 6, 7, 8, 10, 11, 12, 13, 16, 17, 19, 21, 22, 29, 33, 34, 35, 36, 37, 38, 39, 40, 41], "exp_term": [1, 40], "exp_z": [37, 38], "expand": [5, 7, 11, 13, 34, 37, 38], "expans": [0, 3, 5, 8, 10, 12, 13, 32, 33, 34, 39], "expect": [0, 1, 5, 6, 7, 11, 12, 13, 15, 18, 23, 24, 26, 27, 32, 33, 35, 37, 39, 40], "expectation_value_of_h_wrt_p": 29, "expens": [6, 10, 13, 16, 34, 35], "experi": [0, 1, 6, 8, 13, 15, 24, 26, 32, 33, 34, 35, 36, 37, 40, 41], "experiment": [0, 4, 6, 9, 29, 32, 36, 37], "expert": [1, 9, 40], "explain": [0, 6, 9, 10, 11, 13, 16, 19, 26, 27, 32, 34, 37, 38], "explained_variance_ratio_": 11, "explan": [], "explanatori": [0, 32], "explicit": [0, 3, 6, 13, 25, 26, 32, 33, 34, 35], "explicitli": [0, 4, 21], "explod": [1, 39], "exploit": [0, 3, 12, 13, 32, 35, 38, 39], "explor": [1, 4, 6, 8, 13, 18, 24, 26, 27, 32, 34, 35, 40], "expon": [1, 40, 41], "exponenti": [0, 1, 5, 6, 10, 13, 29, 32, 34, 39, 40], "export": [9, 15, 16, 19, 20, 37, 38], "export_graphviz": 9, "export_text": 9, "exporttext": 9, "expos": 24, "expr": 39, "express": [0, 2, 3, 5, 6, 7, 10, 12, 13, 18, 22, 25, 26, 27, 29, 32, 34, 35, 36, 41], "exptmean": 29, "exptvari": 29, "extend": [0, 2, 7, 11, 13, 24, 32, 35, 41], "extend_path": [], "extens": [0, 12, 15, 24, 27, 32, 38, 39], "extent": [0, 1, 6, 31, 36, 37, 40, 41], "extern": [3, 6, 9], "extra": [1, 3, 5, 15, 30, 32, 33, 34, 40], "extract": [0, 3, 5, 6, 7, 8, 11, 13, 16, 17, 25, 27, 32, 33, 37, 38, 39], "extrapol": [0, 32], "extrem": [0, 1, 4, 5, 6, 7, 8, 9, 13, 15, 16, 25, 33, 34, 35, 37, 40], "extremum": [13, 34], "extrins": 11, "ey": [0, 5, 6, 13, 14, 18, 25, 32, 33, 34, 35], "f": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 25, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "f1": 13, "f11": [0, 32], "f12": [0, 32], "f13": [0, 32], "f1_grad": 13, "f1d": 13, "f2": 13, "f26196": [], "f2_grad_x1": 13, "f2_grad_x1_analyt": 13, "f2_grad_x2": 13, "f2_grad_x2_analyt": 13, "f2f2f2": [], "f3": 13, "f3_grad": 13, "f3_grad_analyt": 13, "f4": 13, "f4_grad": 13, "f4_grad_analyt": 13, "f5": 13, "f5_grad": 13, "f5a394": [], "f5ab35": [], "f5f5f5": [], "f6": 13, "f6_for": 13, "f6_for_grad": 13, "f6_grad_analyt": 13, "f6_while": 13, "f6_while_grad": 13, "f7": 13, "f78c6c": [], "f7_grad": 13, "f7_grad_analyt": 13, "f8": 13, "f8_grad": 13, "f8f8f2": [], "f9": [0, 13, 32], "f9_altern": 13, "f9_alternative_grad": 13, "f9_grad": 13, "f_": [10, 23], "f_0": [3, 10], "f_1": [10, 13, 34], "f_2": [12, 13, 34, 38], "f_3": [12, 38], "f_d": 29, "f_grad": 13, "f_grad_analyt": 13, "f_i": [0, 6, 12, 16, 36, 37, 38], "f_m": [3, 10], "f_n": 3, "f_vec": [2, 41], "face": [13, 32, 34], "facecolor": [6, 8, 29, 36], "facil": [0, 24], "facilit": [12, 38, 39], "fact": [0, 1, 3, 5, 9, 11, 12, 13, 22, 32, 33, 34, 35, 40], "facto": 35, "factor": [0, 1, 3, 5, 6, 9, 10, 11, 13, 25, 29, 32, 33, 34, 40], "factori": 13, "fad000": [], "fade": 6, "fae4c2": [], "fafab0": [9, 10], "fail": [0, 6, 13, 30, 32, 34, 36, 37, 39], "failur": [7, 37, 38], "fairli": [1, 2, 18, 29, 35, 40, 41], "faisal": [16, 33], "fake": 4, "fake_loss": 4, "fake_output": 4, "fall": [8, 9, 23, 28], "fals": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 14, 16, 17, 23, 25, 27, 32, 33, 34, 35, 36, 37, 38, 40, 41], "famili": [0, 7, 8, 29, 33, 35, 37, 38, 39], "familiar": [0, 3, 5, 6, 8, 15, 24, 25, 26, 29, 32, 36, 39], "famou": [6, 12, 40, 41], "far": [0, 3, 4, 5, 6, 8, 11, 12, 13, 14, 16, 20, 21, 22, 32, 33, 34, 35, 38, 39], "fashion": [0, 9, 10, 27, 32, 35], "fashionmnist": 27, "fast": [1, 3, 6, 10, 12, 13, 24, 29, 32, 34, 35, 36, 37, 39, 40], "faster": [1, 11, 13, 21, 35, 40, 41], "fastest": [13, 25, 34], "fatal": [], "favor": [7, 35, 37], "favorit": 29, "fc": 3, "fc1": 41, "fc2": 41, "fc3": 41, "fcfcfc": [], "fdac54": [], "fdf2e2": [], "featur": [0, 1, 3, 5, 6, 7, 8, 10, 11, 12, 13, 15, 17, 18, 19, 21, 23, 24, 27, 29, 32, 34, 35, 36, 37, 38, 39, 40, 41], "feature_nam": [1, 7, 9, 21, 38], "feautur": 9, "fed": [1, 39, 40], "feed": [0, 2, 3, 11, 21, 24, 27, 32], "feed_forward": [1, 21, 22, 40], "feed_forward_all_relu": 21, "feed_forward_batch": 21, "feed_forward_one_lay": 22, "feed_forward_out": [1, 40], "feed_forward_sav": 22, "feed_forward_train": [1, 40], "feed_forward_two_lay": 22, "feedback": [4, 20, 32], "feeddorward": 4, "feedforward": [1, 4, 12, 40, 41], "feel": [0, 5, 6, 11, 13, 15, 16, 18, 21, 22, 23, 24, 26, 27, 30, 32, 39], "feet": [], "fefef": [], "fefeff": [], "felt": [26, 27], "fenc": [], "fernando": [], "fetch": [6, 15, 27], "fetch_openml": 27, "few": [1, 3, 4, 5, 9, 17, 18, 19, 22, 23, 29, 32, 39, 40], "fewer": [0, 9, 11, 19, 32, 35], "ff7b72": [], "ff9492": [], "ffa07a": [], "ffa657": [], "ffb757": [], "ffd700": [], "ffd900": [], "ffd9002e": [], "ffffff": [], "ffnn": [1, 12, 27, 38, 39, 40, 41], "fi": [], "field": [0, 3, 6, 12, 19, 24, 38, 39], "fieldmask": [], "fifteen": 39, "fifth": [0, 6, 32], "fig": [0, 1, 2, 3, 4, 6, 7, 12, 13, 14, 26, 32, 37, 38, 40, 41], "fig_id": [0, 6, 7, 9, 32, 36, 37], "figaxi": 29, "figsiz": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 32, 36, 37, 38, 40, 41], "figur": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, 24, 26, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "figure_id": [0, 6, 7, 9, 32, 36, 37], "figurefil": [0, 6, 7, 9, 32, 36, 37], "file": [0, 4, 5, 6, 7, 9, 15, 20, 21, 22, 26, 27, 32, 36, 37], "file_prefix": 4, "filenam": 32, "fill": [5, 9, 18, 23, 33, 34, 40, 41], "fill_valu": [], "filter": [3, 4], "final": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 18, 20, 21, 22, 23, 26, 27, 28, 29, 30, 32, 34, 36, 37, 38], "financ": 0, "find": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 21, 22, 24, 26, 27, 29, 32, 33, 34, 35, 37, 38, 39, 40, 41], "fine": [0, 14], "finish": [2, 20, 21, 40, 41], "finit": [3, 5, 6, 12, 13, 17, 29, 33, 34, 36, 37, 38, 39], "finnicki": 15, "fire": [], "first": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 18, 19, 21, 22, 23, 25, 26, 27, 29, 30, 31, 33, 35, 36, 37, 38], "first_moment": 35, "first_term": 35, "firsteigvector": 11, "fit": [1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 17, 18, 19, 22, 23, 26, 27, 29, 33, 35, 36, 37, 38, 39, 40, 41], "fit_beta": 33, "fit_intercept": [0, 5, 6, 16, 33, 34, 35, 36, 37, 38], "fit_mod": 9, "fit_theta": [6, 35], "fit_transform": [0, 6, 8, 9, 11, 15, 19, 36, 37], "fiti": [0, 32], "five": [0, 9, 32, 33, 39], "fix": [0, 3, 4, 6, 10, 11, 12, 13, 26, 32, 36, 37, 38, 40, 41], "flag": 4, "flat": [12, 13, 34, 35], "flatten": [1, 3, 4, 5, 25, 40, 41], "flavor": [], "flexibl": [1, 6, 8, 10, 12, 27, 32, 35, 36, 37, 38, 40, 41], "flip": [21, 30, 32], "float": [0, 3, 4, 5, 9, 11, 13, 14, 25, 32, 33, 34, 40, 41], "float32": [4, 9, 40, 41], "float64": [4, 25, 32, 38, 39, 40, 41], "floatingpointerror": [40, 41], "floor": [40, 41], "flop": [5, 25, 33, 34], "flow": [1, 4, 12, 38, 39, 40], "flower": 21, "fluctuat": [5, 35], "flush": [40, 41], "fly": 11, "fm": 0, "fmax": 3, "fmesh": 13, "fn": [7, 23], "focu": [0, 3, 4, 5, 6, 15, 24, 26, 27, 31, 32, 33, 34, 35, 36, 37], "focus": [1, 6, 7, 23, 25, 33, 35, 37, 38, 40], "fold": [6, 9, 26], "folder": [0, 4, 6, 15, 20, 26, 27, 32], "follow": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "font": [7, 20, 29, 32, 37], "fontdict": 29, "fontsiz": [1, 6, 8, 9, 10, 29], "fontweight": 1, "footprint": [3, 35], "foral": [8, 33, 39], "forc": [0, 5, 6, 10, 11, 33, 34, 35, 39], "forcast": 4, "forcier": [], "forecast": [4, 12, 38, 39], "forest": [0, 1, 9, 24, 32, 40], "forget": [11, 35], "form": [0, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "formal": [3, 4, 14, 18, 23, 29, 39], "format": [0, 1, 3, 4, 6, 7, 8, 9, 10, 11, 20, 23, 24, 29, 31, 36, 37, 38, 40, 41], "format_data": 4, "formatstrformatt": [6, 13, 34, 35], "formatt": [], "formul": [4, 6, 11, 14, 23], "formula": [3, 13, 23, 29, 34, 39], "forth": [4, 12, 22, 38], "fortran": [0, 24, 25, 32], "fortran2003": [24, 32], "fortran2008": [26, 27], "fortran90": 29, "fortun": [0, 11, 33], "forward": [0, 3, 6, 21, 24, 25, 27, 32, 35, 36], "forwardpropag": [39, 40], "found": [1, 2, 4, 5, 6, 12, 13, 19, 20, 21, 22, 26, 32, 33, 35, 36, 37, 38, 39, 40, 41], "foundat": [24, 32], "four": [4, 5, 6, 8, 12, 21, 25, 28, 30, 32, 34, 38, 39, 40], "fourier": [0, 32, 39], "fourierdef1": 3, "fourierdef2": 3, "fourierseriessign": 3, "fourth": [12, 32, 33], "fp": [7, 23], "fpr": 23, "frac": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 22, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "fraction": [9, 23, 37, 38], "frame": [7, 35, 38], "framework": [1, 8, 10, 29, 40, 41], "frank": [5, 11], "frankefunct": [5, 6, 11], "fredli": [21, 30, 32], "free": [0, 6, 11, 13, 15, 16, 18, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 39], "freecodecamp": 24, "freedom": [5, 34], "freeli": [0, 26], "freez": 15, "frequenc": [3, 6, 7, 29, 36, 38], "frequent": [0, 8, 9, 13, 34], "frequentist": 24, "fresh": 10, "frf4l5qax1m": 41, "fridai": [15, 21, 22, 23, 30, 32], "friedman": [6, 19, 26, 31, 32], "friendli": 4, "fro": 26, "frodo": 32, "frog": 3, "from": [0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 41], "from_cod": 9, "from_logit": [3, 4], "from_tensor_slic": 4, "front": [0, 4, 5, 32, 33, 34], "frustrat": 15, "fulfil": [2, 5, 12, 33, 34, 38, 40, 41], "full": [1, 3, 5, 7, 9, 10, 13, 21, 27, 29, 32, 33, 34, 37], "full_matric": [5, 33, 34], "fulli": [3, 6, 12, 29, 36, 37, 38, 39], "fullnam": [], "fun": [24, 32], "func": [2, 21, 40, 41], "function": [2, 3, 4, 5, 9, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25], "functionali": 11, "fundament": [0, 6, 24, 32, 36, 37], "funtion": [2, 41], "furnish": [], "furthemor": 39, "further": [2, 7, 9, 19, 32, 39, 41], "furthermor": [0, 3, 5, 6, 7, 11, 12, 13, 24, 26, 27, 32, 33, 34, 35, 36, 37, 38, 40], "furthest": 22, "futur": [0, 4, 8, 9, 32], "fy": [15, 21, 26, 27, 28, 30, 31, 32], "fys4155": [26, 27], "fys5419": [31, 32], "fys5429": [31, 32], "f\u00f8470": [30, 32], "g": [0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 13, 15, 18, 19, 23, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41], "g0": [2, 41], "g_": [2, 9, 10, 35, 41], "g_0": [2, 41], "g_1": [2, 10, 41], "g_2": [2, 10, 41], "g_3": 39, "g_analyt": [2, 41], "g_dnn_ag": [2, 41], "g_euler": [2, 41], "g_i": [2, 39, 41], "g_j": 39, "g_m": [3, 10], "g_n": 3, "g_re": [2, 41], "g_t": [2, 35, 40, 41], "g_t_d2t": [2, 41], "g_t_d2x": [2, 41], "g_t_dt": [2, 41], "g_t_hessian": [2, 41], "g_t_hessian_func": [2, 41], "g_t_invers": [40, 41], "g_t_jacobian": [2, 41], "g_t_jacobian_func": [2, 41], "g_trial": [2, 41], "g_trial_deep": [2, 41], "g_vec": [2, 41], "gain": [1, 5, 7, 9, 10, 13, 33, 34, 40, 41], "galleri": [0, 32], "game": 4, "gamge": 32, "gamma": [0, 2, 8, 9, 10, 11, 13, 32, 34, 41], "gamma1": 8, "gamma2": 8, "gamma_": [0, 32], "gamma_0": 10, "gamma_1": 10, "gamma_1x": 10, "gamma_i": [0, 8, 29, 32], "gamma_j": 13, "gamma_k": [13, 34], "gamma_m": 10, "gamma_x": [0, 32], "gap": [8, 35], "gate": [4, 12, 39], "gather": [0, 1, 12, 33, 38, 39, 40, 41], "gaug": [12, 38, 39], "gaussbacksub": 25, "gaussian": [4, 5, 6, 8, 14, 18, 29, 32, 36, 37, 38], "gaussian_point": 14, "gaussian_rbf": 8, "gave": [13, 27, 35], "gavra": 32, "gbc": 32, "gca": [2, 6, 8, 13], "gd": [1, 34, 39, 40], "gd_clf": 10, "gdclassiffiercgain": 10, "gdclassiffierconfus": 10, "gdclassiffierroc": 10, "gdm": 13, "gdregress": 10, "ge": [1, 5, 7, 29, 33, 34, 37, 40, 41], "gen_loss": 4, "gen_tap": 4, "gender": [0, 32], "genener": 4, "gener": [0, 1, 2, 3, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 22, 23, 25, 26, 27, 29, 31, 33, 34, 35, 36, 40, 41], "generaliz": [16, 40, 41], "generallay": [12, 38], "generate_and_save_imag": 4, "generate_binary_data": [37, 38], "generate_imag": 4, "generate_latent_point": 4, "generate_multiclass_data": [37, 38], "generate_simple_clustering_dataset": 14, "generated_imag": 4, "generator_loss": 4, "generator_loss_list": 4, "generator_model": 4, "generator_optim": 4, "genom": 24, "geodes": 11, "geoff": 35, "geometr": [0, 13, 32, 35], "geometri": 5, "georg": 31, "geotif": 6, "geq": [2, 5, 8, 9, 13, 33, 34, 35, 41], "gerard": [], "geron": [0, 31, 32], "get": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 15, 19, 21, 22, 24, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 40, 41], "get_dummi": 9, "get_paramet": [2, 41], "get_split": 9, "get_yaxi": 8, "get_yticklabel": 6, "getmask": [], "gh": 15, "giant": 35, "gibb": [24, 32], "gif": 4, "gini": 10, "gini_index": 9, "ginvers": 13, "git": [0, 15, 24, 32], "gitcdn": [], "giter": [13, 35], "github": [0, 20, 24, 26, 27, 28, 30, 31, 32, 33, 39, 40, 41], "gitignor": 15, "gitlab": [0, 15, 24, 26, 27, 32], "gitta": [39, 40], "give": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 12, 13, 14, 18, 19, 23, 24, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "given": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 19, 21, 25, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "glkfgrjhtlnplbx4": 21, "global": [6, 7, 13, 34, 35, 37, 38], "gloriou": 27, "glorot": 1, "gmail": [], "gnew": 13, "go": [0, 1, 3, 5, 6, 8, 9, 11, 12, 13, 15, 16, 18, 21, 32, 33, 34, 36, 39, 40], "goal": [0, 7, 9, 32, 37, 38], "goe": [0, 1, 2, 5, 6, 13, 14, 15, 19, 25, 32, 33, 34, 35, 36, 40, 41], "goessner": [], "golden": 13, "gone": [5, 33, 34], "gong": [1, 40], "good": [1, 3, 4, 5, 6, 9, 10, 11, 13, 15, 18, 21, 24, 27, 29, 31, 33, 34, 35, 37, 39, 40, 41], "goodfellow": [4, 27, 31, 32, 33, 34, 37, 38, 39, 40], "googl": [1, 4, 21, 22, 24, 32, 40, 41], "got": [1, 6, 21, 22, 26, 27, 40], "gotten": [32, 40, 41], "gov": 6, "govern": 32, "gp": 31, "gpu": [1, 13, 24, 32, 35, 40, 41], "grad": [2, 13, 21, 22, 35, 40, 41], "grad_analyt": 13, "grad_ol": 18, "grad_ridg": 18, "grad_two_lay": 22, "grade": [26, 27, 28], "gradient": [0, 3, 4, 7, 8, 9, 12, 21, 24, 32, 33, 37], "gradient_bia": [40, 41], "gradient_desc": 35, "gradient_func": 21, "gradient_weight": [40, 41], "gradientboostingclassifi": 10, "gradientboostingregressor": 10, "gradients_of_discrimin": 4, "gradients_of_gener": 4, "gradienttap": 4, "gradual": [1, 14, 40], "grai": [4, 6], "granger": [], "grant": [], "graph": [1, 9, 11, 12, 13, 16, 20, 23, 34, 35, 38, 39, 40, 41], "graph_from_dot_data": 9, "graphic": [0, 1, 9, 15, 32, 40, 41], "grasp": 0, "gray_r": [1, 3, 40, 41], "grayscal": 3, "great": [5, 13, 15, 21, 22, 34, 35, 39, 41], "greater": [1, 7, 29, 33, 38, 40], "greatli": 13, "greedi": 9, "green": [0, 3, 9, 29], "gregor": [40, 41], "grei": 4, "grid": [1, 3, 6, 7, 8, 12, 29, 33, 35, 36, 37, 38, 40, 41], "groh": [39, 40], "grossli": [13, 34], "ground": [0, 32], "group": [0, 6, 7, 9, 14, 15, 20, 24, 26, 27, 28, 30, 32, 36], "groupbi": [0, 32], "grow": [1, 3, 9, 10, 35, 40], "growth": [0, 32], "gru": 4, "guarante": [0, 4, 13, 29, 32, 33, 34, 35], "guess": [1, 4, 10, 13, 14, 23, 27, 34, 35, 40], "guestrin": 10, "gui": 15, "guid": [1, 21, 40, 41], "guidelin": [20, 26, 27, 37, 38], "g\u00f6ssner": [], "h": [0, 1, 5, 6, 8, 13, 15, 19, 21, 29, 30, 31, 32, 33, 34, 35, 40], "h1": [2, 41], "h_": [0, 13, 32, 34, 35], "h_0": 35, "h_1": [2, 13, 34, 41], "h_2": [2, 13, 34, 41], "h_m": 10, "h_t": 35, "ha": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "haanen": [30, 32], "habit": [0, 33], "had": [0, 1, 6, 7, 13, 32, 34, 35, 36, 37, 40], "hadamard": [1, 12, 13, 35, 39, 40], "half": [1, 8, 9, 37, 38, 39, 40, 41], "halv": 10, "hand": [0, 1, 2, 3, 5, 11, 12, 13, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 37, 38, 41], "handi": [3, 26, 27], "handl": [0, 1, 2, 5, 9, 11, 15, 18, 22, 24, 33, 34, 35, 40, 41], "handle_unknown": 9, "handsid": [12, 39, 40], "handwrit": [12, 38, 39], "handwritten": [1, 5, 40], "happen": [1, 2, 3, 4, 5, 6, 10, 13, 29, 33, 34, 35, 38, 40, 41], "hard": [1, 7, 8, 10, 13, 21, 22, 34, 35, 37, 39, 40], "hardcopi": [24, 32], "harder": [0, 1, 19, 21, 33, 40], "harmon": [3, 23], "hash": 35, "hasn": [], "hassl": [0, 24, 32], "hast": [24, 32], "hasti": [0, 6, 16, 17, 19, 20, 26, 31, 32, 33, 36, 37], "hat": [0, 1, 5, 6, 7, 9, 10, 11, 12, 13, 16, 17, 18, 19, 25, 33, 34, 35, 36, 38, 39], "hauser": [], "have": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "have_sys_un_h": [], "haven": [1, 22, 40], "he": [7, 37, 38], "head": [4, 10, 29], "header": [0, 32], "heads_proba": 10, "health": [0, 33], "hear": [0, 13, 32, 35], "heart": [0, 7, 32, 37], "heatmap": [0, 1, 3, 7, 17, 20, 27, 32, 38, 40, 41], "heavi": 35, "heavili": 0, "heavisid": [1, 40], "height": [1, 3, 6, 33, 40], "hein": 41, "held": [13, 35], "help": [0, 1, 4, 12, 13, 15, 16, 26, 27, 32, 35, 36, 38, 39, 40], "helper": [4, 14, 37, 38], "henc": [0, 5, 6, 8, 9, 10, 12, 13, 32, 33, 34, 35, 36, 37, 38], "henrik": [30, 32], "her": [7, 37, 38], "here": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "hereaft": [0, 8, 12, 32], "herebi": [], "hermitian": 25, "hessenberg": 25, "hessian": [0, 2, 5, 13, 37, 38, 41], "heterogen": [9, 10], "hex": [], "hi": [7, 37, 38], "hidden": [1, 3, 4, 12, 21, 23, 27, 38], "hidden_bia": [1, 40], "hidden_bias_gradi": [1, 39, 40], "hidden_deriv": [40, 41], "hidden_func": [40, 41], "hidden_layer_s": [0, 1, 32, 40], "hidden_neuron": 4, "hidden_nodes1": [40, 41], "hidden_nodes2": [40, 41], "hidden_weight": [1, 40], "hidden_weights_gradi": [1, 39, 40], "hierarch": [5, 33, 34], "high": [0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 13, 14, 21, 23, 24, 25, 26, 32, 33, 34, 35, 36, 37, 40, 41], "higher": [0, 1, 3, 5, 6, 8, 13, 18, 23, 26, 32, 33, 34, 35, 36, 37, 40, 41], "highest": [1, 2, 37, 38, 40, 41], "highli": [0, 3, 4, 10, 19, 24, 25, 27, 31, 32, 33, 34, 35], "highlight": 23, "highwai": [], "hing": 8, "hint": [13, 15, 16, 21, 22, 27, 33, 34], "hinton": 35, "hip": [24, 41], "hire": 0, "hist": [4, 6, 7, 29, 36, 38], "histogram": [6, 7, 29, 38], "histor": [7, 11, 37], "histori": [3, 4, 12, 15, 35, 38, 39, 41], "hitherto": 5, "hjorth": [30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "hline": 23, "hobbi": 29, "hoc": [5, 33, 34], "hoff": 31, "hojjatk": 27, "hold": [1, 3, 6, 13, 14, 34, 35, 36, 40], "holder": [0, 32], "holdgraf_evidence_2014": [], "home": [], "homepag": [26, 27, 32], "homework": [6, 13, 34, 35], "homogen": [1, 3, 9, 10, 13, 35], "honchar": [2, 41], "hopefulli": [0, 11, 15, 19, 29, 32, 35], "horizont": 11, "horlyk": [30, 32], "hornik": 39, "hors": [3, 7, 32, 37, 38], "hot": [1, 9, 37, 38, 40, 41], "hour": [1, 24, 28, 29, 30, 32, 35, 36, 40], "how": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "howev": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 21, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "href": [], "hspace": [0, 4, 8, 10, 29, 32, 39, 40], "hstack": [1, 40, 41], "htf": 32, "html": [0, 16, 20, 21, 24, 26, 27, 28, 30, 31, 32, 33, 34, 35, 39, 40, 41], "http": [0, 3, 4, 6, 13, 15, 16, 19, 20, 21, 22, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "huang": [0, 32], "huber": [0, 32], "huge": [1, 3, 4, 24, 35, 40], "human": [0, 1, 3, 6, 9, 12, 33, 38, 39, 40], "humid": 9, "hundr": [1, 40], "hungri": [1, 40], "hybrid": 28, "hydrogen": [0, 32], "hyper": 27, "hyperbol": [1, 4, 12, 41], "hyperparam": 8, "hyperparamat": 39, "hyperparamet": [3, 4, 5, 6, 9, 13, 18, 26, 27, 33, 34, 35, 39, 41], "hyperplan": 11, "h\u00f8rlyk": [30, 32], "i": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39], "i0": [0, 32], "i1": [0, 6, 8, 12, 32, 33, 35, 38], "i2": [0, 8, 12, 32, 38], "i3": [0, 12, 32, 38], "i5": [0, 32], "i_": [13, 34, 35], "i_1": [5, 6, 36], "i_2": [5, 6, 36], "i_siz": [21, 22], "i_t": 35, "ian": 31, "iayaan2": 21, "ic": [1, 26, 27, 40], "id": [7, 13, 34, 35, 37], "ida": [30, 32], "idea": [0, 1, 2, 3, 4, 6, 9, 10, 12, 13, 20, 25, 26, 27, 33, 34, 35, 36, 37, 38, 39, 40, 41], "ideal": [0, 2, 6, 8, 13, 23, 29, 32, 35, 36, 37, 38, 40, 41], "idem": [6, 36, 37], "ident": [5, 6, 12, 13, 17, 18, 25, 33, 34, 38, 40, 41], "identical": 36, "identifi": [0, 1, 7, 9, 11, 12, 13, 14, 23, 32, 33, 37, 38, 40], "idx": [37, 38], "ieor": 29, "ifi": [31, 41], "ifs": [24, 32], "ignor": [0, 1, 3, 9, 15, 33, 35, 40, 41], "ii": [23, 25, 29, 40], "iii": [25, 32, 40], "ij": [0, 1, 3, 6, 8, 12, 14, 16, 23, 25, 29, 32, 33, 35, 38, 39, 40, 41], "ik": [0, 25, 32, 33], "iki": [], "ilg3ggewq5u": [39, 40], "ill": 35, "illinoi": [], "illustr": [5, 7, 10, 12, 13, 14, 20, 24, 32, 37, 40], "ilsvrc": 35, "im": 6, "imag": [1, 3, 4, 6, 9, 11, 12, 14, 31, 32, 38, 39, 40, 41], "image_at_epoch_": 4, "image_batch": 4, "image_height": 3, "image_path": [0, 6, 7, 9, 32, 36, 37], "image_width": 3, "imageio": 6, "imagenet": 35, "images_from_seed_imag": 4, "imagin": [1, 40], "imbal": 23, "imbalanc": 23, "immedi": [0, 3, 4, 6, 24, 32, 35], "impact": 27, "implement": [0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 19, 20, 21, 22, 26, 29, 32, 33, 34, 35, 37, 38, 39], "impli": [3, 5, 6, 7, 13, 25, 33, 34, 35, 36, 37], "implicit": [3, 35], "implicitli": [11, 29], "import": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 26, 27, 29, 35, 36, 37, 38, 41], "importantli": 3, "importerror": [], "impos": [0, 6, 11, 12, 32, 38, 40, 41], "imposs": [0, 5, 32, 33, 34], "impract": 35, "impress": [0, 12, 32, 38, 39], "improv": [0, 4, 5, 9, 10, 11, 13, 15, 21, 26, 27, 33, 34], "impur": 9, "imread": 6, "imshow": [1, 3, 4, 6, 40, 41], "in3050": [31, 32], "in3310": 32, "in4080": [31, 32], "in4300": [31, 32], "in4310": 31, "in5400": 3, "in5550": 31, "in_out_neuron": 4, "inaccur": [13, 34], "inact": [12, 38, 39, 40], "inadequ": [0, 32], "inappropri": 35, "inch": [6, 33], "incident": [], "includ": [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 15, 16, 17, 18, 19, 20, 21, 22, 24, 29, 30, 31, 32, 33, 34, 36, 40, 41], "include_bia": [6, 9, 36, 37], "inclus": 27, "incom": [12, 16, 38, 39], "incorrect": [1, 40], "incorrectli": 23, "incoveni": 8, "increas": [0, 1, 3, 4, 5, 6, 9, 12, 13, 19, 23, 26, 29, 32, 33, 35, 36, 37, 38, 39, 40, 41], "increasingli": 29, "increment": 35, "ind": 6, "inde": [0, 2, 4, 5, 6, 13, 32, 33, 34, 39, 41], "indefinit": 4, "independ": [0, 5, 6, 7, 8, 12, 13, 29, 32, 33, 34, 35, 37, 38], "index": [0, 1, 3, 4, 10, 14, 24, 25, 26, 27, 29, 31, 32, 40], "index_col": [0, 32], "indic": [0, 1, 3, 4, 5, 6, 9, 10, 11, 13, 16, 23, 26, 27, 32, 33, 39, 40, 41], "indirect": [], "indispens": [6, 36, 37], "individu": [1, 6, 7, 10, 12, 29, 32, 33, 35, 36, 37, 38, 39, 40, 41], "indu": [], "indx": 25, "indx1": [2, 41], "indx2": [2, 41], "indx3": [2, 41], "ineffici": [3, 13], "inequ": [8, 13], "inequaltii": 34, "inertia": 13, "inexperi": [], "inf": [], "inf1000": [24, 32], "inf1100": [24, 32], "inf1100l": [24, 32], "inf1110": [24, 32], "inf3000": 32, "infeas": [9, 35], "infer": [0, 1, 4, 6, 31, 32, 36, 37, 40, 41], "inferenc": 1, "infil": [0, 6, 7, 9, 32, 36, 37], "infin": [5, 6, 7, 11, 19, 33, 34, 36, 37, 39, 40], "infinit": [3, 35], "infinitesim": 29, "influenc": [6, 10, 18, 36, 37], "influenti": [1, 40], "info": 32, "inform": [0, 1, 3, 4, 6, 9, 11, 12, 13, 14, 23, 25, 26, 27, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41], "inforom": 15, "infrequ": 35, "infti": [3, 6, 13, 29, 34, 36, 39], "ingeni": [13, 34, 35], "ingredi": [0, 9, 32], "inher": [6, 35, 36, 37], "inherit": [25, 32, 35], "init": [], "initi": [0, 1, 2, 6, 10, 13, 14, 18, 25, 27, 29, 32, 34, 35, 36, 37, 38, 39, 40, 41], "inititi": [40, 41], "inject": 14, "inlin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 23, 25, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41], "inn": 23, "inner": [0, 13, 33], "innerhtml": [], "inp": 4, "inplac": 13, "inpput": 39, "input": [0, 1, 3, 4, 5, 6, 7, 8, 12, 13, 14, 16, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38], "input_dim": 1, "input_nod": [40, 41], "input_s": 21, "input_shap": [3, 4], "inputs": 1, "inputs_shuffl": [0, 1, 33, 40], "inquiri": 20, "insert": [3, 5, 6, 8, 10, 29, 33, 34, 36], "insid": [4, 7, 21, 38], "insight": [0, 1, 5, 24, 27, 32, 33, 34, 36, 37, 39], "insist": [6, 13, 33, 35], "inspir": [0, 1, 12, 26, 27, 32, 38, 39, 40], "instabl": [2, 41], "instal": [0, 1, 5, 6, 9, 15, 20, 27, 40, 41], "instanc": [0, 1, 2, 4, 6, 9, 11, 13, 16, 23, 32, 33, 34, 35, 36, 37, 40, 41], "instanti": 10, "instead": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 17, 20, 21, 22, 25, 27, 29, 32, 33, 35, 36, 40, 41], "institut": [1, 40], "instruct": [0, 1, 15, 40, 41], "int": [0, 1, 2, 3, 4, 5, 6, 11, 13, 14, 25, 29, 33, 35, 36, 37, 38, 40, 41], "int32": 10, "int_": [3, 6, 23, 29, 36, 39], "int_0": 29, "int_a": 29, "intak": [0, 33], "integ": [1, 2, 13, 14, 25, 29, 32, 37, 38, 40, 41], "integer_vector": [1, 40], "integr": [3, 6, 23, 29, 32, 36], "intellig": [0, 14, 31, 32], "intend": 10, "intens": [1, 18, 40], "intention": 14, "interact": [0, 6, 9, 12, 24, 26, 27, 32, 38, 39], "intercept": [0, 6, 8, 11, 13, 16, 17, 18, 19, 32, 33, 34, 35, 36, 37, 38], "intercept_": [0, 6, 8, 9, 13, 32, 33, 35], "interchang": [5, 12, 25, 38, 39], "interconnect": [1, 40], "interesit": [], "interest": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 19, 24, 26, 27, 29, 32, 33, 34, 36, 37, 38, 39, 40, 41], "interfac": [0, 1, 15, 25, 33, 40, 41], "interior": [0, 9, 32], "intermedi": [25, 33, 35], "intermediari": [21, 22], "intermeti": 22, "intermetidari": 22, "intern": [1, 10, 12, 22, 37, 38, 39, 40, 41], "internation": [], "interpol": [1, 3, 4, 6, 12, 38, 39, 40, 41], "interpr": [5, 33, 34], "interpret": [0, 1, 6, 9, 10, 12, 13, 15, 16, 21, 23, 25, 26, 27, 29, 39, 40], "interrupt": [], "interv": [0, 3, 5, 6, 7, 13, 19, 29, 32, 33, 34, 37, 38], "intial": [13, 34], "intract": [0, 4, 33], "intrins": [3, 11, 25, 29, 32], "intro": [24, 31, 32], "introduc": [0, 1, 5, 6, 8, 10, 12, 25, 26, 29, 32, 34, 35, 36, 38, 39, 40], "introduct": [1, 2, 4, 13, 31, 33, 34, 35, 37, 40, 41], "introductori": [0, 4, 25, 31, 32, 33], "intuit": [0, 5, 6, 8, 12, 13, 26, 32, 35, 36, 37, 38, 39, 40], "inv": [0, 5, 13, 17, 32, 33, 34, 35], "invalid": [], "invalu": [0, 13, 24, 32, 34], "invari": [1, 40], "invd": 5, "inver": [8, 38], "invers": [0, 3, 6, 13, 32, 33, 34, 35], "inverse_transform": 8, "invert": [0, 5, 7, 10, 13, 16, 18, 32, 35, 37, 38], "investig": [], "invh": [13, 35], "invok": 8, "involv": [0, 2, 6, 7, 11, 12, 32, 33, 35, 36, 37, 38, 39, 40, 41], "io": [0, 24, 26, 27, 28, 30, 31, 32, 33, 40, 41], "ion": [], "ip": [0, 8, 29, 32], "ipca": 11, "ipynb": [24, 32], "ipython": [0, 5, 7, 9, 11, 14, 24, 26, 27, 32, 33, 37], "iq": [6, 36], "iri": [8, 9, 21, 23], "irreduc": [6, 36, 37], "irrelev": [5, 33, 34], "irrespect": [0, 32], "irvin": [26, 27], "is_avail": 41, "isaac": [], "isaacmus": [], "iseffici": [], "isn": 5, "isnan": [40, 41], "isnul": [], "isolo": 22, "isomap": 11, "issu": [1, 9, 15, 25, 35, 40, 41], "it_arrai": 13, "item": [0, 13, 32, 41], "items": [25, 32], "iter": [1, 2, 4, 6, 8, 13, 14, 18, 26, 29, 34, 35, 36, 37, 38, 39, 40, 41], "its": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 21, 23, 24, 25, 26, 27, 29, 32, 34, 35, 36, 37, 38, 39, 40, 41], "itself": [5, 6, 12, 26, 27, 29, 32, 33, 36, 39], "iv": 40, "ix": [40, 41], "j": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 13, 14, 15, 16, 23, 25, 26, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "j1": 25, "j_": 6, "j_41hld6ttu": 36, "j_lasso_sk": 6, "j_ridge_sk": 6, "j_sk": 6, "jackknif": [6, 24, 32, 36, 37], "jacobian": [2, 13, 34], "janko": [], "jason": 4, "javascript": [], "jax": [24, 27, 32, 35, 39], "jeff": [], "jensen": [30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "jentzen": [39, 40], "jerom": [19, 26, 31], "jhauser": [], "ji": [12, 23, 25, 39, 40], "jit": 13, "jj": [0, 5, 6, 32, 36], "jk": [0, 1, 6, 12, 25, 32, 38, 39, 40], "jl": [0, 32], "jm": 25, "jmlr": 41, "jnp": 13, "job": [2, 8, 10, 15, 41], "join": [0, 4, 6, 7, 9, 26, 27, 32, 36, 37], "joint": [4, 5], "jonathan": [], "json": [], "judg": [13, 34, 37, 38], "judgement": 6, "julia": [24, 25, 26], "juliu": [39, 40], "jump": [29, 35], "junk": 4, "jupit": 32, "jupyt": [0, 15, 16, 19, 24, 26, 31, 32, 36, 39, 40], "jupyterbook": [], "jupytext": [], "just": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "justif": 0, "justifi": [3, 10], "k": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 21, 23, 24, 25, 26, 29, 30, 32, 33, 34, 35, 38, 41], "k0": [7, 37, 38], "k1": [7, 37, 38], "kaggl": [6, 26, 27], "kajda": [40, 41], "kappa_d": 29, "karl": [30, 32], "karush": 8, "katex": [], "katrin": [30, 32], "keep": [0, 1, 4, 5, 6, 11, 13, 14, 15, 18, 21, 22, 25, 26, 27, 32, 33, 34, 35, 36, 37, 40], "keepdim": [1, 6, 10, 25, 36, 37, 38, 40, 41], "kei": [1, 3, 6, 12, 35, 38, 40, 41], "kellei": [], "kenneth": [], "kept": [4, 6, 14, 36, 37], "kera": [0, 4, 24, 26, 27, 32], "kernel": [0, 1, 3, 24, 32, 33, 40, 41], "kernel_regular": [1, 3, 40, 41], "kernel_s": 4, "kernelpca": 11, "kev": [0, 32], "kevin": [31, 32], "kevinsheppard": [], "keyboardinterrupt": [40, 41], "keyword": [18, 25, 32, 40, 41], "kfold": [6, 36, 37], "kg": [1, 40], "ki": 25, "kick": [1, 13, 35, 40], "kiener": [2, 41], "kilomet": [6, 33], "kim": [], "kind": [0, 2, 3, 4, 8, 12, 13, 14, 32, 33, 38, 39, 40, 41], "kingma": 35, "kj": [6, 12, 25, 33, 35, 39, 40, 41], "kjm": [24, 32], "kkt": 8, "kl": 29, "km": [12, 32, 38], "kmean": 14, "kmeanspoint": 14, "kn_k": 14, "know": [0, 1, 2, 5, 6, 8, 13, 15, 16, 17, 19, 20, 24, 32, 33, 34, 40, 41], "knowledg": [0, 24, 32], "known": [1, 3, 4, 5, 6, 7, 8, 9, 12, 18, 25, 26, 27, 29, 31, 33, 35, 36, 37, 38, 39, 40, 41], "kondev": [0, 32], "kp": 29, "kpca": 11, "kramdown": [], "kristin": 41, "kroneck": 14, "kt": [], "kuckuck": [39, 40], "kuhn": 8, "kumar": 41, "kutyniok": [39, 40], "kvalsund": [30, 32], "kwarg": [40, 41], "kwown": [0, 32], "l": [0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 22, 23, 25, 26, 29, 32, 34, 35, 37, 38, 41], "l0": [7, 37, 38], "l1": [0, 1, 3, 7, 27, 32, 37, 38, 40, 41], "l1_l2": [1, 3, 40, 41], "l1regl": 5, "l2": [1, 3, 27, 40, 41], "l2_reg": 41, "l_": [25, 35], "l_1": [7, 27, 37, 38, 39], "l_2": [7, 13, 27, 34, 35, 37, 38, 39], "l_i": 35, "l_j": [12, 39, 40], "l_ja": [40, 41], "la": 13, "la_": [], "la_i": [12, 39, 40, 41], "la_k": [12, 39], "lab": [20, 24, 26, 27, 32], "label": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 20, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "labelencod": [7, 10, 23, 38], "labels": [6, 8, 9], "labels_shuffl": [0, 1, 33, 40], "laboratori": 28, "lack": [0, 32, 35], "lagari": [2, 41], "lagrang": [8, 11], "lam": [18, 40, 41], "lambda": [0, 1, 2, 3, 5, 6, 7, 8, 10, 12, 13, 17, 18, 19, 20, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41], "lambda_": 11, "lambda_0": 11, "lambda_1": [5, 8, 11, 33, 34], "lambda_2": [8, 11], "lambda_i": [8, 11], "lambda_iy_i": 8, "lambda_jy_iy_j": 8, "lambda_k": 8, "lambda_n": [5, 8, 33, 34], "lamda": 1, "land": 8, "landmark": 8, "landscap": [13, 18, 34, 35], "langl": [0, 6, 11, 29, 32, 33], "languag": [0, 1, 4, 8, 24, 25, 26, 27, 31, 32, 40], "lapack": [25, 32], "laplac": 5, "laptop": [15, 24], "larg": [0, 1, 2, 4, 5, 6, 8, 9, 10, 11, 13, 18, 24, 25, 26, 29, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41], "larger": [0, 3, 5, 6, 8, 10, 11, 13, 17, 22, 23, 29, 32, 33, 34, 35, 36], "largest": [4, 8, 11], "lasso": [0, 7, 24, 27, 32, 35, 36, 37, 38], "lasso_sk": 6, "last": [0, 1, 3, 4, 5, 6, 7, 8, 12, 16, 17, 19, 21, 22, 25, 26, 29, 30, 32, 34, 36, 37, 41], "latent": 4, "latent_dim": 4, "latent_point": 4, "latent_space_value_rang": 4, "later": [0, 1, 4, 7, 8, 12, 13, 14, 15, 19, 21, 22, 24, 26, 27, 32, 35, 37, 38, 39, 40, 41], "latest": [4, 15, 24], "latest_checkpoint": 4, "latex": [20, 32], "latexcodec": [], "latrpygrtttbnjr3znuhl": 22, "latter": [0, 3, 6, 7, 8, 11, 13, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39], "lattic": [12, 38, 39], "law": 0, "layer": [0, 4, 13, 23, 27, 32, 35, 38], "layer_grad": 22, "layer_input": 22, "layer_output_s": [21, 22], "layers_grad": 21, "lbfg": [7, 9, 10, 23, 38], "lc_messag": [], "lcc": [5, 6, 36], "lda": 11, "ldot": [0, 6, 11, 26, 32, 36, 37], "le": [5, 7, 10, 13, 17, 29, 33, 34, 35, 37], "lead": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 21, 22, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40], "leaf": 9, "leaki": [1, 27, 40, 41], "leakyrelu": [4, 27], "lear": [13, 34], "learn": [3, 4, 5, 6, 7, 8, 9, 10, 12, 21, 23, 25, 30, 31], "learnabl": 3, "learner": 10, "learnig": 32, "learning_r": [8, 10, 21, 41], "learning_rate_init": [0, 1, 32, 40], "learning_schedul": [13, 35], "learnt": [26, 27], "least": [0, 7, 8, 10, 11, 17, 18, 24, 25, 29, 36, 37, 38], "leat": [13, 35], "leav": [0, 1, 3, 5, 6, 9, 11, 21, 32, 34, 36, 37, 40], "lectur": [0, 1, 5, 10, 11, 12, 13, 24, 25, 26, 27, 28, 30, 31, 33], "lecture_11_backpropag": 41, "lecturenot": [0, 24, 26, 27, 31, 32, 40, 41], "left": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "leftarrow": [8, 12, 39, 40, 41], "legend": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 15, 21, 32, 33, 34, 35, 36, 37, 38, 41], "legend_el": 21, "leinonen": 32, "len": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 16, 17, 21, 22, 25, 32, 33, 34, 35, 36, 37, 38, 40, 41], "length": [0, 1, 3, 4, 8, 9, 13, 16, 21, 24, 32, 33, 34, 35, 40], "length_of_sequ": 4, "leq": [0, 5, 7, 8, 13, 14, 29, 32, 33, 34, 35, 37], "less": [0, 1, 3, 4, 5, 6, 8, 9, 13, 24, 29, 32, 33, 34, 35, 36, 37, 40, 41], "lessen": [1, 40], "let": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 19, 22, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "letter": [0, 16, 25, 29, 32, 33], "level": [0, 1, 5, 6, 9, 23, 24, 25, 26, 27, 28, 30, 32, 35, 36, 37, 39, 40, 41], "leverag": 35, "lexer": [], "li": [8, 11], "liabil": [], "liabl": [], "lib": [], "liberti": 35, "liblinear": 10, "librari": [0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 25, 26, 29, 31, 33, 34, 35, 40, 41], "licenc": [], "licens": [0, 1, 24, 26, 32, 40, 41], "lie": [0, 6, 11, 29, 32, 33, 36, 37], "life": [0, 1, 8, 12, 32, 38, 39, 40, 41], "lifetim": 13, "lift": 23, "light": [], "like": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "likelihood": [0, 1, 5, 9, 32, 33, 40], "lim_": 29, "limit": [0, 5, 6, 8, 12, 25, 26, 27, 32, 33, 37, 38, 39], "lin_clf": 8, "lin_model": [], "lin_reg": 9, "linalg": [0, 2, 5, 6, 8, 11, 13, 17, 25, 29, 32, 33, 34, 35, 38, 41], "line": [0, 3, 6, 8, 11, 13, 15, 16, 20, 21, 23, 32, 34, 35, 36, 39, 40, 41], "line1": 8, "line2": 8, "line2d": [], "line3": 8, "line_model": 15, "line_ms": 15, "line_predict": 15, "linear": [1, 3, 5, 6, 7, 9, 10, 11, 12, 16, 17, 18, 19, 21, 24, 26, 27, 29, 35, 36, 38, 39, 40, 41], "linear_model": [0, 5, 6, 7, 8, 9, 10, 11, 13, 15, 16, 19, 23, 27, 32, 33, 34, 35, 36, 37, 38], "linear_regress": [6, 36, 37, 40, 41], "linearli": [5, 33, 34, 35], "linearloc": [6, 13, 34, 35], "linearregress": [0, 6, 7, 9, 15, 16, 19, 32, 33, 35, 36, 37], "linearsvc": 8, "lineat": 34, "liner": [1, 3, 40], "linerar": 10, "linewidth": [0, 2, 4, 6, 8, 9, 10, 36, 41], "link": [0, 4, 9, 12, 15, 20, 21, 24, 26, 27, 28, 30, 32, 37, 39], "linlag": 5, "linpack": [25, 32], "linreg": [0, 32], "linspac": [0, 2, 3, 4, 6, 8, 9, 10, 13, 16, 17, 19, 25, 29, 32, 33, 35, 36, 37, 41], "linu": 4, "linux": [0, 1, 24, 26, 32, 40, 41], "liquid": [0, 32], "list": [1, 2, 3, 4, 9, 15, 21, 22, 24, 26, 27, 32, 35, 38, 41], "list_physical_devic": 41, "listedcolormap": [9, 10], "literatur": [1, 7, 14, 31, 36, 37, 40], "littl": [1, 3, 9, 12, 22, 35, 39, 40], "live": [8, 16], "ll": [0, 18, 29, 32, 33], "lle": [0, 33], "llm": 20, "lloyd": [4, 14], "lmb": [0, 2, 5, 6, 33, 34, 35, 36, 37, 41], "lmbd": [0, 1, 3, 32, 40, 41], "lmbd_val": [0, 1, 3, 32, 40, 41], "lmbda": [13, 34, 35], "ln": [1, 13, 34, 40], "load": [1, 4, 6, 7, 9, 10, 23, 35, 38, 41], "load_boston": [], "load_breast_canc": [1, 7, 9, 10, 11, 38, 40, 41], "load_data": [3, 4, 41], "load_digit": [1, 3, 23, 40, 41], "load_iri": [8, 9, 21, 23], "loc": [3, 6, 7, 8, 9, 10, 21, 32, 36, 37, 38], "local": [0, 1, 3, 7, 12, 13, 15, 21, 22, 33, 34, 35, 37, 38, 39, 40], "locat": [2, 3, 8, 15, 41], "log": [0, 1, 2, 4, 5, 6, 7, 9, 10, 11, 13, 15, 20, 21, 25, 26, 27, 32, 35, 36, 37, 38, 40, 41], "log10": [0, 5, 6, 33, 34, 35, 36, 37, 40, 41], "log_": [0, 32], "log_clf": 10, "logarithm": [0, 5, 7, 17, 25, 32, 36, 37, 38], "logbook": [26, 27], "logic": [0, 1, 9, 32, 40], "logical_or": [], "login": 15, "logist": [0, 1, 2, 8, 9, 10, 11, 12, 13, 23, 24, 27, 33, 34, 35, 39, 41], "logisti": 27, "logistic_regress": [40, 41], "logisticregress": [7, 9, 10, 11, 23, 27, 37, 38], "logit": [7, 27, 37, 38, 41], "logreg": [7, 9, 10, 11, 23, 38], "logspac": [0, 1, 3, 5, 6, 32, 33, 34, 35, 36, 37, 40, 41], "long": [0, 1, 3, 4, 12, 13, 21, 32, 34, 35, 38, 39, 40], "longer": [2, 3, 8, 10, 14, 25, 29, 32, 35, 41], "loocv": [6, 36, 37], "look": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 16, 19, 20, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 40, 41], "loop": [1, 4, 6, 10, 12, 14, 16, 17, 18, 22, 24, 25, 32, 35, 36, 37, 40, 41], "lose": [1, 40], "loss": [0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 13, 18, 21, 25, 26, 27, 32, 36, 37, 38, 39, 40, 41], "loss_bin": [37, 38], "loss_fil": 4, "loss_multi": [37, 38], "loss_vec": [37, 38], "lossfil": 4, "lost": 4, "lot": [1, 4, 6, 16, 19, 20, 35, 36, 40, 41], "low": [0, 6, 9, 10, 11, 26, 32, 33, 36, 37], "lower": [0, 1, 3, 6, 9, 10, 16, 21, 25, 33, 35, 40, 41], "lowercas": [25, 32], "lowest": [9, 13, 29, 35], "lr": [1, 3, 4, 10, 37, 38, 40, 41], "lrelu": [40, 41], "lstat": [], "lstm": 4, "lstm_2layer": 4, "lstsq": [0, 32, 33], "lt": [6, 36], "lu": [0, 5, 32, 33, 34], "lubksb": 25, "luckili": [2, 41], "ludcmp": 25, "lux": 25, "lvert": [1, 40], "lw": [0, 32], "m": [0, 1, 2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 15, 25, 29, 30, 31, 32, 33, 34, 35, 36, 38, 39, 40, 41], "m_": [9, 12, 39, 40], "m_0": 35, "m_1": 14, "m_h": [0, 32], "m_k": 14, "m_l": [12, 39, 40], "m_n": [0, 32], "m_p": [0, 32], "m_t": [13, 35], "ma": 11, "machin": [1, 3, 4, 5, 6, 7, 9, 10, 11, 12, 15, 16, 25, 31, 33, 35, 36, 39, 40, 41], "machinelearn": [0, 6, 16, 20, 24, 26, 27, 28, 30, 31, 32, 33, 34, 37, 38, 40, 41], "machineri": 23, "mackai": 31, "macro": 23, "made": [0, 1, 3, 4, 5, 6, 7, 9, 11, 12, 26, 27, 32, 33, 35, 37, 38, 39, 40], "mae": [0, 32], "magic": 4, "magnitud": [1, 6, 7, 13, 21, 33, 35, 38, 39, 40], "mai": [0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 19, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "mail": [28, 30], "main": [0, 1, 3, 4, 5, 6, 7, 9, 25, 26, 27, 31, 33, 34, 35, 37, 38, 40], "mainli": [0, 5, 6, 7, 9, 32, 33, 36, 37, 38], "maintain": [6, 35, 36], "major": [1, 6, 9, 10, 13, 25, 32, 34, 35, 36, 37, 40], "make": [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 15, 16, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41], "make_axes_locat": 6, "make_classif": [23, 38], "make_moon": [8, 9, 10], "make_pipelin": [0, 6, 10, 33, 36, 37], "makedir": [0, 6, 7, 9, 32, 36, 37], "malcondit": 25, "malign": [1, 7, 9, 38], "mammographi": 5, "manag": [0, 2, 3, 15, 24, 26, 32, 35, 41], "mandatori": [30, 32], "mani": [0, 1, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "manifold": 11, "manner": [3, 23], "manual": [6, 21, 22, 33, 35], "map": [0, 1, 2, 6, 7, 8, 11, 12, 14, 29, 32, 37, 38, 40, 41], "marc": 33, "marchant": [], "margin": [0, 5, 8], "marit": [0, 32], "mark": 32, "markdownfil": [], "markdownit": [], "markdownitdeflist": [], "markedli": [], "marker": [7, 25, 32, 37], "market": 23, "markov": [24, 32], "markup": [], "marsaglia": 29, "mask_or": [], "masked_arrai": [], "maskedrecord": [], "mass": [0, 1, 5, 13, 33, 34, 40], "massag": [0, 32], "masses2016": [0, 32], "masses2016ol": [0, 32], "masses2016tre": 0, "masseval2016": [0, 32], "master": [28, 30], "mat": [24, 32], "mat1100": [24, 32], "mat1110": [24, 32], "mat1120": [24, 32], "match": [1, 4, 5, 13, 14, 15, 33, 34, 35, 40], "materi": [4, 5, 7, 13, 15, 25, 28, 30, 38, 41], "math": [3, 7, 12, 13, 25, 29, 31, 32, 35, 37, 38, 40, 41], "mathbb": [0, 4, 5, 6, 7, 8, 11, 12, 13, 14, 17, 19, 25, 26, 29, 32, 33, 34, 35, 36, 37, 38, 39], "mathbf": [0, 5, 6, 7, 8, 13, 19, 25, 26, 32, 33, 34, 35, 36, 37, 38, 39], "mathcal": [1, 5, 6, 7, 13, 26, 36, 37, 38, 40], "matheemat": 3, "mathemat": [0, 6, 11, 12, 13, 21, 23, 24, 25, 29, 31, 32, 35], "mathemati": 32, "mathrm": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 19, 23, 26, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40], "matmul": [1, 2, 5, 39, 40, 41], "matnat": 31, "matplotlib": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 19, 21, 22, 23, 24, 25, 26, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41], "matplotlibrc": [], "matric": [0, 1, 3, 4, 6, 7, 8, 11, 13, 16, 17, 24, 33, 34, 37, 38, 39, 40, 41], "matrix": [0, 2, 3, 4, 6, 7, 8, 10, 13, 17, 18, 19, 21, 26, 27, 29, 36, 37, 39, 41], "matshow": 1, "matter": [2, 3, 13, 33, 34, 35, 39, 41], "matthia": [], "max": [0, 1, 2, 3, 4, 9, 10, 12, 13, 21, 30, 32, 34, 35, 37, 38, 39, 40, 41], "max_depth": [0, 9, 10], "max_diff": [2, 41], "max_diff1": [2, 41], "max_diff2": [2, 41], "max_it": [0, 1, 8, 13, 27, 32, 38, 40], "max_iter": 14, "max_leaf_nod": 10, "max_sampl": 10, "maxdegre": [0, 6, 10, 33, 36, 37], "maxdepth": 10, "maxim": [1, 4, 5, 7, 8, 11, 36, 37, 38, 40], "maximum": [0, 2, 3, 5, 7, 8, 9, 10, 13, 14, 32, 33, 34, 35, 41], "maxpolydegre": [5, 6, 33, 34, 35, 36, 37], "maxpooling2d": 3, "mbox": [5, 6, 33, 34, 36], "mcculloch": [12, 38, 39], "md": 11, "mdoel": 4, "me": [], "mean": [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 22, 23, 24, 25, 26, 27, 29, 32, 35, 36, 38, 39, 40, 41], "mean0": [37, 38], "mean1": [37, 38], "mean_absolute_error": [0, 32], "mean_divisor": 14, "mean_i": 29, "mean_matrix": 14, "mean_squared_error": [0, 4, 6, 7, 10, 15, 19, 32, 33, 36, 37], "mean_squared_log_error": [0, 32], "mean_vector": 14, "mean_x": 29, "meaning": [0, 4, 7, 32, 37], "meansquarederror": [0, 32], "meant": [3, 7, 10, 13, 37, 39], "meanwhil": 35, "measur": [0, 1, 2, 5, 6, 9, 11, 12, 14, 16, 18, 26, 27, 29, 32, 33, 35, 36, 37, 39, 40, 41], "mechan": [0, 4, 29, 32, 35], "median": [0, 32, 33, 35], "medicin": [12, 38, 39], "medium": [4, 8, 13, 27, 35], "medv": [], "meet": [0, 30], "mehta": [0, 32, 33, 34], "member": [20, 26, 27], "memori": [3, 4, 11, 12, 13, 18, 25, 38, 39], "mentat": [], "mention": [0, 12, 13, 26, 27, 29, 32, 34, 35, 38, 39], "merchant": [], "mere": [0, 26, 27], "merg": [], "meshgrid": [2, 5, 6, 8, 9, 10, 11, 40, 41], "mess": 15, "messag": [5, 13], "messi": [2, 41], "messier": 22, "met": [0, 3, 8, 33], "meta": [], "meteorolog": 9, "meter": [6, 33], "method": [0, 1, 2, 3, 4, 5, 7, 8, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 29, 31, 33, 39], "metion": 6, "metric": [0, 1, 3, 6, 7, 9, 10, 14, 15, 21, 22, 23, 27, 32, 33, 36, 37, 38, 40, 41], "metropoli": [24, 32], "mev": [0, 29, 32], "mgd": [13, 35], "mglearn": [24, 32], "mgrid": 13, "mhjensen": [], "mi": 10, "mia": [30, 32], "michael": [27, 39, 40], "micro": 23, "microsoft": 31, "mid": [1, 40], "midel": 4, "midnight": [15, 21, 22, 23], "midpoint": 9, "might": [0, 1, 2, 4, 6, 9, 13, 15, 17, 18, 22, 33, 34, 35, 40, 41], "migth": 17, "mild": 9, "millimet": [6, 33], "million": [0, 32, 33, 35], "mimic": [12, 38, 39], "min": [0, 2, 5, 8, 9, 34, 41], "min_": [0, 2, 5, 14, 17, 32, 33, 34, 41], "min_samples_leaf": 9, "mind": [0, 6, 13, 15, 18, 21, 32, 33, 34, 35, 36], "mindboard": 4, "mine": [24, 32], "mini": [1, 11, 12, 13, 34, 40], "minibatch": [1, 11, 13, 40, 41], "minibathc": [13, 35], "miniforge3": [], "minim": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 33, 34, 35, 36, 40], "minima": [0, 1, 7, 13, 32, 34, 35, 37, 38, 40], "minimum": [0, 1, 2, 6, 8, 9, 11, 13, 33, 34, 35, 36, 37, 38, 40, 41], "minmaxscal": [0, 33, 35, 40, 41], "minor": 29, "minst": [1, 40, 41], "minu": [7, 37], "mirjalili": 32, "mirror": 9, "misc": 6, "misclassif": [8, 9, 10, 23], "misclassifi": [8, 10], "miser": 0, "mismatch": [1, 40], "miss": [7, 10], "mistak": [4, 19], "mit": 31, "mitig": 35, "mix": [1, 2, 32, 40, 41], "mixtur": [13, 35], "mk": [9, 25], "mkdir": [0, 6, 7, 9, 32, 36, 37], "ml": [0, 1, 10, 13, 25, 26, 27, 33, 34, 35, 40, 41], "mlab": 29, "mle": [5, 7, 37, 38], "mlp": [1, 38, 39, 40], "mlpclassifi": [1, 38, 40], "mlpregressor": [0, 32], "mm": 25, "mml": 33, "mn": [12, 29, 38], "mnist": [1, 11, 23, 27, 40], "mnist_784": 27, "mo": [], "mod": 29, "mode": [28, 30, 32, 37, 38, 40, 41], "model": [2, 3, 5, 7, 8, 9, 10, 11, 13, 14, 16, 18, 19, 20, 21, 23, 24, 26, 27, 29, 31, 33, 34, 35, 36, 37, 41], "model_bin": [37, 38], "model_multi": [37, 38], "model_select": [0, 1, 3, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 23, 27, 32, 33, 34, 35, 36, 37, 38, 40, 41], "moder": [10, 35], "modern": [0, 6, 7, 24, 32, 35, 36, 37, 38, 39, 40], "modest": 35, "modif": [2, 12, 13, 41], "modifi": [0, 1, 3, 5, 7, 8, 10, 12, 13, 32, 33, 34, 35, 37, 38, 39, 40], "modul": [0, 16, 25, 32, 41], "modular": 29, "modulo": 29, "moe": [11, 33], "moment": [5, 6, 13, 29, 36, 40, 41], "moment_correct": [40, 41], "momentum": [22, 39, 40, 41], "momentum_schedul": [40, 41], "mondai": [30, 32, 37], "monitor": [13, 35, 41], "monoton": [5, 12, 29, 36, 38, 39, 40, 41], "mont": [0, 6, 24, 29, 31, 32, 36, 37], "montli": 16, "moor": [5, 6], "more": [0, 1, 2, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 22, 23, 24, 27, 29], "moreov": [0, 3, 27], "morten": [30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "mortenhj": 32, "most": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 21, 22, 24, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "mostli": [1, 11, 18, 35, 40], "motion": [0, 13], "motiv": [1, 4, 39, 40], "moulin": 35, "move": [0, 4, 5, 6, 7, 9, 12, 13, 14, 15, 16, 21, 22, 26, 29, 33, 34, 36, 37, 38, 39, 40, 41], "mpl": [7, 32, 37], "mpl_toolkit": [2, 6, 13, 34, 35, 41], "mplot3d": [2, 6, 13, 34, 35, 41], "mplregressor": [1, 40], "mr_": [], "mrecord": [], "ms3tv8fvar": 38, "mse": [0, 4, 5, 6, 9, 10, 15, 16, 17, 19, 20, 22, 26, 27, 32, 33, 34, 35, 36, 37, 40, 41], "mse_der": 22, "mse_simpletre": 10, "mselassopredict": [5, 34], "mselassotrain": [5, 34], "mseownridgepredict": [6, 33, 34, 35], "msepredict": [5, 34], "mseridgepredict": [0, 5, 6, 33, 34, 35], "msetrain": [5, 34], "msg": [], "msle": [0, 32], "mt": [7, 12, 37, 38, 40], "mu": [0, 6, 11, 13, 29, 32, 35, 36], "mu0": 29, "mu1": 29, "mu2": 29, "mu_": [6, 29, 33, 35, 36], "mu_i": [6, 33, 35], "mu_n": 11, "mu_x": 29, "much": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15, 20, 21, 22, 25, 26, 29, 32, 33, 34, 35, 36, 37, 39, 40, 41], "multi": [0, 1, 3, 7, 23, 24, 32, 37, 41], "multi_class": [27, 37, 38], "multiclass": [1, 7, 23, 27, 37, 38], "multiclass_result": [37, 38], "multidimension": [11, 12, 32, 38, 39], "multilay": [1, 40], "multinomi": [7, 27, 37, 38], "multipl": [2, 4, 5, 6, 7, 12, 13, 15, 22, 27, 29, 33, 34, 35, 36, 37, 38, 39, 41], "multipli": [3, 5, 6, 11, 13, 18, 22, 25, 29, 33, 34, 35], "multiplum": 8, "multivari": [0, 2, 10, 11, 24, 29, 32, 41], "multivariate_norm": [11, 14], "multpli": 16, "murphi": [11, 31, 32], "muse": [], "must": [1, 2, 5, 6, 8, 10, 12, 13, 14, 15, 20, 22, 26, 27, 29, 33, 34, 35, 36, 37, 38, 39, 40, 41], "mutat": [7, 37, 38], "mutual": [1, 3, 6, 13, 36, 37, 40, 41], "mx_": 29, "my": 32, "mydata": 23, "myenv": [], "myriad": [0, 24, 32], "myself": [], "mz1": 29, "mz2": 29, "m\u00f8svatn": 6, "n": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "n0": [37, 38], "n1": [25, 37, 38], "n2": 25, "n8grai": [], "n_": [1, 2, 3, 8, 12, 23, 29, 38, 40, 41], "n_0": [12, 29, 38], "n_boostrap": [6, 10, 36, 37], "n_bootstrap": [6, 36], "n_categori": [1, 3, 40, 41], "n_class": [23, 37, 38], "n_cluster": 14, "n_compon": 11, "n_epoch": [13, 35, 40, 41], "n_estim": 10, "n_examples_to_gener": 4, "n_featur": [1, 18, 23, 37, 38, 39, 40, 41], "n_filter": 3, "n_hidden": [2, 41], "n_hidden_neuron": [0, 1, 32, 39, 40], "n_i": [23, 29], "n_inform": 23, "n_input": [0, 1, 3, 33, 39, 40, 41], "n_instanc": 9, "n_iter": 35, "n_job": 10, "n_k": 14, "n_l": [12, 29, 38], "n_layer": 1, "n_m": 9, "n_neuron": 1, "n_neurons_connect": 3, "n_neurons_layer1": [1, 40, 41], "n_neurons_layer2": [1, 40, 41], "n_output": [39, 40], "n_point": 14, "n_redund": 23, "n_sampl": [6, 8, 9, 10, 14, 18, 23, 36, 37, 38], "n_split": [6, 36, 37], "n_step": 4, "n_t": [2, 41], "n_x": [2, 41], "nabla": [1, 13, 34, 35, 40], "nabla_": [2, 13, 34, 35, 41], "nabla_w": 13, "nafter": [40, 41], "nag": 13, "naimi": [0, 32], "naiv": [7, 37, 38], "naive_kmean": 14, "name": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 18, 20, 21, 24, 25, 26, 27, 29, 30, 32, 33, 34, 36, 37, 38, 39, 40, 41], "namespac": [], "nan": [40, 41], "narrow": [13, 35], "nathaniel": [], "nation": [1, 5, 40], "nativ": [24, 32], "natur": [0, 1, 4, 8, 9, 12, 13, 26, 27, 29, 31, 32, 34, 35, 38, 39, 40], "navier": [12, 38, 39], "navig": [15, 35], "nb": 29, "nb_": 25, "nbconvert": 32, "nd": 14, "ndarrai": [6, 40, 41], "nderiv": [40, 41], "ne": [9, 10, 25, 29, 33, 34], "nearest": [1, 3, 6, 11, 40, 41], "nearli": [13, 34], "neat": 32, "neccesari": [6, 36], "necess": [2, 41], "necessari": [0, 1, 3, 4, 8, 14, 18, 32, 39, 40, 41], "necessarili": [0, 4, 11, 29, 32], "necesserali": 5, "neck": [7, 37, 38], "need": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 25, 27, 29, 33, 34, 35, 36, 37, 38, 39, 40, 41], "neg": [0, 1, 3, 5, 6, 7, 10, 13, 23, 25, 29, 32, 34, 36, 37, 38, 40, 41], "neg_mean_squared_error": [6, 36, 37], "neglect": [29, 35], "neglig": 29, "neighbor": [3, 6, 11], "neither": [4, 13, 35], "neq": [13, 14, 23, 29, 34], "nerual": [40, 41], "nervou": [12, 38, 39], "nest": [9, 12, 38], "nesterov": 13, "net": [2, 4, 12, 27, 38, 39, 41], "netlib": [25, 32], "network": [0, 9, 13, 21, 22, 23, 24, 31, 33], "network_input_s": [21, 22], "neural": [0, 13, 21, 22, 23, 24, 31, 33, 37], "neural_network": [0, 1, 2, 32, 38, 40, 41], "neuralnet": 41, "neuralnetwork": [1, 22, 40], "neuralnetworksanddeeplearn": [27, 39, 40], "neuron": [1, 2, 3, 4, 12, 40, 41], "neutral": [0, 32], "neutron": [0, 32], "never": [1, 4, 6, 9, 29, 36, 37, 40], "new": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 17, 20, 22, 25, 32, 33, 34, 35, 37, 38, 40, 41], "new_chang": [13, 35], "new_hobbit": 32, "new_ma": [], "newaxi": [0, 3, 6, 9, 21, 36, 37], "newli": [0, 32], "newlin": [37, 38], "newton": [1, 7, 8, 13, 29, 39, 40], "next": [0, 1, 2, 3, 4, 5, 6, 8, 9, 13, 14, 15, 16, 21, 22, 23, 32, 33, 34, 35, 36, 38, 39, 40, 41], "next_guess": 13, "next_input": 4, "ng": [1, 40], "nhow": [40, 41], "ni": 14, "nice": [0, 1, 5, 11, 22, 32, 33, 34, 40], "nicer": [18, 35], "nielsen": [27, 39, 40], "nine": [39, 40], "nip": 35, "niter": [13, 34, 35], "nitric": [], "nlambda": [0, 5, 6, 33, 34, 35, 36, 37], "nlp": 31, "nm": 29, "nm_n": [0, 32], "nmse": [6, 36, 37], "nn": [2, 5, 6, 12, 25, 32, 36, 38], "nn_model": 1, "nnmin": [2, 41], "no_grad": 41, "node": [1, 3, 9, 10, 12, 21, 27, 38, 41], "nois": [0, 4, 5, 6, 8, 9, 10, 13, 18, 19, 26, 32, 33, 34, 35, 36, 37], "noise_dimens": 4, "noisi": [1, 6, 26, 35, 36, 37, 40], "nomask": [], "non": [0, 1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 18, 21, 25, 29, 32, 33, 34, 36, 37, 38, 39, 40, 41], "nondifferenti": 35, "none": [0, 1, 2, 4, 5, 9, 10, 13, 29, 32, 33, 37, 38, 39, 40, 41], "noninfring": [], "nonlinear": [3, 6, 8, 9, 11, 12, 36, 37, 38, 39], "nonneg": [6, 9, 13, 34, 36, 37], "nonparametr": 6, "nonsens": 29, "nonsingular": 25, "nonumb": [3, 7, 8, 13, 25, 37, 38], "nor": [1, 4, 13, 22, 35, 39, 40], "norm": [0, 1, 5, 6, 8, 11, 13, 18, 32, 33, 34, 35, 36, 39, 40], "normal": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 21, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 37, 38, 39, 41], "normali": [25, 32], "norwai": [6, 26, 27, 32, 34, 35, 36, 38, 39, 40, 41], "notabl": [], "notat": [0, 2, 5, 6, 13, 14, 29, 32, 33, 34, 36, 37, 39, 40, 41], "note": [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 18, 22, 24, 25, 29, 31, 32, 35, 36, 37, 38, 39, 40, 41], "notebook": [0, 1, 3, 9, 15, 16, 19, 20, 21, 22, 24, 26, 27, 32, 36, 39, 40, 41], "noteworthi": 35, "noth": [1, 2, 5, 8, 12, 14, 29, 33, 34, 38, 40, 41], "notic": [4, 5, 12, 13, 22, 25, 29, 32, 39, 40], "notimplementederror": [40, 41], "notion": 3, "noutput": [40, 41], "novel": [3, 6, 10, 32], "novemb": [1, 30, 32, 40, 41], "now": [0, 2, 4, 5, 6, 7, 8, 10, 11, 12, 14, 15, 16, 19, 21, 22, 24, 25, 26, 27, 29, 32, 33, 38, 39, 40, 41], "nowadai": [0, 1, 3, 9, 24, 32, 40, 41], "nox": [], "np": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "npm": [], "npr": [2, 41], "nsampl": [6, 36, 37], "nt": [2, 41], "nu": 29, "nuclear": [5, 33, 34], "nuclei": [0, 29, 32], "nucleon": [0, 32], "nucleu": [0, 32], "num": 4, "num_coordin": [2, 41], "num_epoch": 41, "num_equ": [40, 41], "num_hidden_neuron": [2, 41], "num_it": [2, 18, 41], "num_neuron": [2, 41], "num_neurons_hidden": [2, 41], "num_not": [40, 41], "num_point": [2, 41], "num_tre": 10, "num_valu": [2, 41], "number": [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 30, 32, 34, 36, 37, 38, 40], "numberid": [7, 37], "numberparamet": 3, "numer": [0, 5, 6, 9, 10, 11, 12, 13, 21, 24, 25, 31, 32, 33, 34, 35, 36, 37, 38, 39], "numpi": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 26, 29, 33, 34, 35, 36, 37, 38, 39, 40, 41], "numpydocstr": [], "nunmpi": [5, 33], "nve_frngahw": 34, "nx": [2, 41], "ny": [29, 40, 41], "o": [0, 1, 4, 5, 6, 7, 8, 9, 11, 25, 30, 31, 32, 33, 34, 35, 36, 37, 38], "obei": [6, 11, 13, 33, 35], "object": [0, 1, 4, 8, 10, 15, 19, 25, 32, 35, 39, 41], "obliqu": [5, 33, 34], "observ": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 29, 32, 34, 35, 36, 37, 38], "obtain": [0, 1, 5, 6, 7, 8, 9, 10, 12, 13, 14, 17, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "obviou": [5, 6, 11, 29, 33, 34], "obviouli": 32, "obvious": [0, 4, 5, 6, 25, 32, 36], "oc": [33, 34], "occupi": [], "occur": [0, 6, 8, 9, 23, 25, 29, 32], "octob": [21, 22, 23, 27, 30, 32, 38], "od": 0, "odd": [0, 3, 7, 32, 33, 35, 37, 38], "odenum": [2, 41], "odesi": [2, 41], "oen": 0, "off": [1, 3, 4, 5, 9, 13, 20, 23, 27, 29, 35, 36, 40, 41], "offer": [6, 11, 24, 25, 28, 30, 32, 36, 37], "offic": [30, 32], "offici": [28, 32], "offlin": [21, 22], "often": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40], "ofter": [25, 32], "og": [40, 41], "ol": [0, 13, 17, 19, 27, 33, 35, 37], "old": [1, 5, 10, 13, 15, 18, 37, 38, 40], "old_ma": [], "oliph": [], "ols_paramet": 16, "ols_sk": 6, "ols_svd": 6, "olsbeta": 34, "olstheta": [0, 5], "omega": [2, 3, 6, 41], "omega_0": 3, "omit": [0, 5, 32, 33, 34, 36], "onc": [1, 6, 9, 11, 13, 20, 36, 37, 40, 41], "one": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 19, 20, 21, 23, 24, 25, 26, 27, 29, 30, 32, 33, 35, 36, 37, 38], "one_hot": [37, 38], "one_hot_predict": 21, "onehot": [1, 40, 41], "onehot_vector": [1, 40], "onehotencod": 9, "ones": [0, 2, 5, 6, 8, 9, 10, 11, 13, 16, 18, 21, 22, 25, 26, 32, 33, 34, 35, 36, 37, 39, 41], "ones_lik": 4, "ong": 33, "onl": 3, "onli": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "onlin": [11, 15, 20, 28, 35, 39, 40], "onto": [5, 11, 33, 34], "open": [0, 1, 4, 6, 7, 9, 15, 24, 26, 28, 30, 32, 36, 37, 38, 40, 41], "oper": [0, 1, 3, 5, 6, 10, 11, 12, 13, 15, 16, 21, 22, 23, 24, 29, 32, 33, 34, 35, 36, 38, 40, 41], "operation": 29, "oplu": 29, "opmiz": [13, 35], "opportun": 0, "oppos": [6, 13], "opposit": [1, 5, 8, 33, 34, 40], "opt": [1, 5, 26, 27, 32, 34, 40, 41], "optim": [0, 2, 3, 4, 5, 6, 7, 9, 10, 11, 14, 16, 17, 19, 21, 22, 26, 27, 36, 41], "optimis": [1, 3, 40, 41], "option": [0, 1, 3, 5, 6, 8, 11, 15, 18, 23, 25, 33, 35, 36, 40, 41], "optmiz": [1, 8, 13, 33, 40], "oral": 32, "orang": 0, "order": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 15, 19, 21, 25, 26, 27, 29, 32, 33, 34, 36, 37, 38, 39, 40, 41], "ordinari": [0, 2, 3, 7, 11, 13, 17, 18, 24, 36, 37, 38], "oreilli": [31, 32], "org": [0, 3, 4, 16, 20, 21, 24, 25, 26, 27, 31, 32, 33, 34, 35, 39, 41], "organ": [6, 7, 10, 25, 36, 37], "orgin": 39, "orient": [1, 5, 29, 33, 34, 41], "origin": [0, 3, 5, 6, 8, 11, 12, 13, 15, 25, 32, 33, 34, 35, 36, 37, 38], "orthogn": [5, 33, 34], "orthogon": [0, 5, 6, 8, 11, 13, 25, 32, 33, 34], "orthonorm": [5, 33, 34], "os": [30, 32], "oscar": [1, 40], "oscil": [3, 13, 35], "oskar": 32, "oskarlei": 32, "osl": 18, "oslo": [0, 24, 26, 27, 28, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "osx": [0, 24, 26, 32], "other": [0, 1, 2, 3, 5, 6, 7, 8, 10, 13, 14, 16, 19, 21, 22, 24, 28, 29, 30, 31, 33, 34, 35, 36, 37], "otherwis": [0, 1, 4, 7, 13, 25, 27, 32, 35, 37, 38, 40], "ouput": [5, 7, 12, 36, 37, 41], "our": [1, 2, 3, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 19, 21, 24, 25, 29, 35, 36, 39], "ourmodel": 0, "ourselv": [0, 5, 6, 8, 11, 13, 32, 33, 34, 36], "out": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 21, 22, 24, 25, 26, 27, 29, 32, 33, 35, 36, 37, 38, 39, 40, 41], "out_deriv": [40, 41], "out_fil": 9, "outcom": [0, 7, 9, 10, 12, 23, 29, 33, 37, 38], "outdoor": 9, "outer": [6, 12, 13], "outfil": 4, "outlier": [0, 8, 32, 33, 35], "outlin": [6, 10, 11, 36, 37], "outlook": 9, "outperform": [10, 35], "output": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 19, 21, 22, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38], "output_bia": [1, 40], "output_bias_gradi": [1, 39, 40], "output_func": [40, 41], "output_nod": [40, 41], "output_shap": 4, "output_weight": [1, 40], "output_weights_gradi": [1, 39, 40], "outputlayer1": [12, 38], "outputlayer2": [12, 38], "outsid": [4, 22], "over": [0, 1, 3, 4, 5, 6, 9, 10, 12, 13, 15, 16, 19, 22, 23, 25, 26, 32, 33, 34, 35, 36, 37, 41], "over1": 13, "overal": [1, 10, 35, 40], "overcast": 9, "overcom": [12, 13, 38, 39], "overdetermin": [0, 32], "overfit": [0, 1, 3, 6, 9, 10, 13, 27, 35, 36, 37, 40, 41], "overflow": [5, 35, 36], "overflowerror": [40, 41], "overhead": [12, 39, 40], "overlap": [3, 7, 8, 9, 38], "overleaf": [20, 26, 27], "overlin": [0, 5, 6, 9, 10, 11, 14, 25, 32, 33, 35], "overshoot": 35, "overst": 0, "overtrain": 4, "overview": [3, 20], "overwritten": [40, 41], "own": [4, 5, 6, 8, 12, 13, 16, 18, 22, 23, 24, 25, 34, 35, 36, 39, 40], "owner": [], "ownmsepredict": 0, "ownmsetrain": 0, "ownridgebeta": 33, "ownridgetheta": [0, 6, 33, 34, 35], "ownypredictridg": 0, "ownytilderidg": 0, "ox": [], "oxid": [], "p": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 23, 25, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41], "p0": [2, 41], "p1": [2, 41], "p_": [2, 4, 8, 9, 41], "p_hidden": [2, 41], "p_i": [5, 29], "p_j": 29, "p_n": 29, "p_output": [2, 41], "p_x": 29, "pa": 39, "pack": [0, 32], "packag": [0, 1, 3, 4, 5, 8, 11, 13, 15, 20, 22, 24, 26, 27, 29, 33, 34, 35, 40, 41], "packtpub": 32, "packtpublish": 32, "pad": [3, 4], "page": [0, 24, 26, 27, 32, 34, 35, 36, 37], "pai": [0, 1, 9, 13, 15, 35, 40], "pair": [0, 2, 3, 9, 24, 29, 32, 41], "paltform": 15, "panda": [0, 4, 5, 6, 7, 9, 11, 24, 26, 34, 35, 36, 37, 38], "pandoc": [], "panel": 32, "paper": [1, 35, 41], "paper_fil": 35, "paradigm": [0, 32], "paragraph": 20, "parallel": [10, 13, 24, 25, 32], "param": [2, 41], "paramat": [2, 41], "paramet": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 16, 17, 18, 19, 21, 22, 26, 27, 29, 34, 35, 36, 41], "parameter": [0, 6, 10, 32, 33], "parametr": [0, 6, 32, 33, 36, 37], "paramt": [3, 5, 36, 39], "parent": 39, "parser": 27, "part": [0, 1, 3, 5, 6, 10, 17, 19, 20, 21, 22, 25, 28, 29, 30, 32, 33, 36], "partial": [0, 1, 5, 6, 7, 8, 10, 11, 12, 13, 16, 21, 29, 32, 33, 34, 35, 37, 38, 39, 40], "particip": [15, 24, 28, 30, 32], "particl": [0, 4, 13, 29, 32], "particular": [0, 1, 2, 3, 5, 6, 9, 10, 11, 12, 13, 16, 26, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "particularli": [5, 6, 8, 11, 13, 29, 33, 34, 35, 36, 37], "partit": [1, 4, 9, 40], "partli": [6, 32], "partner": [15, 26, 27], "pass": [2, 3, 12, 14, 21, 35, 39, 41], "password": [26, 27], "past": [10, 29, 35], "patch": [6, 29, 36], "path": [0, 4, 6, 7, 9, 24, 32, 35, 36, 37], "pathcollect": 17, "patholog": [], "patient": [7, 37, 38], "patter": 4, "pattern": [0, 3, 4, 12, 31, 32, 35, 38, 39], "paul": [], "pauli": [0, 32], "pav": [], "pc": [11, 15, 24], "pca": [0, 7, 24, 32, 33, 38], "pd": [0, 4, 5, 6, 7, 9, 11, 32, 33, 34, 35, 36, 37, 38], "pde": [2, 41], "pdf": [0, 3, 4, 5, 6, 9, 15, 16, 19, 20, 26, 27, 31, 32, 36, 41], "pedagog": [0, 32, 33], "penal": [6, 18, 33, 35], "penalti": [6, 13, 18, 26, 33, 35], "penros": [5, 6], "pentagon": [13, 34], "peopl": [1, 9, 13, 24, 26, 27, 35, 40], "per": [0, 1, 6, 21, 23, 27, 28, 30, 32, 35, 36, 37, 38, 40], "perc_print": [40, 41], "percent": 23, "percentag": [10, 11, 30, 40, 41], "perceptron": [0, 1, 7, 32, 37], "peregrin": 32, "perez": [], "perfect": [0, 1, 13, 23, 32, 35, 40], "perfectli": [4, 6, 36, 37], "perform": [0, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 14, 16, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 41], "performac": 4, "perhap": [0, 5, 13, 32, 33, 34, 35], "perimet": 1, "period": [1, 4, 29, 40], "permiss": 15, "permit": [], "permut": 11, "persist": 13, "person": [5, 6, 7, 16, 20, 28, 30, 32, 33, 37], "perspect": 31, "pertin": [12, 27, 32, 39, 40, 41], "petal": [8, 9], "peter": [31, 33], "petersen": [39, 40], "phantom": 29, "phase": [6, 12, 38, 39], "phd": 41, "phenomena": 29, "phenomenon": 35, "phi": 8, "phi_k": 8, "philipp": [39, 40], "philosophi": 13, "phone": [30, 32], "photo": [4, 32], "php": [26, 27], "phrase": [0, 32], "physic": [0, 1, 4, 7, 12, 13, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "pi": [2, 3, 5, 6, 7, 9, 12, 13, 29, 36, 37, 38, 40, 41], "pick": [1, 9, 10, 11, 13, 14, 26, 27, 35, 40], "pickl": 1, "pictur": [0, 32], "pie": [24, 32], "piec": [11, 14, 21], "pierr": [], "pillow": [0, 24, 26, 32], "pinv": [5, 6, 13, 26, 33, 34, 35, 38], "pip": [0, 1, 15, 24, 26, 32, 40, 41], "pip3": [0, 1, 26, 32, 40, 41], "pipelin": [0, 6, 8, 10, 33, 36, 37], "pippin": 32, "pit": 4, "pitfal": [6, 33], "pitt": [12, 38, 39], "pixel": [1, 3, 4, 27, 32, 40, 41], "pixel_height": [1, 3, 40, 41], "pixel_width": [1, 3, 40, 41], "pkg_resourc": [], "pkgutil": [], "place": [0, 4, 6, 8, 13, 15, 25, 26, 32, 34, 36], "plai": [0, 3, 4, 5, 6, 8, 11, 18, 22, 24, 26, 32, 33, 34, 36, 37, 39, 40], "plain": [8, 10, 12, 13, 14, 26, 27, 34, 35, 39, 40], "plan": [6, 9, 30, 31, 32, 40], "plane": [8, 9], "plateau": [5, 34, 35], "platform": [24, 32], "plausibl": [12, 38, 40], "pleas": [13, 26, 27, 30, 32], "plenti": [1, 40], "plethora": [3, 12, 38, 39], "pliahhy2ibx9hdharr6b7xevztgzra1p": [38, 39, 40], "plot": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 20, 21, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 38, 40, 41], "plot_all_sc": [26, 33], "plot_confusion_matrix": [7, 10, 23, 38], "plot_count": 6, "plot_cumulative_gain": [7, 10, 23, 38], "plot_data": 1, "plot_dataset": 8, "plot_decision_boundari": [9, 10], "plot_import": 10, "plot_iris_dataset": 21, "plot_max": 4, "plot_min": 4, "plot_model": 4, "plot_numb": 4, "plot_predict": 8, "plot_regression_predict": 9, "plot_result": 4, "plot_roc": [7, 10, 23, 38], "plot_surfac": [2, 6, 13, 41], "plot_train": 9, "plot_tre": [9, 10], "plqvvvaa0qudcjd5baw2dxe6of2tius3v3": [38, 39, 40], "plt": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 19, 21, 22, 23, 25, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41], "plu": [0, 3, 5, 7, 18, 32, 33, 37], "plugin": [], "pm": [8, 36], "pmatrix": [2, 41], "pml": 31, "pn": 3, "png": [0, 4, 6, 7, 9, 32, 36, 37], "point": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13, 14, 18, 19, 20, 23, 25, 26, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41], "point_1": 4, "point_2": 4, "poisson": [24, 29, 32], "poli": [6, 8, 36, 37], "poly100_kernel_svm_clf": 8, "poly3": 0, "poly3_plot": 0, "poly_degre": [40, 41], "poly_featur": [8, 9, 15], "poly_features10": 9, "poly_fit": 9, "poly_fit10": 9, "poly_kernel_svm_clf": 8, "poly_model": 15, "poly_ms": 15, "poly_predict": 15, "polydegre": [0, 5, 6, 10, 33, 36, 37], "polygon": [13, 34], "polym": [12, 38, 39], "polymi": 26, "polynomi": [0, 5, 6, 7, 8, 9, 10, 11, 15, 17, 19, 20, 26, 27, 32, 33, 35, 36, 37, 38, 39], "polynomial_featur": [6, 15, 16, 17, 36, 37], "polynomial_svm_clf": 8, "polynomialfeatur": [0, 6, 8, 9, 15, 16, 19, 33, 36, 37], "polytrop": [0, 6, 36, 37], "pool": 3, "pool_siz": 3, "poor": [1, 13, 34, 35, 40], "poorli": [0, 33], "popul": [0, 5, 23, 32, 33], "popular": [0, 1, 3, 6, 7, 8, 9, 11, 12, 15, 24, 25, 26, 29, 33, 37, 38, 40], "popularli": [0, 32], "portabl": 10, "portion": [11, 13, 35], "pose": [0, 4, 5, 6, 11, 29, 32, 36], "posit": [0, 1, 2, 3, 5, 7, 8, 10, 11, 13, 14, 21, 23, 25, 29, 32, 33, 34, 35, 37, 38, 40, 41], "possibl": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 21, 24, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40], "possibli": [6, 8, 13, 26], "post": [], "posterior": 5, "postpon": [0, 33], "postscript": [26, 27], "postul": 5, "potenti": [0, 3, 5, 6, 12, 13, 33, 35, 36, 38, 39], "pott": [12, 38, 39], "power": [0, 1, 5, 6, 8, 9, 12, 13, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "pp": [5, 6, 19, 36, 39, 40], "pr": 23, "practic": [0, 5, 6, 7, 8, 16, 18, 19, 21, 23, 26, 27, 29, 33, 36, 37, 38], "practition": [0, 1, 3, 32, 35, 40, 41], "pre": 32, "preambl": [], "precalcul": 39, "preced": [1, 11, 12, 29, 38, 40], "preceed": [4, 40, 41], "preceq": 8, "precis": [0, 2, 5, 11, 13, 25, 26, 27, 29, 32, 33, 35, 36, 39, 41], "pred": [6, 23, 36, 37, 38], "pred_train": [40, 41], "pred_val": [40, 41], "predicit": 0, "prediciton": [40, 41], "predict": [0, 1, 5, 6, 7, 8, 9, 10, 15, 16, 17, 19, 22, 23, 24, 26, 27, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41], "predict_prob": [1, 37, 38, 40], "predict_proba": [7, 10, 23, 38], "predictedlabel": [37, 38], "predictor": [0, 5, 6, 7, 9, 10, 11, 32, 33, 35], "prefer": [0, 1, 6, 8, 9, 11, 13, 15, 20, 23, 24, 26, 27, 32, 40], "prefil": [], "prepar": [0, 6, 25, 26, 27, 32, 33], "preprocess": [0, 4, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 23, 26, 36, 37, 38, 40, 41], "prerequisit": 0, "prescript": [26, 27], "presenc": 13, "present": [0, 5, 6, 7, 9, 12, 13, 25, 26, 27, 29, 32, 33, 34, 35, 38, 39, 40, 41], "preserv": [3, 11, 25], "press": [13, 15, 31, 34, 39, 40], "pretrain": [1, 4, 40], "pretti": [0, 4, 8, 9, 21, 24, 26, 32], "prettier": [], "prev_centroid": 14, "prevent": [13, 29, 35], "previou": [0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 15, 16, 21, 22, 25, 26, 27, 29, 33, 34, 35, 38, 39, 40, 41], "previous": [2, 3, 9, 10, 29, 41], "price": [0, 4, 9, 13, 35], "primal": 8, "primari": [0, 7, 32, 37, 38], "prime": 29, "princip": [0, 5, 7, 24, 32, 33, 34, 38], "principl": [0, 6, 7, 8, 14, 32, 36, 37, 38], "print": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 18, 21, 22, 23, 25, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "print_funct": [8, 9], "print_length": [40, 41], "printout": [0, 32], "prior": [0, 5, 6, 32], "privat": 0, "pro": 27, "prob": [1, 29, 37, 38], "probabilist": [0, 23, 31, 32, 33], "probabl": [0, 1, 3, 4, 6, 7, 10, 13, 21, 23, 24, 32, 33, 35, 37, 38, 40, 41], "problem": [0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 17, 23, 24, 25, 26, 27, 29, 36], "probml": 31, "proce": [0, 5, 6, 7, 8, 9, 10, 11, 13, 25, 32, 33, 36, 39], "procedur": [2, 4, 5, 6, 8, 10, 11, 13, 33, 34, 35, 36, 37, 41], "proceed": 25, "process": [0, 2, 4, 6, 9, 10, 12, 13, 24, 25, 26, 29, 31, 32, 34, 35, 36, 37, 38, 39], "procur": [], "prod": 31, "prod_": [1, 5, 7, 36, 37, 38, 40], "produc": [0, 3, 4, 5, 6, 9, 10, 11, 12, 13, 18, 20, 24, 25, 26, 27, 29, 32, 33, 36, 38, 39], "product": [0, 1, 3, 5, 6, 7, 8, 12, 13, 16, 17, 24, 25, 32, 33, 35, 36, 37, 38, 39, 40], "profess": [0, 32], "profit": [], "progag": 27, "program": [0, 1, 4, 5, 6, 8, 12, 14, 15, 24, 25, 28, 29, 30, 32, 33, 38, 40], "programm": 25, "progress": [1, 4, 14, 35, 37, 38, 40, 41], "prohibit": [6, 36, 37], "project": [0, 1, 2, 3, 5, 11, 13, 15, 19, 22, 23, 24, 28, 33, 34, 35, 36, 37, 38, 40, 41], "project_root_dir": [0, 6, 7, 9, 32, 36, 37], "promin": [12, 38, 39], "promis": 8, "promot": [30, 32], "prompt": 20, "prone": [9, 15, 21, 39], "pronounc": [13, 24, 32, 35], "proof": [0, 11, 12, 13, 32, 34, 36, 37, 39], "prop": [27, 35, 40, 41], "prop_cycl": [], "propag": [2, 3, 13, 21, 22, 27, 35], "proper": [0, 2, 6, 7, 20, 36, 37, 41], "properli": [1, 6, 8, 10, 13, 18, 20, 26, 27, 35, 40], "properti": [0, 1, 3, 12, 13, 16, 25, 32, 36, 38, 40, 41], "propgag": 39, "proport": [0, 1, 5, 9, 11, 13, 29, 32, 33, 40], "propos": [1, 4, 6, 10, 26, 27, 32, 35, 40], "propto": [5, 13, 34, 35], "proton": [0, 32], "prove": [3, 13, 34, 35], "provid": [0, 1, 3, 4, 5, 6, 8, 9, 10, 12, 13, 20, 21, 22, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 39, 40], "proxi": [1, 13, 35, 40], "prune": 9, "pseudo": [25, 29, 35], "pseudocod": [26, 27], "pseudoinv": 5, "pseudoinvers": [5, 6, 26], "pseudorandom": [6, 29, 36], "psychologi": [0, 32], "pt": 13, "public": [0, 15, 24, 32], "publish": [39, 40], "pull": 15, "punish": [0, 1, 32, 40, 41], "pure": [3, 9, 29], "purest": 9, "puriti": 9, "purpos": [0, 3, 10, 12, 14, 21, 32, 38, 39], "push": 15, "put": [1, 20, 26, 27, 35], "putmask": [], "py": 5, "pybtex": [], "pycod": 32, "pydata": 24, "pydevd_extension_api": [], "pydevd_plugin": [], "pydevd_plugin_plugin_nam": [], "pydot": 9, "pygment": [], "pyhton2": 32, "pylab": [7, 32, 37], "pypi": 24, "pyplot": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 19, 21, 22, 23, 25, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41], "pythagora": 5, "python": [1, 2, 3, 5, 6, 8, 11, 12, 13, 14, 18, 20, 21, 22, 26, 27, 29, 33, 35, 39, 40, 41], "python2": [0, 26], "python3": [0, 24, 26, 32], "pythonpath": [], "pytorch": [0, 24, 26, 27, 32, 39, 40], "pyzmq": [], "q": [5, 6, 8, 11, 29, 36, 40, 41], "qp": 8, "qquad": [2, 11, 13, 23, 25, 35, 41], "qr": [5, 6, 25, 33, 34], "quad": [1, 13, 23, 25, 40], "quadrat": [0, 8, 9, 13, 32], "qualit": [4, 9, 26, 27, 29], "qualiti": [0, 9, 24, 32, 33, 39], "quantifi": [1, 23, 40], "quantil": 10, "quantit": [0, 6, 9, 26, 27, 32, 36, 37], "quantiti": [0, 2, 5, 6, 7, 9, 10, 11, 12, 14, 16, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "quantum": [4, 12, 31, 32, 38, 39], "quartil": [0, 33, 35], "quasi": 39, "quench": 5, "queri": 9, "question": [0, 5, 6, 9, 11, 12, 13, 26, 27, 30, 32, 33, 35, 36, 39, 40], "qugan": 4, "quick": [4, 29], "quicker": 35, "quickli": [1, 3, 9, 11, 13, 34, 35, 40, 41], "quit": [1, 5, 6, 9, 10, 12, 15, 22, 33, 34, 36, 37, 38, 40, 41], "quot": 4, "r": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 24, 25, 26, 29, 33, 34, 35, 36, 37, 38, 39, 40, 41], "r2": [0, 5, 6, 19, 32, 33, 34], "r2_score": [0, 32], "r2score": [0, 32], "r_": 35, "r_0": 35, "r_1": 9, "r_2": 9, "r_j": 9, "r_m": 9, "r_t": 35, "rad": [], "rade": [], "radial": [8, 12, 38, 39], "radioact": 29, "radiu": [0, 1, 33, 35], "radziej": [], "ragan": [], "rain": 9, "rais": [40, 41], "ram": 35, "ramanujam": [], "ramp": [1, 40], "ran0": 29, "ran1": 29, "ran2": 29, "ran3": 29, "rand": [0, 4, 5, 6, 9, 10, 13, 15, 19, 21, 22, 25, 32, 33, 34, 35, 36, 37, 40, 41], "randint": [6, 9, 13, 35, 36], "randn": [0, 1, 2, 5, 6, 9, 11, 13, 15, 18, 21, 22, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "random": [0, 1, 2, 3, 4, 5, 6, 8, 9, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "random_forest_model": 10, "random_index": [13, 35], "random_indic": [1, 3, 40, 41], "random_st": [7, 8, 9, 10, 11, 23, 27, 37, 38], "randomforestclassifi": 10, "randomli": [1, 6, 9, 13, 14, 18, 34, 35, 36, 37, 40], "randomst": [37, 38], "rang": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 18, 19, 21, 22, 23, 25, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "rangl": [0, 6, 11, 29, 32, 33], "rangle_x": 29, "rank": [5, 33, 34], "rankdir": 4, "raphson": [1, 8, 13, 40], "rapidli": [0, 35], "rare": [1, 13, 23, 35, 40], "raschka": [27, 32, 33, 36, 37, 38], "rasckha": 32, "rashcka": [34, 35, 39, 40, 41], "rashkca": [39, 40], "rate": [1, 2, 3, 4, 8, 9, 10, 12, 13, 18, 23, 27, 34, 36, 37, 38, 39], "rather": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 25, 29, 32, 33, 34, 36, 37, 39, 40, 41], "ratio": [4, 7, 9, 10, 11, 23, 37, 38], "rational": [0, 32], "ravel": [5, 6, 7, 8, 9, 10, 11, 13, 25, 36, 37, 38, 40, 41], "raw": [3, 35], "rbf": [8, 11, 12, 38, 39], "rbf_kernel_svm_clf": 8, "rbf_pca": 11, "rc": 29, "rcond": [0, 32, 33], "rcparam": [1, 3, 7, 8, 9, 10, 29, 32, 37, 40, 41], "re": [2, 4, 13, 15, 34, 41], "reach": [1, 4, 5, 6, 9, 10, 12, 13, 14, 23, 34, 35, 36, 37, 39, 40, 41], "react": [], "read": [0, 2, 3, 4, 5, 6, 7, 8, 11, 12, 16, 17, 19, 20, 25, 26, 27, 29, 31, 34, 41], "read_csv": [0, 6, 7, 9, 36, 37], "read_fwf": [0, 32], "reader": [0, 6, 20, 25, 29, 32, 33, 35], "readi": [0, 1, 5, 6, 8, 10, 11, 12, 25, 32, 39, 40, 41], "readili": [1, 40], "readm": [15, 20, 26, 27], "readthedoc": 24, "real": [0, 1, 4, 7, 10, 11, 12, 16, 18, 19, 25, 33, 36, 37, 38, 40, 41], "real_loss": 4, "real_output": 4, "realist": [8, 32], "realiti": 29, "realiz": [1, 12, 38, 40], "realli": [0, 1, 32, 40, 41], "rearrang": 13, "reason": [0, 1, 3, 4, 10, 13, 31, 32, 34, 35, 40], "reassign": 1, "reat": [40, 41], "reber": [40, 41], "recal": [5, 6, 9, 10, 11, 12, 22, 25, 29, 32, 33, 34, 35, 36, 37, 39, 40], "recarrai": [], "recast": 3, "receiv": [1, 3, 10, 12, 23, 29, 38, 39, 40], "recent": [0, 6, 13, 31, 35, 36, 37, 39, 40], "recept": [3, 12, 38, 39], "receptive_field": 3, "recip": [0, 6, 7, 25, 26, 27, 32, 33, 37, 38], "reciproc": 5, "recogn": [0, 4, 5, 10, 32, 36], "recognit": [0, 1, 3, 12, 31, 32, 38, 39, 40], "recommen": 32, "recommend": [0, 2, 3, 4, 5, 6, 8, 13, 15, 19, 20, 21, 22, 24, 25, 26, 27, 31, 34, 35, 36, 37, 38, 39, 41], "reconsid": 9, "reconstruct": 11, "record": [10, 26, 27, 28, 30, 32, 37, 38], "recreat": [15, 21], "rectangl": [9, 13, 34], "rectangular": [5, 33, 34], "rectifi": [1, 3, 12, 38, 40], "recur": [0, 24, 32], "recurr": [0, 1, 24, 32, 40], "recurs": [9, 24, 25, 32], "red": [0, 3, 4, 6, 8, 9, 35, 36], "redefin": [0, 10, 32, 33, 34], "redefinit": 34, "redistribut": [], "reduc": [1, 3, 5, 6, 9, 10, 11, 13, 21, 32, 34, 35, 36, 40], "reduct": [0, 10, 11, 24, 29, 32, 33], "redund": 23, "reegress": 26, "ref": 20, "refer": [0, 1, 2, 3, 5, 6, 11, 12, 13, 14, 20, 25, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "referansestil": 20, "referenc": [2, 39, 40, 41], "refin": [12, 38, 39], "refit": [6, 36, 37], "reflect": [0, 1, 4, 5, 26, 27, 29, 32, 40, 41], "refresh": [24, 32], "refreshprogrammingskil": 32, "reg": [10, 11], "regard": [1, 9, 13, 40], "regardless": [12, 16, 23, 38, 40], "regexp": [], "reggi": [], "regim": 35, "region": [3, 4, 6, 9, 12, 26, 35, 38, 39], "regist": [6, 29], "reglasso": [5, 34], "regr_1": [0, 9], "regr_2": [0, 9], "regr_3": [0, 9], "regress": [1, 8, 11, 12, 16, 20, 23, 24, 25, 39, 40, 41], "regressor": [0, 7, 10, 37, 40, 41], "regret": [], "regridg": [0, 5, 6, 33, 34, 35], "regular": [0, 3, 4, 5, 6, 7, 9, 13, 17, 18, 27, 30, 32, 33, 34, 35, 36, 37, 38, 41], "regularli": 15, "reilli": [0, 31, 32], "reinforc": [0, 8, 24, 32], "reiniti": [40, 41], "reiter": 1, "reitz": [], "reject": 7, "rel": [0, 4, 6, 7, 9, 12, 13, 21, 29, 32, 33, 35, 36, 37, 38, 40], "relat": [0, 1, 3, 4, 5, 11, 13, 14, 19, 23, 25, 29, 32, 33, 34, 36, 39, 40], "relationship": [0, 4, 9, 18, 32], "relativeerror": [0, 32, 33], "releas": [1, 24, 32, 40, 41], "relev": [0, 1, 5, 7, 11, 24, 26, 27, 29, 32, 34, 35], "reli": [0, 6, 8, 35], "reliabilti": [26, 27], "reliabl": [7, 29, 37, 38], "relu": [3, 4, 21, 22, 27, 32], "relu_d": 22, "remain": [1, 2, 4, 6, 12, 23, 25, 29, 33, 35, 36, 37, 38, 39, 40, 41], "remaind": 29, "reman": [2, 41], "remark": [1, 40], "rememb": [0, 8, 13, 20, 21, 22, 25, 26, 27, 32, 35], "remind": [0, 5, 11, 13, 19, 25, 29, 36, 41], "remot": 15, "remov": [4, 5, 6, 18, 33, 34, 35], "renam": 15, "render": [0, 32, 33], "reorder": [5, 7, 33, 34, 37, 38], "reorgan": [0, 32], "repeat": [0, 1, 3, 4, 5, 6, 9, 10, 11, 13, 14, 25, 26, 29, 32, 33, 34, 35, 36, 37, 39, 40], "repeated": 32, "repeatedli": [0, 6, 10, 13, 36, 37], "repet": 3, "repetit": [6, 32, 33, 36, 37], "rephras": [13, 34], "replac": [0, 1, 3, 4, 5, 6, 10, 12, 14, 23, 24, 26, 32, 33, 34, 36, 37, 39, 40], "replica": [6, 36], "repo": [15, 26, 27], "report": [32, 35, 37, 38], "repositori": [4, 20, 26, 27, 32], "reposotori": [], "repres": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "represent": [0, 1, 3, 6, 29, 32, 36, 37, 40, 41], "representd": 3, "reproduc": [0, 5, 6, 9, 12, 15, 16, 18, 20, 24, 26, 27, 29, 32, 33, 39, 40, 41], "repuls": [0, 32], "request": [0, 13, 35], "requir": [0, 1, 3, 4, 5, 6, 8, 9, 11, 12, 13, 15, 17, 18, 19, 20, 25, 26, 32, 33, 34, 35, 36, 37, 38, 39, 40], "rerun": [40, 41], "res1": [2, 41], "res2": [2, 41], "res3": [2, 41], "res_analyt": [2, 41], "res_analytical1": [2, 41], "res_analytical2": [2, 41], "res_analytical3": [2, 41], "resaml": 6, "resampl": [0, 7, 10, 24, 32, 33, 40, 41], "rescal": [0, 11, 12, 35, 38], "rescu": 5, "reseach": 6, "research": [0, 4, 13, 21, 22, 24, 27, 31, 32, 35], "researchg": 27, "resembl": [6, 29, 36], "reserv": [1, 5, 6, 29, 36, 37, 40], "reset": [40, 41], "reset_weight": [40, 41], "reshap": [0, 1, 2, 3, 4, 6, 8, 9, 10, 25, 32, 33, 36, 37, 40, 41], "resid": 35, "residenti": [], "residu": [0, 5, 13, 32], "resiz": [5, 33, 34], "resnet": 35, "resort": 35, "resourc": [32, 35], "respect": [0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 21, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "respond": [12, 38, 39], "respons": [0, 7, 9, 12, 32, 33, 37, 38, 39], "rest": [0, 5, 18, 21, 22, 23, 33, 34, 35], "restat": [0, 12, 32], "restor": 4, "restored_discrimin": 4, "restored_gener": 4, "restrict": [0, 3, 9, 12, 32, 38, 39, 40, 41], "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 32, 35, 36, 37, 38, 41], "retail": [], "retain": [5, 6, 33, 34, 35, 36, 37], "rethink": 36, "return": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 16, 17, 21, 22, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "return_data": 14, "return_sequ": 4, "return_x_i": 9, "reus": [1, 3, 6, 19, 20, 22, 26, 27, 39, 40], "reveal": [0, 12, 32, 38, 39], "revers": [1, 22, 25, 40, 41], "review": [24, 25], "revis": [], "revisit": 14, "revolut": 32, "reward": [0, 4, 32], "rewrit": [0, 3, 5, 6, 7, 8, 10, 11, 12, 13, 16, 19, 25, 26, 29, 34, 35, 37, 38, 39, 40], "rewritten": [2, 6, 8, 10, 29, 36, 41], "rewrot": [13, 37, 38], "rf": 10, "rgb": 3, "rgoj5yh7evk": 24, "rh": [6, 36], "rho": [0, 10, 13, 35, 40, 41], "rho2": [40, 41], "rho_1": 10, "rho_2": 10, "rho_m": 10, "rich": [0, 32], "rid": [], "ride": 9, "rideclass": 9, "ridedata": 9, "ridg": [7, 11, 13, 20, 24, 27, 32, 36, 37, 38], "ridge_paramet": 17, "ridge_sk": 6, "ridgebeta": 34, "ridgetheta": 5, "right": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, 17, 19, 21, 22, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "right_sid": [2, 41], "rightarrow": [0, 1, 5, 6, 8, 11, 12, 13, 29, 32, 33, 34, 35, 36, 38, 39, 40], "rigor": [0, 23, 32, 33, 34], "ring": 6, "rise": [0, 32], "risk": [0, 13, 32, 34, 35], "rival": 4, "river": [], "rlm": 32, "rm": [27, 29, 35, 40, 41], "rms_prop": [40, 41], "rmse": [], "rmsporp": [13, 35], "rmsprop": [1, 3, 4, 13, 26, 27, 36, 39, 40, 41], "rnd_clf": 10, "rng": [29, 37, 38], "rnn": [4, 12, 38, 39], "rnn1": 4, "rnn2": 4, "rnn_2layer": 4, "rnn_input": 4, "rnn_output": 4, "rnn_train": 4, "rntrick1": 29, "rntrick2": 29, "rntrick3": 29, "rntrick4": 29, "ro": [0, 13, 32, 34, 35], "robert": [19, 26, 31], "robust": [0, 32, 35], "robustscal": [0, 33, 35], "roc": [7, 10], "role": [0, 2, 5, 6, 8, 18, 24, 26, 32, 33, 34, 35, 36, 37, 39, 40, 41], "roll": 6, "ronach": [], "room": [0, 30, 32], "root": [0, 5, 9, 13, 15, 29, 33, 34, 35, 39, 41], "root_directori": [], "rot": 32, "rotat": [1, 8, 9, 10], "rotation_matrix": 9, "roughli": [1, 3, 18, 40], "round": [7, 9, 13, 38, 40, 41], "routin": [13, 25, 32, 34], "row": [0, 1, 2, 5, 6, 9, 11, 16, 21, 25, 32, 33, 34, 36, 40, 41], "rr": [5, 33, 34], "rrr": [5, 33, 34], "rubric": [], "rudg": [], "rug": [13, 34, 35], "rule": [0, 1, 5, 6, 13, 22, 26, 32, 33, 34, 38, 41], "run": [0, 1, 2, 4, 5, 6, 8, 9, 11, 13, 15, 20, 21, 22, 24, 26, 27, 32, 33, 34, 35, 36, 37, 40, 41], "rung": 27, "running_loss": 41, "runtim": [1, 6, 14, 15, 40, 41], "rust": [0, 24, 25, 32], "rvert": [1, 40], "rvert_2": [1, 40], "s41467": 27, "s_": [3, 6], "s_1": 6, "s_i": [6, 7, 37], "s_j": 6, "s_k": 6, "s_phenomenon": 26, "saddl": [13, 34, 35], "safeguard": [18, 35], "saga": 27, "sai": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 19, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "said": [6, 9, 13, 34], "sake": [0, 5, 7, 11, 32, 33, 34, 37, 38, 39, 40], "sale": [0, 32], "sam": 32, "same": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 14, 15, 16, 18, 20, 21, 22, 25, 26, 27, 29, 32, 33, 34, 38, 39, 40, 41], "samm": 10, "sampl": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 18, 19, 23, 24, 25, 26, 29, 32, 33, 35, 36, 37, 38, 40, 41], "sample_vari": 14, "sampleexptvari": 29, "samples_per_class": [37, 38], "samwis": 32, "sandbox": [], "sandboxmod": [21, 22], "sasha": [], "sastri": 11, "satisfactori": [0, 32], "satisfi": [1, 2, 3, 6, 8, 13, 25, 29, 34, 36, 40, 41], "satur": [1, 6, 36, 37, 40], "save": [0, 4, 6, 7, 9, 13, 20, 22, 32, 35, 36, 37], "save_fig": [0, 6, 7, 9, 10, 32, 36, 37], "savefig": [0, 4, 6, 7, 9, 29, 32, 36, 37], "savetxt": 4, "saw": [5, 33], "scalabl": 10, "scalar": [2, 5, 6, 10, 33, 36, 39, 40, 41], "scale": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 22, 24, 25, 26, 27, 30, 32, 34, 37, 38, 40, 41], "scale_mean": 4, "scale_std": 4, "scaler": [0, 7, 8, 9, 10, 11, 17, 26, 33, 40, 41], "scan": [5, 7, 37, 38], "scari": 5, "scatter": [0, 1, 6, 7, 8, 9, 14, 15, 17, 21, 32, 33, 35, 36, 37], "scenario": [6, 13, 34, 35], "schedul": [13, 35], "scheduler_arg": [40, 41], "schedulers_bia": [40, 41], "schedulers_weight": [40, 41], "scheme": [1, 13, 34, 35, 37, 38, 40], "schrage": 29, "sch\u00f8yen": [6, 33, 35], "scienc": [0, 1, 10, 12, 13, 24, 28, 29, 30, 31, 34, 36, 37, 38, 39, 40], "scientif": [0, 20, 24, 26, 27, 32, 37, 38, 41], "scientist": [0, 32], "scikit": [3, 5, 6, 8, 9, 10, 13, 15, 16, 20, 21, 23, 24, 25, 26, 27, 31, 41], "scikit_learn": [0, 38], "scikitlearn": 32, "scikitplot": [7, 10, 23, 38], "scipi": [0, 3, 5, 6, 13, 24, 25, 26, 32, 33, 34, 36], "scl": 6, "scm": 15, "score": [0, 1, 3, 6, 7, 9, 10, 11, 15, 16, 19, 21, 23, 26, 27, 30, 32, 33, 35, 36, 37, 38, 40, 41], "scores_kfold": [6, 36, 37], "scratch": [1, 13, 16, 38, 39, 40], "script": [], "sdg": [13, 35], "sdv4f4s2sb8": [34, 35], "seaborn": [0, 1, 3, 6, 7, 27, 32, 38, 40, 41], "seamless": [0, 24, 26, 32], "seamlessli": [40, 41], "search": [0, 1, 3, 5, 9, 13, 15, 32, 34, 35, 40, 41], "sebastian": [32, 39, 40], "sebastianraschka": [27, 32], "sec": 6, "second": [0, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 14, 15, 16, 20, 21, 22, 24, 25, 29, 30, 32, 33, 34, 36, 37, 38, 39, 40, 41], "second_correct": [40, 41], "second_mo": 35, "second_term": 35, "secondari": 35, "secondeigvector": 11, "secondli": [12, 39, 40, 41], "section": [4, 11, 16, 20, 25, 26, 29, 33, 35, 37], "sector": 0, "see": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "seed": [0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 18, 20, 21, 26, 27, 29, 32, 33, 34, 35, 36, 37, 39, 40, 41], "seed_imag": 4, "seek": [1, 2, 8, 40, 41], "seem": [1, 3, 4, 35, 40, 41], "seemingli": [0, 32], "seen": [0, 1, 3, 5, 10, 12, 29, 40], "segment": [13, 34, 40, 41], "seismic": 6, "seldomli": [0, 32], "select": [1, 5, 6, 8, 9, 10, 11, 15, 20, 23, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 40], "selevet": 15, "self": [1, 5, 22, 33, 37, 38, 40, 41], "sell": 4, "semest": [7, 28, 38], "semi": [8, 13, 34, 35], "semilogx": 6, "send": [5, 12, 13, 21, 22, 30, 32, 38, 39], "senior": [28, 30], "sens": [0, 4, 6, 8, 21, 32, 36], "sensibl": [3, 21], "sensit": [0, 5, 6, 9, 13, 23, 32, 33, 35, 36, 37], "sent": [2, 21, 39, 40, 41], "sentdex": [38, 39, 40], "sentenc": [4, 12, 38, 39], "separ": [0, 1, 2, 4, 6, 8, 9, 12, 14, 18, 21, 22, 23, 24, 26, 29, 32, 35, 36, 38, 39, 40, 41], "septemb": [18, 26, 32], "sequenc": [3, 4, 7, 9, 10, 12, 13, 24, 25, 29, 32, 34, 37, 38, 39], "sequenti": [1, 3, 4, 10, 12, 29, 38, 39, 40, 41], "seri": [0, 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 25, 32, 33, 34, 36, 38, 39, 40, 41], "serif": [7, 29, 32, 37], "serv": [0, 1, 2, 3, 5, 7, 13, 27, 31, 32, 33, 34, 35, 37, 38, 40, 41], "servic": [26, 27], "session": [1, 15, 20, 26, 27, 28, 30, 32], "set": [1, 4, 5, 6, 7, 8, 10, 11, 13, 14, 16, 17, 18, 21, 22, 23, 24, 25, 26, 27, 29, 30, 35, 36, 37, 38], "set_major_formatt": 6, "set_major_loc": 6, "set_tick": [1, 8], "set_ticklabel": 1, "set_titl": [0, 1, 2, 3, 7, 12, 14, 32, 37, 38, 40, 41], "set_xlabel": [0, 1, 2, 3, 7, 12, 32, 37, 38, 40, 41], "set_xlim": [7, 12, 37, 38, 40], "set_xticklabel": 1, "set_ylabel": [0, 1, 2, 3, 7, 32, 38, 40, 41], "set_ylim": [7, 12, 37, 38, 40], "set_ytick": [7, 38], "set_yticklabel": [1, 6], "set_zlim": 6, "seth": 4, "setminu": 6, "setosa": [8, 9], "setosa_or_versicolor": 8, "setp": [6, 36, 37], "setup": [1, 4, 6, 8, 22, 24, 27, 32, 33, 34, 39, 40], "sever": [0, 3, 5, 6, 7, 8, 9, 11, 12, 13, 16, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39], "sgd": [1, 3, 34, 40, 41], "sgd_clf": 8, "sgdclassifi": 8, "sgdreg": 13, "sgdregressor": 13, "sgn": [5, 33, 34], "shall": [], "shallow": [13, 35], "shape": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 18, 21, 22, 23, 25, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "share": [1, 3, 15, 32, 40, 41], "share_mask": [], "shareabl": 15, "she": [7, 37, 38], "sheppard": [], "shibukawa": [], "shift": [1, 6, 12, 15, 18, 29, 33, 35, 38, 40], "ship": 3, "shire": 32, "short": [4, 5, 20, 26, 27, 40, 41], "shortcom": [13, 34, 35], "shorten": 4, "shorter": 29, "shorthand": [32, 36], "shortli": [25, 32], "should": [0, 2, 3, 5, 6, 8, 9, 11, 12, 15, 18, 19, 20, 21, 22, 25, 26, 29, 32, 33, 35, 36, 37, 39], "shouldn": [], "show": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "show_shap": 4, "shown": [0, 4, 5, 8, 12, 13, 23, 25, 33, 34, 35, 38, 39, 40, 41], "shrink": [3, 5, 6, 8, 11, 33, 34, 35], "shrinkag": [5, 6, 33, 34], "shrunk": 11, "shuffl": [0, 1, 4, 6, 13, 33, 35, 36, 37, 40, 41], "sickit": [39, 40], "side": [0, 2, 5, 8, 12, 13, 25, 26, 27, 32, 34, 37, 38, 40, 41], "sigh": [24, 32], "sigma": [0, 1, 5, 6, 7, 10, 11, 12, 13, 19, 25, 26, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "sigma0": 29, "sigma1": 29, "sigma2": 29, "sigma_": [5, 25, 32, 33, 34, 36], "sigma_0": [5, 33, 34], "sigma_1": [5, 33, 34, 39, 40], "sigma_2": [5, 33, 34, 39, 40], "sigma_fn": [7, 12, 37, 38, 40], "sigma_i": [0, 5, 32, 33, 34], "sigma_j": [5, 33, 34], "sigma_m": [6, 29, 36], "sigma_n": [11, 29], "sigma_t": 13, "sigma_x": 29, "sigmoid": [1, 2, 4, 7, 8, 10, 12, 21, 22, 27, 37, 38, 39, 41], "sigmoid_autograd": 22, "sigmoid_d": 22, "sigmundson": [6, 33, 35], "sign": [1, 2, 7, 8, 10, 27, 29, 30, 37, 40, 41], "signal": [1, 3, 10, 12, 35, 38, 39, 40], "signifi": 4, "signific": [1, 35, 40], "significantli": [1, 13, 18, 29, 34, 35, 40], "sim": [4, 5, 6, 13, 19, 29, 36], "similar": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 18, 24, 25, 26, 27, 32, 34, 36, 37, 38, 39, 40], "similarli": [0, 1, 3, 5, 8, 10, 13, 29, 32, 33, 34, 35, 39, 40], "similiar": [40, 41], "simpl": [1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 14, 16, 17, 22, 23, 24, 25, 27, 29, 36, 38, 41], "simple_plot": [], "simplefilt": [40, 41], "simplepredict": 10, "simpler": [0, 1, 5, 6, 7, 13, 16, 24, 26, 27, 32, 34, 35, 40, 41], "simplernn": 4, "simplest": [0, 1, 3, 4, 9, 10, 12, 14, 23, 26, 32, 38, 39, 40], "simpletre": 10, "simpli": [0, 1, 2, 4, 5, 6, 8, 9, 10, 11, 12, 24, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "simplic": [2, 5, 6, 7, 8, 9, 10, 11, 12, 14, 33, 34, 35, 37, 38, 39, 40, 41], "simplicti": [5, 33, 34], "simplif": 39, "simplifi": [0, 6, 9, 18, 22, 24, 26, 32, 33, 35, 36, 37, 39], "simplist": [3, 6, 29, 36], "simul": [6, 18, 35, 36, 37], "simultan": [6, 35, 36, 37], "sin": [0, 1, 2, 3, 4, 9, 12, 13, 25, 32, 38, 40, 41], "sinc": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13, 16, 18, 21, 22, 25, 26, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "sine": [3, 12, 38, 40], "singl": [0, 1, 2, 3, 5, 6, 7, 8, 9, 12, 13, 18, 19, 21, 22, 23, 25, 29, 32, 33, 34, 35, 36, 37, 40, 41], "singular": [0, 6, 13, 25, 32, 36], "sinusoid": 3, "site": [0, 26, 27, 28, 33], "situat": [0, 4, 5, 7, 13, 29, 32, 33, 34, 35, 37, 38], "six": [3, 29, 39], "size": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 18, 20, 21, 23, 25, 26, 29, 32, 36, 37, 38, 39, 40, 41], "sizesp": 35, "skeleton": 22, "sketch": 10, "ski": 9, "skill": 0, "skip": 11, "skl": [0, 6, 32, 33, 35], "sklearn": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 17, 19, 20, 21, 22, 23, 27, 32, 33, 34, 35, 36, 37, 38, 40, 41], "skplt": [7, 10, 23, 38], "skrankefunct": [40, 41], "sl": [6, 33, 35], "slack": 8, "slender": [], "slice": [2, 25, 32, 41], "slide": [0, 3, 16, 26, 27, 29, 32, 33, 34, 39, 40, 41], "slight": [6, 13, 36, 37], "slightli": [1, 2, 3, 5, 6, 7, 10, 29, 33, 34, 36, 37, 38, 39, 40, 41], "slope": [8, 11, 12, 38], "slow": [0, 2, 8, 13, 18, 33, 34, 35, 41], "slower": [5, 25, 32, 33, 34, 35], "slowest": 25, "slowli": [12, 35], "slp": [1, 40], "small": [0, 1, 2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 18, 21, 22, 24, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "smaller": [0, 1, 2, 5, 6, 8, 9, 11, 13, 21, 29, 32, 33, 34, 35, 36, 37, 40, 41], "smallest": [0, 4, 14, 32], "smallest_row_index": 14, "smodin": [], "smooth": [0, 3, 6, 13, 26, 32, 34, 35], "smoother": 35, "sn": [0, 1, 3, 6, 7, 32, 38, 40, 41], "sne": 11, "so": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "soar": 6, "social": 0, "soft": [1, 7, 10, 12, 37, 38, 39, 40], "soften": 8, "softmax": [3, 7, 21, 22, 27, 37, 38, 41], "softmax_vec": 21, "softwar": [0, 8, 24, 25, 39], "sokogskriv": 20, "sol": 8, "sol1": 21, "sole": [0, 6, 32], "solid": [0, 7, 37, 38], "solut": [0, 1, 2, 3, 5, 6, 8, 10, 11, 13, 18, 21, 25, 26, 27, 29, 32, 33, 34, 35, 36, 40], "solution_ev": 35, "soluton": [2, 41], "solv": [0, 1, 3, 5, 6, 8, 10, 11, 12, 13, 16, 25, 26, 27, 32, 33, 39, 40], "solve_expdec": [2, 41], "solve_ode_deep_neural_network": [2, 41], "solve_ode_neural_network": [2, 41], "solve_pde_deep_neural_network": [2, 41], "solveod": [2, 41], "solveode_popul": [2, 41], "solver": [2, 7, 8, 9, 10, 23, 25, 27, 32, 38, 41], "some": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 19, 21, 22, 23, 26, 27, 29, 32, 35, 36, 38, 40, 41], "some_model": [6, 33, 35], "somehow": 4, "someon": 16, "someth": [0, 1, 3, 4, 7, 9, 11, 15, 19, 20, 26, 27, 29, 32, 33, 38, 40], "sometim": [0, 1, 11, 12, 13, 14, 19, 33, 35, 38, 39, 40], "somewhat": [27, 38], "soon": [25, 30, 33], "sophist": [0, 32], "sopt": 13, "sort": [5, 6, 9, 11, 23, 29, 36, 37], "sound": [3, 5], "sourc": [0, 1, 3, 6, 24, 25, 26, 27, 29, 32, 35, 36, 37, 40, 41], "source1": 22, "source2": 22, "space": [0, 1, 4, 5, 8, 9, 11, 12, 13, 14, 29, 33, 34, 35, 37, 38, 39, 40], "span": [0, 3, 5, 9, 11, 25, 32, 33, 34], "spare": [1, 40, 41], "spars": [3, 6, 18, 25, 32, 35], "sparse_categorical_crossentropi": 41, "sparse_mtx": [25, 32], "sparsecategoricalcrossentropi": 3, "sparsiti": [10, 18], "spatial": [1, 2, 3, 12, 38, 39, 40, 41], "speak": 29, "special": [6, 7, 10, 12, 13, 23, 25, 29, 32, 33, 34, 35, 37, 38, 39, 40], "specif": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 16, 23, 24, 25, 26, 27, 29, 31, 32, 33, 34, 36, 37, 38, 39, 40], "specifi": [0, 3, 5, 6, 7, 9, 11, 13, 14, 29, 32, 34, 35, 36, 37, 38, 40], "specifici": [0, 10, 32], "spectacular": 3, "spectral": 1, "speech": [0, 1, 3, 4, 12, 38, 39, 40], "speed": [1, 2, 4, 13, 40, 41], "spend": [16, 29, 35], "spent": [26, 27], "sphere": [0, 33, 35], "sphinx": [], "sphinx_book_them": [], "sphinxcontrib": [], "spike": 35, "spin": 6, "spite": 0, "spitzer": [], "spline": 8, "split": [1, 3, 4, 5, 6, 8, 9, 10, 11, 14, 16, 17, 20, 21, 22, 26, 27, 29, 32, 34, 35, 36, 37, 40, 41], "splite": 0, "splitter": [1, 10], "spoiler": [], "spontan": 29, "spot": 3, "spread": [0, 11, 29, 32, 33, 37, 38], "spring": [40, 41], "springer": [19, 26, 31, 32, 36, 37], "spuriou": [13, 35], "sqquar": 34, "sqrsignal": 3, "sqrt": [3, 4, 5, 6, 8, 10, 11, 13, 29, 33, 34, 35, 36, 39, 40, 41], "squar": [1, 2, 3, 4, 7, 8, 9, 11, 13, 14, 15, 17, 18, 24, 25, 27, 29, 36, 37, 38, 39, 40, 41], "squarederror": 10, "squaredeuclidean": 14, "squash": [12, 38, 40], "src": [], "srtm": 6, "srtm_data_norway_1": 6, "sso": 20, "stabil": [5, 26, 27, 35, 37, 38], "stabl": [0, 4, 5, 6, 9, 16, 20, 24, 26, 32, 33, 34, 35], "stack": [3, 4], "stage": [5, 13, 15, 26, 27, 35, 39, 40, 41], "stagnat": 35, "stai": [0, 2, 4, 5, 11, 32, 33, 35, 40, 41], "stand": [0, 5, 9, 12, 32, 33, 34, 38], "standard": [0, 1, 4, 5, 6, 7, 8, 10, 12, 17, 18, 19, 23, 25, 26, 27, 29, 32, 34, 35, 37, 38, 39, 40], "standardscal": [0, 6, 7, 8, 9, 10, 11, 17, 33, 35], "standpoint": 35, "stanford": [13, 34, 41], "start": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 21, 22, 25, 27, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 41], "start_tim": 14, "starter": [], "stat": [6, 36], "state": [1, 2, 4, 5, 6, 7, 8, 10, 11, 12, 13, 24, 29, 32, 33, 34, 36, 37, 38, 39, 40, 41], "statement": [0, 7, 25, 32, 38], "static": [], "stationari": [34, 35], "statist": [0, 1, 3, 4, 7, 9, 10, 11, 12, 13, 14, 19, 25, 26, 31, 33, 34, 35, 38, 39, 40], "statu": [0, 7, 15, 32, 37, 38], "stavang": 6, "stb": [], "std": [0, 4, 6, 18, 32, 33, 35, 36, 37, 41], "stdout": [40, 41], "steep": [13, 23, 34, 35], "steepest": 35, "stefan": [], "step": [0, 1, 2, 4, 6, 7, 9, 10, 11, 12, 13, 14, 15, 18, 22, 25, 26, 32, 34, 38, 39, 40, 41], "step_fn": [7, 12, 37, 38, 40], "step_length": [13, 35], "step_siz": 35, "steps_list": 9, "stereo": 3, "sticki": [], "still": [0, 2, 3, 5, 6, 11, 13, 21, 22, 27, 29, 33, 34, 35, 36, 37, 39, 41], "stimuli": [12, 38, 39], "stk": [31, 32], "stk2100": [31, 32], "stk3155": [15, 26, 27, 28, 30], "stk4021": [31, 32], "stk4051": [31, 32], "stk4155": [28, 30], "stk5000": 31, "stochast": [0, 1, 5, 6, 8, 11, 12, 22, 27, 34, 36, 37, 39, 40], "stock": 4, "stoke": [12, 38, 39], "stone": [0, 7, 37, 38, 39], "stop": [1, 4, 9, 13, 14, 18, 34, 39, 40, 41], "storag": [5, 33, 34], "store": [0, 1, 2, 3, 6, 11, 13, 22, 29, 32, 35, 40, 41], "storehaug": [30, 32], "stori": [], "str": [1, 3, 4, 40, 41], "straight": [0, 6, 8, 13, 32, 34, 36], "straightforward": [0, 2, 3, 5, 6, 8, 9, 10, 13, 25, 32, 33, 34, 36, 41], "strategi": [0, 1, 9, 32, 40], "stratifi": [6, 36, 37], "stream": 35, "strength": [0, 5, 14, 33, 34, 41], "stretch": 11, "strict": [8, 13, 34], "strictli": [8, 13, 34], "stride": [4, 25], "strike": 6, "string": [1, 40], "stroke": [7, 37, 38], "strong": [3, 6, 9, 10, 12, 25, 29, 35, 36, 38, 39], "strongli": [0, 8, 15, 20, 22, 24, 25, 27, 40, 41], "stronli": [], "structur": [0, 1, 2, 3, 6, 9, 10, 12, 22, 24, 32, 36, 37, 38, 40, 41], "stuck": [1, 13, 34, 35, 40, 41], "student": [0, 15, 26, 27, 28, 30, 31, 32, 41], "studi": [0, 3, 4, 5, 6, 7, 8, 11, 12, 13, 23, 24, 26, 27, 31, 32, 33, 34, 35, 37, 39, 40, 41], "studier": 31, "stuff": [21, 22], "style": [7, 9, 20, 25, 32], "stylesheet": [], "st\u00f8land": 30, "sub": [9, 12, 35, 38, 39], "subarrai": [], "subclass": [], "subdivid": [0, 25, 32], "subfield": 0, "subgradi": 35, "subject": [6, 8, 29], "sublicens": [], "sublinear": 35, "submit": 32, "subplot": [0, 1, 3, 4, 6, 7, 8, 9, 10, 14, 21, 32, 36, 37, 38, 40, 41], "subplots_adjust": [8, 29], "subprogram": [25, 32], "subproject": [], "subract": [0, 33], "subroutin": [0, 32], "subscript": [1, 40], "subsequ": [1, 4, 5, 6, 12, 25, 29, 33, 34, 36, 38, 39], "subset": [1, 6, 9, 12, 13, 23, 24, 32, 34, 35, 36, 37, 38, 39, 40], "subspac": [0, 8, 11, 33], "substanti": [9, 10, 35], "substep": 11, "substitut": [3, 6, 12, 16, 25, 36, 37, 38], "subsubset": 9, "subtask": 6, "subtl": [1, 40], "subtract": [0, 4, 5, 6, 11, 13, 18, 19, 25, 26, 29, 33, 35, 36, 37, 40, 41], "subtre": 9, "succeed": [0, 4, 32], "success": [3, 7, 9, 13, 29, 37, 38], "successfulli": [4, 9], "succinctli": 35, "sudo": [0, 24, 26, 32], "suffer": [0, 1, 2, 5, 10, 32, 33, 34, 40, 41], "suffici": [1, 6, 8, 11, 13, 34, 36, 37, 40], "suggest": [1, 13, 23, 26, 27, 31, 34, 35, 40], "suit": [8, 12, 27, 38, 39], "suitabl": [0, 15, 19, 29, 33, 35], "sum": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 19, 21, 23, 25, 29, 32, 33, 34, 35, 38, 41], "sum_": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 19, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "sum_i": [0, 2, 5, 6, 8, 13, 19, 23, 26, 33, 34, 35, 36, 37, 41], "sum_j": [6, 18, 35], "sum_ja_": 0, "sum_k": [6, 8, 12, 25, 39, 40, 41], "sum_logist": 13, "sum_m": 3, "sum_n": 3, "sum_nx_": 3, "summar": [5, 6, 9, 23, 27, 36, 37], "summari": [1, 3, 4, 10, 28, 34, 35, 40, 41], "summat": [0, 3, 16, 33, 34], "sunni": 9, "super": [5, 33, 34, 35, 40, 41], "superfici": 3, "superscript": [1, 12, 38, 39, 40], "supervis": [0, 5, 6, 7, 9, 12, 24, 32, 33, 34, 36, 37, 38, 39], "supplement": [7, 26, 27, 37, 38], "supplementari": 27, "suppli": [], "support": [0, 1, 9, 10, 11, 13, 20, 21, 23, 24, 32, 33, 35, 37, 38, 39, 40, 41], "suppos": [0, 5, 6, 7, 8, 10, 11, 12, 13, 25, 32, 33, 34, 35, 36, 37, 38, 39], "suppress": [5, 13, 34], "sure": [0, 1, 4, 6, 16, 20, 21, 22, 26, 40, 41], "surf": 6, "surfac": [0, 6, 32, 35], "surpass": 6, "surpris": [0, 32], "surround": [3, 24], "survei": [0, 5, 6, 32, 33], "svc": [8, 9, 10], "svd": [0, 6, 11, 32, 36], "svdinv": 5, "svm": [8, 9, 10, 11], "svm_clf": [8, 10], "svn": [], "swap": 21, "swath": [5, 33, 34], "sweep": 23, "switch": [0, 40, 41], "sy": [13, 34, 35, 40, 41], "symbol": [1, 5, 11, 13, 24, 29, 32, 33, 34, 39, 40], "symmeteri": 1, "symmetr": [0, 5, 8, 11, 12, 13, 25, 32, 33, 38, 39], "symmetri": 6, "sympi": [0, 24, 26, 32, 39], "synonim": 29, "syntax": 13, "system": [0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 24, 25, 26, 32, 34, 35, 37, 38, 39, 40, 41], "systemat": [4, 6, 36, 37], "t": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 30, 32, 34, 35, 36, 37, 38, 39, 40, 41], "t0": [3, 6, 13, 35], "t1": [2, 13, 35, 41], "t2": [2, 41], "t3": [2, 41], "t9jjwsmsd1o": 36, "t_": [2, 41], "t_0": [2, 9, 13, 35, 41], "t_1": [13, 35], "t_b": 10, "t_batch": [40, 41], "t_i": [1, 2, 5, 12, 27, 33, 34, 40, 41], "t_j": 12, "t_k": 9, "t_test": [40, 41], "t_train": [40, 41], "t_val": [40, 41], "tabl": [9, 23, 26, 27, 29, 30, 32, 38], "tabul": [0, 23, 32], "tabular": 32, "tackl": 4, "tag": [2, 3, 4, 5, 6, 7, 12, 13, 14, 25, 29, 33, 34, 37, 38, 39, 40, 41], "tagrget": 39, "taht": [0, 32], "tail": 29, "tailor": [2, 8, 11, 32, 39, 41], "taiwan": [0, 32], "take": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 17, 19, 21, 22, 23, 24, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "taken": [0, 1, 3, 6, 10, 13, 21, 25, 36, 40], "tan": 3, "tangent": [1, 4, 12, 13, 34, 38, 40, 41], "tanh": [1, 4, 7, 8, 12, 37, 38, 40, 41], "target": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 16, 18, 19, 21, 22, 23, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "target_nam": [9, 21], "task": [0, 1, 3, 6, 9, 11, 12, 14, 21, 26, 27, 32, 35, 36, 37, 38, 39, 40, 41], "tau": [3, 5, 29], "taught": 32, "tax": [], "taylor": [2, 13, 34, 39, 41], "taylornr": [13, 34], "tc": 8, "teach": [15, 28, 32, 36], "team": [1, 40, 41], "teaser": 0, "technic": [0, 5, 6, 13, 26, 27, 34, 35, 36], "techniqu": [0, 1, 8, 10, 13, 24, 29, 31, 32, 33, 35, 36, 37, 40], "technologi": [0, 1, 40], "tell": [0, 4, 6, 10, 11, 13, 16, 29, 35, 36, 37], "temp": 1, "temp1": 1, "temp2": 1, "temperatur": [0, 9, 32], "templat": [18, 20], "temporari": [], "temporarili": [1, 40], "ten": [3, 32, 39], "tend": [3, 5, 6, 8, 9, 10, 12, 13, 14, 33, 35, 36, 37], "tendenc": [0, 32], "tension": [6, 36, 37], "tensor": 3, "tensorflow": [0, 2, 4, 8, 14, 24, 25, 26, 27, 31, 32, 33], "term": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 18, 19, 22, 23, 26, 27, 29, 32, 33, 34, 35, 37, 38, 41], "term1": [5, 6, 11], "term2": [5, 6, 11], "term3": [5, 6, 11], "term4": [5, 6, 11], "termin": [0, 4, 5, 9, 10, 13, 15, 33, 34, 35], "terminarl": 15, "terrain": 6, "terrain1": 6, "test": [3, 4, 5, 6, 7, 8, 9, 10, 13, 16, 19, 20, 21, 23, 25, 26, 29, 32, 34, 35, 36, 37, 38], "test_acc": [3, 41], "test_accuraci": [1, 3, 40, 41], "test_dataset": 41, "test_error": 6, "test_imag": [3, 4], "test_ind": [6, 36, 37], "test_input": 4, "test_label": [3, 4], "test_load": 41, "test_loss": [3, 41], "test_pr": [1, 40], "test_predict": [1, 40], "test_rnn": 4, "test_scor": [7, 10, 23, 38], "test_siz": [0, 1, 3, 5, 6, 10, 15, 17, 27, 33, 34, 35, 36, 37, 40, 41], "test_split": 9, "testerror": [0, 6, 33, 36, 37], "testi": 4, "testpredict": 4, "testx": 4, "tex": [], "text": [0, 1, 2, 4, 5, 8, 9, 11, 13, 15, 18, 20, 23, 25, 26, 27, 29, 31, 33, 34, 35, 36, 37, 40, 41], "textbf": [], "textbook": [16, 26, 27, 33, 34, 36, 37], "textual": 9, "textur": 1, "tf": [1, 3, 4, 13, 14, 34, 40, 41], "th": [0, 1, 2, 5, 6, 7, 9, 12, 13, 14, 25, 26, 29, 32, 33, 35, 36, 37, 38, 39, 40, 41], "than": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 17, 21, 23, 24, 29, 32, 33, 35, 36, 37, 38, 39, 40, 41], "thank": [4, 6, 33, 35, 41], "thats": [40, 41], "theano": [1, 24, 32, 40, 41], "thei": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 18, 20, 22, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "them": [0, 1, 3, 4, 6, 8, 9, 10, 11, 12, 13, 18, 21, 25, 26, 27, 32, 33, 38, 39, 40, 41], "theme": [0, 15, 32], "themselv": [0, 26, 27, 29, 32, 35], "thenc": [6, 36, 37], "theorem": [2, 6, 7, 33, 34, 37, 38, 40, 41], "theoret": [0, 4, 10], "theori": [0, 1, 3, 8, 9, 12, 13, 19, 24, 26, 31, 32, 35, 38, 39, 40], "thereaft": [0, 5, 6, 11, 12, 25, 26, 32, 36, 37, 39, 40, 41], "therebi": [0, 5, 7, 11, 26, 32, 33, 34, 37, 38, 39], "therefor": [0, 1, 2, 3, 4, 6, 7, 8, 11, 13, 19, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41], "therein": 11, "thereof": [0, 6, 13, 32, 35, 36], "theta": [0, 1, 4, 5, 6, 7, 13, 16, 26, 29, 32, 33, 34, 35, 37, 38, 39, 40], "theta1": 35, "theta2": 35, "theta_": [0, 1, 6, 7, 13, 32, 33, 34, 35, 37, 38, 40], "theta_0": [0, 5, 6, 7, 16, 32, 33, 34, 35, 37, 38], "theta_0x_": [0, 32, 33], "theta_1": [0, 5, 6, 7, 32, 33, 34, 35, 37, 38], "theta_1x_": [0, 32, 33], "theta_1x_0": [0, 32], "theta_1x_1": [0, 7, 32, 37, 38], "theta_1x_2": [0, 32], "theta_1x_i": [7, 33, 34, 35, 37, 38], "theta_2": [0, 32, 33], "theta_2x_": [0, 32, 33], "theta_2x_0": [0, 32], "theta_2x_1": [0, 32], "theta_2x_2": [0, 7, 32, 37, 38], "theta_2x_i": 33, "theta_3x_i": 33, "theta_4x_i": 33, "theta_closed_form": 18, "theta_closed_formol": 18, "theta_closed_formridg": 18, "theta_gdol": 18, "theta_gdridg": 18, "theta_i": [0, 1, 5, 32, 33, 34, 40], "theta_j": [0, 5, 6, 18, 32, 33, 35], "theta_k": [34, 35], "theta_linreg": [13, 34, 35], "theta_ol": 18, "theta_p": [7, 37, 38], "theta_px_p": [7, 37, 38], "theta_ridg": 18, "theta_t": [13, 35], "theta_tru": 18, "thetaand": 38, "thetaith": 35, "thetaor": 38, "thetavalu": 5, "thetaxor": 38, "thi": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 31, 33, 34, 35, 36, 37, 38, 40, 41], "thing": [0, 1, 2, 4, 5, 7, 9, 15, 16, 18, 21, 22, 29, 32, 36, 38, 40, 41], "think": [0, 1, 3, 4, 6, 9, 12, 13, 14, 29, 32, 33, 34, 35, 36, 38, 40], "third": [0, 3, 6, 13, 30, 32, 34, 35], "thirti": [7, 38], "thorughout": 32, "those": [0, 3, 5, 6, 8, 9, 10, 11, 23, 25, 26, 27, 32, 33, 34, 35, 36, 37, 39, 41], "though": [1, 2, 3, 4, 13, 16, 17, 19, 21, 22, 25, 29, 35, 40, 41], "thought": [6, 14, 26, 27, 29, 36, 37], "thousand": [0, 1, 26, 33, 35, 40], "three": [0, 1, 3, 5, 6, 8, 9, 12, 21, 23, 25, 26, 27, 28, 29, 30, 32, 33, 34, 36, 37, 38], "threshold": [1, 3, 9, 10, 11, 12, 13, 23, 35, 37, 38, 39, 40, 41], "through": [0, 1, 2, 3, 4, 5, 6, 8, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 26, 29, 32, 33, 34, 35, 36, 38, 40, 41], "throughout": [0, 4, 5, 14, 15, 24, 25, 29, 32, 40, 41], "throw": [3, 6, 29, 36], "thu": [0, 1, 2, 5, 6, 7, 8, 10, 11, 12, 13, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "thumb": [0, 6, 26, 33], "thursdai": [], "tibshirani": [6, 19, 26, 31, 32, 36, 37], "tick_param": 6, "ticker": [6, 13, 29, 34, 35], "tif": 6, "tight_layout": [1, 7, 38], "tightli": 11, "tild": [0, 5, 6, 7, 11, 19, 26, 29, 32, 33, 34, 35, 36, 37, 39, 40], "till": [0, 4, 7, 8, 9, 10, 12, 25, 32, 33, 37, 38, 39, 40, 41], "time": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 29, 32, 33, 34, 36, 37, 38, 39, 40, 41], "timeit": 4, "timer": 4, "times2": 23, "timeseri": [], "tini": [1, 35, 40], "tip": 3, "titl": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 13, 15, 20, 21, 29, 32, 34, 35, 36, 37, 40, 41], "tm": [], "tmp": 13, "tn": [2, 3, 7, 23, 41], "to_categor": [1, 3, 4, 40, 41], "to_categorical_numpi": [1, 40], "to_numer": [0, 6, 32, 36, 37], "todai": 3, "togeth": [0, 3, 6, 8, 11, 13, 22, 24, 32, 41], "toi": 14, "token": [], "told": 13, "toler": [2, 14, 41], "tolist": 4, "tomographi": [12, 38, 39], "too": [0, 2, 4, 5, 6, 9, 11, 13, 17, 18, 29, 31, 33, 34, 35, 36, 37, 41], "took": [8, 32], "tool": [0, 1, 3, 6, 13, 15, 24, 33, 36, 37, 40], "toolbox": 8, "top": [0, 3, 5, 6, 9, 10, 19, 23, 24, 32, 36], "topic": [0, 5, 6, 7, 8, 24, 26, 27, 33, 34, 36, 37, 38, 39, 41], "topolog": [3, 12, 38, 39], "topologi": [1, 12, 40], "torch": 41, "torchvis": 41, "torkjellsdatt": [30, 32], "tort": [], "toss": [10, 29], "total": [0, 1, 2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 14, 23, 25, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "total_loss": 4, "totalclustervari": 14, "totalscatt": 14, "totensor": 41, "toward": [1, 2, 7, 12, 13, 15, 23, 34, 37, 38, 40, 41], "towardsdatasci": 35, "town": [], "tp": [4, 7, 23], "tpng": 9, "tpr": 23, "tpu": [13, 24, 32], "tqdm": 6, "tr": [], "track": [3, 13, 14, 15, 22, 25, 33, 34, 35], "tract": [], "tractabl": [0, 32, 33], "trade": [5, 9, 20, 23, 27, 35, 36], "tradeoff": [0, 5, 19, 26, 32, 33, 34], "tradit": [0, 1, 4, 6, 32, 36, 37, 40], "train": [2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 16, 17, 20, 26, 27, 34, 35, 36, 37, 38, 41], "train_acc": [40, 41], "train_accuraci": [0, 1, 3, 32, 40, 41], "train_dataset": [4, 41], "train_end": [0, 1, 33, 40], "train_error": [6, 40, 41], "train_imag": [3, 4], "train_ind": [6, 36, 37], "train_label": [3, 4], "train_load": 41, "train_network": 21, "train_pr": [1, 40], "train_siz": [0, 1, 3, 33, 40, 41], "train_step": 4, "train_test_split": [0, 1, 3, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 23, 27, 32, 33, 34, 35, 36, 37, 38, 40, 41], "train_test_split_numpi": [0, 1, 33, 40], "trainable_vari": 4, "trained_model": [6, 33, 35], "trainerror": [0, 33], "traini": 4, "training_checkpoint": 4, "training_dataset": 4, "training_gradi": [13, 35], "trainingerror": [6, 36, 37], "trainpredict": 4, "trainscor": 4, "trainx": 4, "trait": [0, 32], "trajectori": [4, 35], "transfer": [9, 32], "transform": [0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 17, 21, 24, 25, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "transit": [6, 12, 38, 39], "translat": [1, 4, 6, 10, 32, 33, 35, 40], "transpos": [1, 5, 11, 21, 25, 33, 34, 40], "travers": [0, 5], "travi": [], "treat": [0, 1, 3, 6, 12, 13, 18, 21, 23, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40], "tree": [0, 1, 24, 32, 40], "tree_clf": [9, 10], "tree_clf_": 9, "tree_clf_sr": 9, "tree_reg": 9, "tree_reg1": 9, "tree_reg2": 9, "trend": 29, "treue": 7, "trevor": [19, 26, 31], "tri": [2, 3, 4, 9, 13, 16, 35, 41], "triain": 0, "trial": [0, 2, 4, 6, 13, 29, 32, 34, 35, 36, 37], "triangl": [13, 34], "triangular": 25, "trick": [3, 4, 8, 11, 13, 29, 35], "tricki": 22, "trickier": 29, "tridiagon": 25, "trillion": 24, "trim": [], "trivial": [0, 1, 5, 11, 29, 32, 34, 40, 41], "troffa": [], "troubl": [0, 8, 12, 15, 21, 22, 33, 35, 39, 40], "truck": 3, "true": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 25, 26, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41], "true_beta": 33, "true_fun": [6, 36, 37], "true_theta": [6, 35], "truelabel": [37, 38], "truli": 32, "truncat": 39, "try": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 18, 21, 22, 24, 25, 26, 27, 29, 32, 33, 34, 35, 37, 38, 39, 40, 41], "tr\u00f6ger": [], "tucker": 8, "tuesdai": [30, 32, 37, 41], "tumor": [7, 9, 37, 38], "tumour": [7, 38], "tunabl": 1, "tune": [4, 9, 13, 25, 32, 35], "tupl": [21, 40, 41], "turn": [0, 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 25, 26, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "tutori": [1, 4, 27, 40, 41], "tv": [2, 41], "tveito": [2, 41], "tvw1zdmznwm": 38, "tweak": [1, 4, 10, 29, 40, 41], "twice": [13, 34], "twist": 11, "two": [0, 1, 2, 4, 5, 6, 7, 9, 10, 11, 12, 13, 15, 17, 21, 23, 25, 26, 28, 29, 31, 32, 33, 34, 35, 36, 41], "tx": [13, 34, 35, 38], "tx_1": [13, 34], "txt": [4, 15, 20, 26, 27], "ty": [13, 34], "type": [0, 1, 3, 6, 8, 10, 13, 21, 23, 25, 29, 33, 34, 35, 36, 40], "typeset": 20, "typic": [0, 1, 2, 3, 4, 5, 7, 9, 10, 12, 13, 15, 16, 20, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "typo": [26, 27], "u": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 21, 25, 26, 27, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "u_": 25, "u_i": [12, 38], "u_m": 10, "ua": [0, 32], "ubuntu": [0, 24, 26, 32], "uci": [26, 27], "ufunc": [], "uio": [15, 20, 21, 26, 27, 30, 31], "uk": [], "un": 14, "unabl": [15, 21], "unari": [25, 32], "unbalanc": [6, 9, 36, 37], "unbias": [0, 5, 6, 32, 36], "uncent": [6, 33, 35], "uncertainti": [0, 5, 32], "uncertitud": 29, "unchang": [1, 3, 40], "uncom": [], "uncorrel": [10, 29], "undefin": [5, 33, 34], "under": [0, 1, 5, 6, 10, 13, 23, 24, 26, 32, 33, 34, 35, 36, 40, 41], "underdetermin": [0, 32], "underfit": [1, 6, 36, 37, 40], "underflowproblem": [5, 36], "undergo": [5, 21], "undergradu": [28, 30], "underli": [0, 1, 9, 13, 18, 23, 29, 32, 35, 40], "underlin": [], "underscor": [], "underset": [4, 14], "understand": [0, 1, 3, 5, 6, 10, 13, 14, 15, 19, 20, 21, 24, 32, 33, 34, 35, 39, 40, 41], "understood": [8, 13], "underwai": [], "undesir": 8, "undetermin": [5, 8, 36], "undo": 4, "unexpect": [6, 36], "unexpected": 29, "unexplain": 18, "unfair": [6, 33], "unfortun": [1, 8, 9, 10, 40], "unicode_liter": [8, 9], "uniform": [0, 1, 5, 6, 11, 13, 26, 29, 32, 34, 35, 37, 38, 40], "uniformli": [13, 29, 34, 35], "unifrompdf": 29, "unimport": [13, 34], "union": [5, 6, 36, 37], "uniqu": [0, 2, 6, 13, 14, 25, 32, 36, 37, 38, 41], "unique_class": [37, 38], "unique_cluster_label": 14, "unit": [0, 1, 3, 4, 5, 10, 12, 18, 29, 32, 33, 34, 35, 38, 39, 40, 41], "unitari": [5, 6, 25, 33, 34], "unitarili": [25, 32], "uniti": 29, "univari": 29, "univers": [0, 1, 2, 13, 24, 26, 27, 28, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41], "unix": [1, 40, 41], "unknow": [0, 25, 32], "unknown": [0, 1, 3, 4, 5, 6, 8, 10, 13, 19, 25, 26, 32, 33, 34, 35, 36, 37, 39, 40], "unknowwn": 12, "unlabel": [1, 40], "unless": [0, 3, 6, 11, 13, 26, 27, 32, 34, 36, 39], "unlik": [1, 3, 8, 13, 34, 35, 40, 41], "unnecessarili": 9, "unord": 3, "unpickl": [], "unpleas": [], "unpublish": 35, "unravel": [1, 40], "unrol": [3, 11], "unscal": 19, "unseen": [0, 7, 9, 15, 37, 38], "unstabl": [1, 40], "unsupervis": [0, 1, 4, 12, 24, 32, 38, 39, 40], "unsymmetr": [25, 32], "until": [1, 2, 4, 9, 12, 13, 14, 21, 34, 35, 38, 40, 41], "untouch": 0, "unusu": [12, 38, 39], "unweight": 23, "up": [1, 3, 4, 5, 6, 8, 10, 11, 13, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 35, 38], "updat": [1, 2, 10, 12, 13, 14, 15, 18, 19, 21, 22, 27, 36, 37, 38], "update_chang": [40, 41], "update_matrix": [40, 41], "update_weight": 22, "uploa": 32, "upload": [15, 20, 24, 26, 27, 31], "upon": [0, 1, 6, 7, 11, 25, 39, 40, 41], "upper": [0, 8, 9, 16, 25, 33], "uppercas": [25, 32], "upsampl": 4, "upscal": 4, "uptad": 39, "upward": [], "url": [32, 33, 38], "us": [4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 17, 20, 21, 23, 25, 29, 31, 36], "usag": [0, 8, 24, 32, 33, 39], "usd": [], "usd10000": [], "use_bia": 4, "usecol": [0, 32], "useless": [1, 40], "user": [0, 1, 2, 4, 6, 7, 15, 24, 25, 26, 32, 33, 37, 38, 40, 41], "usernam": [15, 26, 27], "usetex": 29, "usg": 6, "usr": 29, "usual": [0, 3, 4, 7, 12, 13, 14, 23, 32, 35, 37, 38, 39], "ut": 5, "utf": [], "util": [1, 3, 4, 6, 7, 10, 14, 19, 32, 36, 37, 40, 41], "ux": 25, "v": [2, 4, 5, 6, 11, 13, 15, 23, 24, 33, 34, 36, 37, 38, 39, 40, 41], "v0": 29, "v1": 29, "v2": 29, "v5": [], "v8xr": [38, 39, 40], "v_": 35, "v_0": [11, 35], "v_t": 35, "va": 1, "vahid": 32, "val": 13, "val_acc": [40, 41], "val_accuraci": 3, "val_error": [40, 41], "val_loss": 4, "val_set": [40, 41], "vale": [2, 41], "valid": [0, 1, 4, 7, 9, 10, 13, 23, 24, 29, 32, 33, 35, 38, 40, 41], "validation_data": 3, "validation_split": [4, 41], "valu": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20, 21, 22, 24, 25, 26, 27, 32, 35, 38, 39, 40, 41], "valuat": 9, "valued_at_a": [40, 41], "valued_at_z": [40, 41], "valueerror": [], "valy": 4, "van": [0, 19, 26, 32, 33, 34, 35], "vandenbergh": [8, 13, 34], "vandermond": [0, 32], "vanilla": [0, 6, 11, 14, 33, 35], "vanish": [1, 4, 13, 29, 34, 39], "var": [5, 6, 10, 11, 19, 26, 29, 33, 36, 37], "var_x": 29, "varabl": 8, "varepsilon": [5, 6, 19, 36], "varepsilon_": [5, 6, 36], "varepsilon_i": [5, 6, 36], "vari": [0, 1, 3, 5, 6, 10, 21, 23, 32, 36, 37, 39, 40], "variabl": [0, 1, 2, 5, 6, 7, 8, 10, 11, 12, 13, 14, 21, 25, 32, 33, 35, 36, 37, 38, 39, 40, 41], "varianc": [0, 1, 5, 7, 9, 10, 11, 13, 14, 18, 20, 24, 25, 27, 29, 32, 33, 34, 35, 38, 40], "variance_i": [5, 11, 33], "variance_x": [5, 11, 33], "variant": [0, 1, 6, 8, 12, 13, 27, 32, 33, 34, 35, 38, 39, 40, 41], "variat": [3, 4, 11, 32], "varieti": [0, 3, 12, 24, 26, 32, 38, 39], "variou": [1, 3, 5, 6, 7, 8, 9, 11, 12, 13, 16, 19, 20, 24, 25, 26, 29, 32, 33, 34, 35, 38, 39, 40, 41], "varydimens": 4, "vast": 35, "vastli": 3, "vaue": 1, "vault": 0, "vdot": [2, 13, 34, 35, 41], "ve": [26, 27, 35], "vec": [6, 36], "vector": [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 14, 17, 18, 21, 22, 24, 34, 35, 36, 37, 39, 40, 41], "vector_mean": 14, "ventur": [0, 8, 24, 32], "venv": 15, "verbos": [1, 3, 4, 37, 38, 40, 41], "veri": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 18, 21, 22, 26, 27, 29, 31, 32, 33, 34, 35, 36, 37, 40, 41], "verifi": [3, 11, 25, 32], "versatil": [8, 32], "versicolor": [8, 9], "version": [0, 3, 10, 13, 14, 15, 21, 22, 24, 25, 26, 27, 29, 32], "versu": [1, 23, 35, 40], "vert": [0, 1, 5, 6, 7, 8, 9, 11, 13, 16, 17, 32, 33, 34, 35, 36, 37, 38, 39, 40], "vert_1": [5, 6, 33, 34, 35], "vert_2": [5, 6, 11, 17, 33, 34, 35, 36], "vi": [40, 41], "via": [0, 5, 6, 7, 8, 9, 10, 11, 12, 19, 23, 24, 25, 26, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "vidal": 11, "video": [0, 1, 12, 24, 28, 30, 32, 33, 34, 41], "view": [1, 3, 5, 6, 12, 13, 29, 31, 32, 34, 35, 36, 38, 40, 41], "vii": [40, 41], "viii": [40, 41], "violat": 8, "virginica": 9, "viridi": [0, 1, 2, 3, 32, 40, 41], "virtanen": [], "virtual": [1, 35, 40], "viscos": 13, "viscou": 13, "visibl": 15, "vision": [0, 3], "visit": 35, "visual": [0, 3, 11, 12, 18, 23, 24, 32, 33, 38, 39, 41], "visualis": 1, "visualstudio": [15, 16, 19], "viz": [6, 8, 29], "vmap": 13, "vmax": [1, 6], "vmh0zpt0tli": 35, "vmin": [1, 6], "voic": 3, "volatil": 35, "volum": [0, 3, 32], "volume18": 41, "von": [39, 40], "vote": [10, 32], "voting_clf": 10, "votingclassifi": 10, "votingsimpl": 10, "vscode": [21, 22], "vstack": [5, 11, 25, 29, 32, 33, 37, 38, 40, 41], "vt": [5, 33, 34], "w": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 21, 22, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "w1": [8, 21, 22], "w2": [8, 11, 21, 22], "w3": 8, "w_": [1, 12, 38, 39, 40, 41], "w_0": 39, "w_1": [8, 25, 39, 40], "w_1a_0": [39, 40], "w_1x": [39, 40], "w_1x_": 8, "w_1x_1": 8, "w_2": [8, 25, 39, 40], "w_2a_1": [39, 40], "w_2x_": 8, "w_2x_2": 8, "w_3": 25, "w_4": 25, "w_g": [21, 22], "w_hidden": [2, 41], "w_i": [1, 2, 10, 39, 40, 41], "w_ix_i": [12, 38, 39], "w_j": 25, "w_m": 25, "w_output": [2, 41], "w_px_": 8, "w_px_p": 8, "w_t": [], "wa": [1, 3, 4, 5, 6, 7, 10, 11, 12, 14, 17, 19, 21, 25, 32, 33, 35, 36, 37, 38, 39, 40, 41], "wai": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 18, 19, 21, 22, 23, 25, 29, 32, 33, 34, 35, 38, 40, 41], "walk": 9, "walker": 29, "wall": 35, "walt": [], "wang": [0, 32], "want": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 24, 26, 27, 29, 32, 33, 34, 35, 36, 37, 39, 40, 41], "warn": [4, 40, 41], "warrant": [6, 36, 37], "warranti": [], "wast": [3, 35], "watch": [24, 34, 35, 36, 38, 39, 40, 41], "wave": 3, "wavelet": 8, "wcag": [], "we": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 33, 34, 36, 37, 38], "weak": [9, 10, 14], "weaker": 35, "weather": [1, 12, 38, 39, 40], "web": [24, 28, 30, 32], "weblink": 27, "webpag": 32, "websit": [6, 25, 26, 27, 28, 32], "wedg": [8, 29, 39, 40], "wednesdai": [30, 32, 37, 41], "wee": 11, "week": [0, 5, 6, 7, 26, 27, 28, 30], "week41": [27, 41], "week42": [27, 41], "weekli": [15, 16, 24, 26, 28, 30, 31, 32, 38], "weierstrass": 39, "weight": [1, 2, 3, 6, 7, 9, 10, 12, 13, 18, 21, 22, 23, 27, 29, 35, 37, 38, 39, 41], "weight_arrai": [40, 41], "weight_decai": 41, "weigth": [2, 22, 41], "welchlab": [38, 39, 40], "welcom": [8, 15, 24], "well": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "went": 8, "were": [0, 1, 3, 4, 5, 6, 7, 8, 10, 11, 12, 14, 29, 32, 35, 36, 37, 38, 39, 40, 41], "wessel": [0, 19, 26, 32, 33, 34, 35], "wg_nf1awssi": 39, "what": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 35, 38, 39, 40, 41], "whatev": [3, 21], "when": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 22, 23, 25, 26, 27, 29, 32, 33, 34, 36, 37, 38, 39, 40, 41], "whenev": [13, 15, 29, 35, 39], "where": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "wherea": [6, 23, 29, 35, 36, 37], "wherefrom": [26, 27], "wherein": [1, 12, 38, 39, 40], "whether": [0, 3, 5, 7, 9, 26, 27, 29, 32, 37, 38], "which": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 36, 37, 38, 39], "whichev": [1, 3, 40, 41], "while": [0, 1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 19, 20, 21, 22, 23, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "white": 9, "whiteboad": 35, "whiteboard": [33, 34, 35, 36, 37, 38, 39, 40, 41], "who": [0, 15], "whole": [1, 3, 4, 5, 9, 11, 13, 21, 35, 40], "whom": [], "whose": [0, 6, 10, 23, 27, 29, 33, 36, 37], "whow": [11, 33], "why": [0, 1, 3, 6, 13, 15, 16, 17, 19, 21, 26, 33, 34, 40], "wide": [0, 1, 3, 6, 7, 12, 24, 25, 26, 32, 36, 37, 38, 39, 40], "widehat": [6, 36], "width": [0, 3, 8, 9, 21, 32], "wieringen": [0, 19, 26, 32, 33, 34, 35], "wiki": 26, "wikipedia": 26, "win": [10, 35], "wind": 9, "window": [], "wing": [30, 32], "winther": [2, 41], "wiothout": 6, "wiscons": 7, "wisconsin": [10, 38, 40, 41], "wisdom": [6, 33, 35], "wise": [1, 5, 12, 13, 21, 33, 34, 35, 38, 40], "wish": [0, 2, 5, 7, 8, 11, 13, 14, 18, 25, 26, 27, 32, 33, 34, 35, 37, 38, 39, 40, 41], "with_std": [0, 33], "wither": 6, "within": [0, 2, 3, 4, 7, 9, 12, 13, 14, 29, 31, 32, 34, 37, 38, 41], "withinclust": 14, "without": [0, 1, 5, 6, 8, 9, 11, 12, 13, 15, 18, 23, 26, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40], "wo5dmep_bbi": [38, 39, 40], "won": [0, 15, 32, 39], "wonder": 8, "word": [0, 1, 3, 4, 5, 6, 7, 14, 19, 23, 26, 27, 29, 32, 33, 34, 35, 40, 41], "work": [0, 1, 4, 6, 7, 8, 9, 13, 15, 16, 18, 19, 20, 21, 22, 24, 26, 27, 28, 29, 30, 32, 33, 35, 36, 37, 38, 39, 40, 41], "workabl": 35, "workaround": [], "workhors": 35, "workload": 35, "workshop": 32, "world": [0, 8, 16, 33], "worldwid": [0, 32], "worri": 15, "wors": [0, 1, 3, 4, 6, 32, 35, 36, 37, 40], "worst": 23, "worth": [9, 19, 21], "worthi": [26, 27], "would": [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 18, 20, 22, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40], "wouldn": [], "wrap": [6, 25, 32], "wrapper": [21, 22], "write": [0, 1, 2, 3, 5, 6, 7, 8, 12, 13, 15, 16, 18, 21, 23, 25, 32, 33, 35, 36, 37, 38, 39, 41], "writer": [37, 38], "writerow": [37, 38], "written": [0, 2, 3, 5, 11, 12, 13, 16, 23, 24, 25, 26, 27, 29, 32, 33, 34, 35, 39, 40, 41], "wrong": [1, 8, 15, 19, 40], "wrongli": 10, "wrote": [5, 11, 33], "wrt": [10, 13, 21, 22, 35, 39, 40], "wth": [10, 13, 35], "wurstemberg": [39, 40], "www": [20, 24, 25, 26, 27, 31, 32, 34, 35, 36, 38, 39, 40, 41], "wx_1": 8, "x": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 29, 32, 34, 35, 36, 37, 38, 39, 40, 41], "x0": [8, 37, 38], "x1": [4, 8, 9, 10, 13, 37, 38], "x1_exampl": 8, "x1d": 8, "x2": [8, 9, 10, 13], "x2d": [8, 11], "x2d_train": 11, "x2dsl": 11, "x3": 8, "x_": [0, 2, 3, 5, 6, 8, 10, 11, 13, 14, 25, 29, 32, 33, 34, 35, 36, 37, 39, 41], "x_0": [0, 5, 11, 18, 25, 32, 33, 36, 39], "x_1": [0, 2, 5, 6, 7, 8, 9, 10, 11, 13, 18, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "x_2": [0, 2, 5, 6, 7, 8, 9, 10, 11, 13, 25, 29, 32, 33, 34, 36, 37, 38, 39, 40, 41], "x_3": [8, 25, 29, 39], "x_4": [25, 39], "x_5": 39, "x_6": 18, "x_batch": [40, 41], "x_bin": [37, 38], "x_center": 11, "x_data": [1, 40], "x_data_ful": [1, 40], "x_hidden": [2, 41], "x_i": [0, 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 25, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "x_input": [2, 41], "x_ix_": [0, 32], "x_iy_i": 8, "x_j": [0, 2, 8, 9, 12, 16, 29, 33, 35, 38, 39, 41], "x_jy_j": 8, "x_k": [12, 14, 25, 29, 33, 38], "x_l": [29, 39], "x_m": [6, 12, 25, 29, 36, 38], "x_mean": [18, 35], "x_multi": [37, 38], "x_n": [0, 2, 3, 6, 8, 11, 12, 13, 25, 29, 32, 34, 36, 38, 39, 41], "x_new": [9, 10], "x_norm": [18, 35], "x_offset": [6, 33, 35], "x_output": [2, 41], "x_p": [3, 7, 9, 37, 38], "x_poli": 9, "x_poly10": 9, "x_pred": 4, "x_prev": [2, 41], "x_reduc": 11, "x_sampl": [], "x_scale": 8, "x_small": 13, "x_std": [18, 35], "x_t": 35, "x_test": [0, 1, 3, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 23, 27, 33, 34, 35, 36, 37, 38, 40, 41], "x_test_": 17, "x_test_own": 6, "x_test_scal": [0, 6, 7, 9, 10, 11, 33, 35], "x_tot": 4, "x_train": [0, 1, 3, 4, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 23, 27, 32, 33, 34, 35, 36, 37, 38, 40, 41], "x_train_": 17, "x_train_mean": [6, 33, 35], "x_train_own": 6, "x_train_r": 19, "x_train_scal": [0, 6, 7, 9, 10, 11, 33, 35], "x_val": [1, 40, 41], "xarrai": [24, 32], "xavier": [1, 40], "xbnew": [13, 34, 35], "xcode": [0, 24, 26, 32], "xdclassiffierconfus": 10, "xdclassiffierroc": 10, "xg_clf": 10, "xgb": 10, "xgbclassifi": 10, "xgboost": 9, "xgboot": 10, "xgbregressor": 10, "xgparam": 10, "xgtree": 10, "xi": [8, 13, 35, 37, 38], "xi_": 8, "xi_1": 8, "xi_i": 8, "xinv": 38, "xk": 8, "xla": [13, 24, 32], "xlabel": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 21, 29, 32, 33, 34, 35, 36, 37, 41], "xlim": [6, 10, 36, 37], "xm": 9, "xmesh": 13, "xnew": [0, 13, 32, 34, 35], "xp": 29, "xpanda": [0, 33], "xpd": [5, 11, 33], "xplot": 0, "xscale": [0, 33], "xsr": 9, "xt_x": [13, 34, 35], "xtest": [6, 36, 37], "xtick": [3, 6, 8, 9, 36, 37], "xtrain": [6, 36, 37], "xu": [0, 32], "xx": [0, 25, 32], "xy": [0, 6, 8, 25, 32], "xytext": 8, "xyz": [], "xz": [25, 32], "y": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 23, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "y1": 4, "y2": 4, "y3": 4, "y_": [0, 1, 5, 6, 10, 11, 25, 32, 33, 36, 37, 40], "y_0": [0, 5, 11, 25, 32, 33, 36], "y_1": [0, 5, 8, 9, 11, 13, 25, 32, 33, 34, 35, 36], "y_1y_1": 8, "y_1y_1k": 8, "y_1y_2": 8, "y_1y_2k": 8, "y_1y_n": 8, "y_1y_nk": 8, "y_2": [0, 5, 8, 9, 11, 25, 32, 33], "y_2y_1": 8, "y_2y_1k": 8, "y_2y_2": 8, "y_2y_2k": 8, "y_3": [0, 9, 25], "y_4": 25, "y_bin": [37, 38], "y_binari": [37, 38], "y_center": [18, 35], "y_data": [0, 1, 5, 6, 32, 33, 34, 35, 40], "y_data_ful": [1, 40], "y_decis": 8, "y_fit": [0, 33], "y_i": [0, 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 19, 25, 26, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40], "y_if_": 10, "y_indic": [37, 38], "y_ix_": [0, 32], "y_ix_i": [7, 8, 13, 33, 34, 35, 37, 38], "y_iy_jk": 8, "y_j": [6, 8, 12, 26, 36, 37, 38, 39, 40], "y_k": [12, 38], "y_m": 25, "y_mean": [18, 35], "y_model": [0, 4, 5, 6, 32, 33, 34, 35], "y_multi": [37, 38], "y_n": [8, 13, 34, 35], "y_ny_1": 8, "y_ny_1k": 8, "y_ny_2": 8, "y_ny_2k": 8, "y_ny_n": 8, "y_ny_nk": 8, "y_offset": [6, 17, 33, 35], "y_onehot": [37, 38], "y_plot": 9, "y_pred": [0, 1, 4, 6, 7, 8, 9, 10, 23, 27, 33, 35, 36, 37, 38, 40], "y_pred1": 9, "y_pred2": 9, "y_pred_bin": [37, 38], "y_pred_multi": [37, 38], "y_pred_rf": 10, "y_pred_tre": 10, "y_prob": [37, 38], "y_prob_bin": [37, 38], "y_prob_multi": [37, 38], "y_proba": [7, 10, 23, 38], "y_sampl": [], "y_scaler": [6, 33, 35], "y_test": [0, 1, 3, 4, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 23, 27, 33, 34, 35, 36, 37, 38, 40, 41], "y_test_onehot": [1, 40], "y_test_predict": [], "y_tot": 4, "y_train": [0, 1, 3, 4, 5, 6, 7, 9, 10, 11, 15, 16, 17, 19, 23, 27, 32, 33, 34, 35, 36, 37, 38, 40, 41], "y_train_mean": [6, 33, 35], "y_train_onehot": [1, 40], "y_train_predict": [], "y_train_r": 19, "y_train_scal": [6, 33, 35], "y_true": [37, 38], "y_val": 1, "yadav": 41, "yand": 38, "ye": [3, 6, 7, 36, 37, 38], "year": [0, 24, 32], "yet": [0, 1, 6, 8, 11, 13, 20, 21, 32, 37, 39, 40, 41], "yi": [13, 35, 37, 38], "yield": [0, 2, 5, 6, 8, 10, 12, 13, 14, 23, 25, 29, 32, 34, 35, 36, 38, 39, 40, 41], "yk": 8, "ylabel": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 21, 29, 32, 33, 34, 35, 36, 37, 41], "ylim": [3, 6, 36, 37], "ym": 9, "ymesh": 13, "yn": 0, "yo": [8, 9, 10], "yor": 38, "yoshiki": [], "yoshua": [1, 31, 40], "you": [0, 1, 3, 4, 5, 6, 8, 9, 10, 11, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41], "young": 0, "your": [1, 2, 4, 5, 6, 8, 11, 13, 15, 17, 19, 20, 21, 22, 23, 24, 25, 32, 34, 35, 36, 37, 38, 39, 40, 41], "your_model_object": 16, "yourself": [11, 13, 23, 32, 34], "youtu": [33, 34, 36, 38, 40], "youtub": [24, 34, 35, 36, 38, 39, 40, 41], "ypred": [6, 36, 37], "ypredict": [0, 13, 32, 33, 34, 35], "ypredict2": [13, 34, 35], "ypredictlasso": [5, 34], "ypredictol": [0, 5, 34], "ypredictown": [6, 33, 35], "ypredictownridg": [6, 33, 34, 35], "ypredictridg": [0, 5, 6, 33, 34, 35], "ypredictskl": [6, 33, 35], "ytest": [6, 36, 37], "ytick": [3, 6, 8, 9, 36, 37], "ytild": [0, 6, 32, 33, 36, 37], "ytildelasso": [5, 34], "ytildenp": [0, 32, 33], "ytildeol": [0, 5, 34], "ytildeownridg": [6, 33, 34, 35], "ytilderidg": [5, 6, 33, 34, 35], "ytrain": [6, 36, 37], "yuxi": 32, "yx": [25, 32], "yxor": [38, 40, 41], "yy": [25, 32], "yz": [25, 32], "z": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 21, 22, 25, 29, 32, 33, 36, 37, 38, 39, 40, 41], "z1": [21, 22], "z2": [21, 22], "z_": [1, 2, 12, 25, 32, 39, 40, 41], "z_0": [25, 32, 39], "z_1": [25, 32, 39, 40], "z_2": [22, 25, 32, 39, 40], "z_c": [1, 40], "z_h": [1, 40], "z_hidden": [2, 41], "z_i": [1, 12, 38, 40], "z_j": [1, 12, 41], "z_k": [12, 33, 39, 40], "z_m": [1, 40], "z_matric": [40, 41], "z_mod": 9, "z_o": [1, 40], "z_output": [2, 41], "za": [], "zalando": 27, "zaman": 29, "zaxi": 6, "zero": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 21, 25, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "zero_grad": 41, "zeros_lik": [4, 37, 38], "zeroth": 33, "zfill": 4, "zip": [4, 6, 21, 22, 37, 38], "zm_h": [0, 32], "zn": [], "zone": [], "zoom": 32, "zscout": [], "zx": [25, 32], "zy": [25, 32], "zz": [25, 32], "\u00f8yvind": [6, 33, 35], "\u03b4": [40, 41]}, "titles": ["3. Linear Regression", "14. Building a Feed Forward Neural Network", "15. Solving Differential Equations with Deep Learning", "16. Convolutional Neural Networks", "17. Recurrent neural networks: Overarching view", "4. Ridge and Lasso Regression", "5. Resampling Methods", "6. Logistic Regression", "8. Support Vector Machines, overarching aims", "9. Decision trees, overarching aims", "10. Ensemble Methods: From a Single Tree to Many Trees and Extreme Boosting, Meet the Jungle of Methods", "11. Basic ideas of the Principal Component Analysis (PCA)", "13. Neural networks", "7. Optimization, the central part of any Machine Learning algortithm", "12. Clustering and Unsupervised Learning", "Exercises week 34", "Exercises week 35", "Exercises week 36", "Exercises week 37", "Exercises week 38", "Exercises week 39", "Exercises week 41", "Exercises week 42", "Exercises week 43", "Applied Data Analysis and Machine Learning", "2. Linear Algebra, Handling of Arrays and more Python Features", "Project 1 on Machine Learning, deadline October 6 (midnight), 2025", "Project 2 on Machine Learning, deadline November 10 (Midnight)", "Course setting", "1. Elements of Probability Theory and Statistical Data Analysis", "Teachers and Grading", "Textbooks", "Week 34: Introduction to the course, Logistics and Practicalities", "Week 35: From Ordinary Linear Regression to Ridge and Lasso Regression", "Week 36: Linear Regression and Gradient descent", "Week 37: Gradient descent methods", "Week 38: Statistical analysis, bias-variance tradeoff and resampling methods", "Week 39: Resampling methods and logistic regression", "Week 40: Gradient descent methods (continued) and start Neural networks", "Week 41 Neural networks and constructing a neural network code", "Week 42 Constructing a Neural Network code with examples", "Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations"], "titleterms": {"": [8, 10, 34, 35, 36, 37, 38], "0": 40, "04": [], "05": [], "06": [], "07": [], "1": [0, 15, 16, 17, 18, 19, 20, 21, 22, 26, 27, 33, 39, 40, 41], "10": [27, 39], "11": [], "13": 40, "15": [19, 36], "19": 19, "1a": 18, "2": [0, 15, 16, 17, 18, 19, 20, 21, 22, 27, 32, 33, 34, 39, 40, 41], "20": 41, "2017": [], "2018": [], "2019": [], "2023": 30, "2025": [26, 37, 38, 39, 40], "22": 37, "26": 37, "27": [], "29": 38, "2a": [], "2b": [], "3": [0, 15, 16, 17, 18, 19, 20, 21, 22, 33, 39, 40, 41], "34": [15, 32], "35": [16, 33], "36": [17, 34], "37": [18, 35], "38": [19, 36], "39": [20, 37], "3a": 18, "3b": 18, "4": [0, 15, 16, 17, 18, 19, 20, 21, 22, 33, 40], "40": 38, "41": [21, 39], "42": [22, 40], "43": [23, 41], "44": 23, "4a": 18, "4b": 18, "5": [0, 16, 18, 19, 20, 21, 22], "6": [21, 22, 26, 39], "7": [21, 22], "8": [22, 35], "A": [0, 1, 4, 8, 9, 32, 36, 37, 38, 40, 41], "AND": 38, "And": [32, 33, 35, 41], "But": 35, "In": [30, 39], "Ising": 6, "OR": 38, "The": [0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 15, 24, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "To": 32, "With": [4, 34], "a11i": [], "about": [27, 32, 33, 34], "abov": [34, 39, 40, 41], "abstract": 20, "accuraci": 35, "across": 35, "activ": [1, 12, 21, 27, 38, 39, 40, 41], "ad": [0, 6, 20, 26, 32, 33, 38, 39, 40], "adaboost": 10, "adagrad": [13, 35], "adam": [13, 35], "adapt": [10, 35], "add": [], "adjust": [1, 40], "advanc": 26, "adversari": 4, "again": [3, 9], "against": 27, "ai": [26, 27, 32], "aim": [8, 9, 21, 22, 23, 32], "aka": 32, "al": 35, "algebra": [25, 32], "algorithm": [9, 10, 11, 12, 27, 32, 33, 34, 35, 39, 40, 41], "algortithm": [13, 34, 37, 38], "all": [8, 39, 40], "an": [0, 4, 10, 15, 20, 32, 39], "analys": [5, 33, 34], "analysi": [0, 5, 6, 11, 24, 26, 27, 29, 32, 33, 34, 36, 37, 39], "analyt": [0, 16, 18, 27, 41], "analyz": [27, 39, 40], "ani": [13, 22, 34, 37, 38], "anoth": [9, 34, 36, 37], "api": [], "appli": 24, "approach": [0, 8, 14, 32, 35, 36, 37], "approxim": [12, 39], "architectur": [1, 40], "arrai": [25, 32], "artifici": [38, 39], "assist": 30, "assumpt": 36, "august": [], "author": [], "autocorrel": 29, "autograd": [2, 13, 22, 35, 41], "automat": [13, 35, 39, 41], "avail": 20, "avali": [], "averag": 35, "b": [23, 26, 27], "back": [1, 11, 12, 33, 34, 39, 40, 41], "background": [24, 26, 27, 36], "backpropag": 22, "bag": 10, "base": [13, 35, 36], "basic": [0, 5, 7, 9, 10, 11, 25, 33, 34, 37, 38, 39], "batch": [1, 22, 35, 40], "bay": 5, "befor": 11, "bengio": 40, "beta": [], "better": [8, 38], "bia": [6, 19, 26, 35, 36, 37], "bias": [39, 40], "binari": [1, 40], "bind": 32, "bird": 10, "blind": [], "block": [], "boldsymbol": [18, 33, 36], "book": [19, 39, 40], "boost": 10, "bootstrap": [6, 10, 36, 37], "boston": [], "breast": 1, "brief": [32, 36, 37], "bring": [12, 39, 40], "browser": [], "bsd": [], "build": [1, 3, 9, 40, 41], "c": [23, 26, 27, 32], "calcul": [18, 33, 34], "can": [32, 35, 36, 37, 39], "cancer": [1, 7, 9, 11], "cart": 9, "case": [8, 10, 29, 33, 34, 35, 37, 38], "cdn": [], "cell": [], "central": [13, 24, 29, 34, 36, 37, 38], "chain": [12, 39, 40], "challeng": 35, "chang": 10, "changelog": [], "channel": 32, "chi": [0, 32], "choic": [17, 40], "choos": [1, 35, 40], "cifar01": 3, "citat": [], "class": [37, 38, 39], "classic": 11, "classif": [1, 9, 10, 27, 37, 38, 40, 41], "classifi": [8, 37], "claus": [], "clip": [1, 40], "cluster": 14, "cnn": 3, "code": [1, 2, 5, 9, 11, 12, 13, 14, 15, 16, 20, 26, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "collect": [1, 3, 40, 41], "color": [], "colorblind": [], "combin": 35, "commun": 32, "compact": [37, 38, 39, 40], "compar": [2, 10, 16, 41], "comparison": [34, 35], "compet": 35, "compil": [], "complet": [33, 39, 40], "complex": [0, 6, 26, 33], "complic": [6, 39], "compon": 11, "comput": [9, 19, 35], "computation": [36, 37], "computerlab": 32, "con": [9, 35], "concept": 29, "condit": 34, "confid": 36, "confus": 23, "conjug": 13, "consider": [39, 40], "constraint": 35, "construct": [39, 40, 41], "contain": [], "content": [], "continu": 38, "contn": 32, "contrast": [], "contributor": [], "converg": 35, "convex": [8, 13, 34, 35], "convolut": [3, 12, 38, 39], "copyright": [], "core": [], "correct": 35, "correl": [11, 33, 38], "correspond": [], "cost": [1, 10, 33, 34, 35, 36, 37, 38, 39, 40, 41], "count": 39, "cours": [24, 28, 31, 32], "covari": [5, 11, 29, 33], "cover": 32, "creat": [16, 20], "creator": [], "critic": 27, "cross": [6, 26, 36, 37, 38], "cumul": 23, "curv": 23, "custom": 21, "cython": 32, "d": [26, 27], "dark": [], "data": [0, 1, 3, 6, 7, 9, 11, 15, 17, 18, 21, 24, 29, 32, 33, 37, 38, 39, 40, 41], "dataset": [1, 3, 18, 40], "david": 32, "deadlin": [26, 27, 32], "deadllin": 30, "decai": [2, 35, 41], "decis": [9, 10], "decomposit": [5, 11, 25, 33, 34], "deeep": [], "deep": [1, 2, 32, 35, 37, 38, 39, 40, 41], "defin": [1, 32, 39, 40, 41], "definit": [19, 39, 40], "deflist": [], "degre": [0, 17, 33], "deliver": [15, 16, 19, 20, 26, 27], "deliveri": [26, 27], "delta": 36, "dens": 0, "depend": [], "depth": 27, "deriv": [5, 12, 16, 17, 19, 33, 34, 35, 36, 39, 40], "descent": [2, 10, 13, 18, 26, 34, 35, 38, 41], "design": 33, "detail": [3, 32, 41], "develop": [1, 40], "diagon": 11, "differ": [8, 27, 35], "differenti": [2, 13, 35, 39, 41], "diffus": [2, 41], "dimens": 35, "dimension": [2, 3, 8, 18, 41], "direct": [], "disadvantag": 9, "discret": 29, "discrimin": 32, "discuss": 38, "distribut": [5, 29, 36], "do": [1, 35, 38, 40], "document": 20, "doe": [33, 34, 38], "domain": 29, "down": [1, 40], "dropout": [1, 40], "e": [26, 27], "each": [21, 37], "economi": [33, 34], "electron": [26, 27], "element": [0, 29, 32], "elimin": 25, "elu": [40, 41], "empir": 35, "energi": 32, "ensembl": 10, "entri": [39, 40], "entropi": [9, 37, 38], "environ": [0, 15], "equat": [0, 2, 12, 33, 34, 37, 38, 39, 40, 41], "error": [0, 10, 32, 33, 34, 36, 37], "essenti": 32, "estim": 36, "et": 35, "etc": 32, "euler": [2, 41], "evalu": [1, 27, 39, 40], "evid": 35, "exampl": [1, 2, 3, 4, 6, 7, 8, 9, 10, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "exercis": [0, 6, 15, 16, 17, 18, 19, 20, 21, 22, 23, 33, 39, 41], "expect": [19, 29, 36], "expens": [36, 37], "experi": 29, "explicit": [39, 40], "explod": 40, "explor": 0, "exponenti": [2, 35, 41], "express": [16, 17, 19, 33, 37, 38, 39, 40], "extend": [34, 37, 38, 39], "extrapol": 4, "extrem": [10, 32], "ey": 10, "f": [26, 27], "f_1": 23, "fall": 30, "famili": [1, 32, 40, 41], "famou": 25, "fantast": [33, 34], "faq": [], "featur": [9, 16, 25, 33], "februari": [], "feed": [1, 12, 22, 38, 39, 40, 41], "figur": 20, "file": [], "fill": [], "final": [12, 33, 35, 39, 40, 41], "find": [16, 18, 36], "fine": [1, 40], "first": [4, 12, 32, 34, 39, 40, 41], "fit": [0, 10, 15, 16, 32, 34], "fix": [33, 34, 35], "float": 39, "fold": [36, 37], "forc": 3, "forest": 10, "form": 18, "format": [26, 27, 32], "formula": 18, "forward": [1, 2, 12, 22, 38, 39, 40, 41], "foster": 32, "fourier": 3, "frank": 6, "freedom": [0, 17, 33], "frequent": [33, 35], "frequentist": [0, 32], "from": [5, 10, 12, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40], "full": [2, 35, 40, 41], "function": [0, 1, 6, 7, 8, 10, 11, 12, 13, 26, 27, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "funtion": 40, "further": [3, 5, 33, 34], "g": [26, 27], "gain": 23, "gan": 4, "gate": [38, 40, 41], "gaussian": 25, "gd": [13, 35], "gener": [4, 9, 32, 37, 38, 39], "geometr": [11, 34], "get": [20, 39], "gini": 9, "github": 15, "glorot": 40, "goal": [15, 16, 17, 18, 19, 20], "good": [0, 20, 32], "goodfellow": 35, "gotthard": [], "grade": [30, 32], "gradient": [1, 2, 10, 13, 18, 22, 26, 27, 34, 35, 38, 39, 40, 41], "greativ": [], "group": 37, "growth": [2, 41], "guid": [], "h": 26, "ha": 24, "hand": [22, 39, 40], "handl": [25, 32], "happen": [36, 37], "hessian": [33, 34, 35], "hidden": [2, 39, 40, 41], "high": [], "histogram": 36, "histori": [], "homogen": 40, "hous": [], "how": 16, "hyperbol": [38, 40], "hyperparamet": [1, 17, 40], "hyperplan": 8, "i": [0, 1, 32, 40, 41], "id3": 9, "idea": 11, "ideal": 34, "ident": 36, "identifi": 36, "ii": [32, 41], "iid": 36, "iii": 41, "illustr": [34, 38, 39], "implement": [1, 16, 17, 18, 27, 40, 41], "implic": [5, 33, 34], "import": [5, 25, 32, 33, 34, 39, 40], "improv": [1, 35, 40], "includ": [13, 26, 27, 35, 37, 38, 39], "incorpor": [], "increment": 11, "independ": 36, "index": 9, "inform": 30, "ingredi": 39, "init": [40, 41], "input": [2, 21, 22, 39, 40, 41], "insight": 40, "instal": [24, 26, 32], "instructor": 30, "intermedi": 39, "interpret": [5, 11, 19, 32, 33, 34, 36], "interv": 36, "introduc": [11, 13, 33], "introduct": [0, 6, 20, 24, 25, 26, 27, 32, 38, 39], "invers": [5, 25], "invert": [33, 34], "ipython": [], "iter": 10, "its": 33, "iv": 41, "j": [], "jacobian": [33, 41], "januari": [], "jax": 13, "job": 38, "julia": 32, "jungl": 10, "jupyt": [], "k": [36, 37, 39, 40], "kera": [1, 3, 40, 41], "kernel": [8, 11], "l": [39, 40], "lab": [34, 35, 36, 37, 38, 39, 40, 41], "lagrangian": 8, "lasso": [5, 6, 26, 33, 34], "last": [33, 35, 38, 39, 40], "later": [5, 33, 34], "layer": [1, 2, 3, 12, 21, 22, 39, 40, 41], "layout": [39, 40], "learn": [0, 1, 2, 11, 13, 14, 15, 16, 17, 18, 19, 20, 24, 26, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "least": [5, 6, 16, 19, 26, 27, 32, 33, 34, 35], "lectur": [32, 34, 35, 36, 37, 38, 39, 40, 41], "level": 10, "librari": [24, 27, 32], "licens": [], "light": [], "likelihood": [7, 36, 37, 38], "limit": [1, 13, 29, 34, 35, 36, 40], "linear": [0, 8, 13, 15, 25, 32, 33, 34, 37], "link": [5, 11, 31, 33, 36], "list": [39, 40], "literatur": [26, 27], "logist": [7, 32, 37, 38, 40], "loss": [33, 34, 35], "lu": 25, "ma": [], "machin": [0, 8, 13, 24, 26, 27, 32, 34, 37, 38], "machineri": 27, "made": 36, "main": [29, 32], "make": [0, 9, 10, 20, 33], "mani": [10, 12], "markdown": [], "mask": [], "maskedarrai": [], "mass": 32, "materi": [26, 27, 32, 33, 34, 35, 36, 37, 39, 40], "math": [5, 33, 34], "mathemat": [3, 5, 8, 33, 34, 38, 39, 40], "matplotlib": [], "matric": [5, 25, 32], "matrix": [1, 5, 11, 12, 16, 23, 25, 32, 33, 34, 35, 38, 40], "matter": 0, "max": 33, "maximum": [36, 37, 38], "me": [], "mean": [0, 33, 34, 37], "measur": [23, 38], "meet": [5, 10, 29, 32, 33], "memori": 35, "mercer": 8, "metadata": [], "method": [6, 9, 10, 13, 26, 27, 32, 34, 35, 36, 37, 38, 40, 41], "metric": 19, "midnight": [26, 27], "min": 33, "mini": 35, "minibatch": 35, "minim": [32, 37, 38, 41], "mit": [], "ml": 32, "mle": 36, "mlp": 12, "mnist": [3, 4, 41], "mode": 39, "model": [0, 1, 4, 6, 12, 15, 17, 32, 38, 39, 40], "moment": 35, "momentum": [13, 26, 35], "mondai": [34, 35, 36, 38, 39, 41], "moon": [8, 9], "more": [3, 6, 25, 26, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "motiv": 35, "move": 35, "multi": [38, 39, 40], "multiclass": [40, 41], "multilay": [12, 38, 39], "multipl": [1, 3, 17, 21, 40], "multipli": 8, "multivari": 39, "myst": [], "ncsa": [], "need": [26, 32], "network": [1, 2, 3, 4, 7, 12, 27, 32, 35, 37, 38, 39, 40, 41], "neural": [1, 2, 3, 4, 7, 12, 27, 32, 35, 38, 39, 40, 41], "neuron": [38, 39], "new": [4, 18, 36, 39], "newton": [34, 35, 37, 38], "nn": [39, 40, 41], "node": [39, 40], "noeds": 40, "non": [8, 35], "none": 35, "norm": 27, "normal": [0, 1, 36, 40], "notat": [12, 38], "note": [26, 27, 33, 34], "notebook": [], "novemb": 27, "now": [1, 9, 13, 34, 35, 36, 37], "nuclear": [0, 32], "nueral": 37, "numba": 32, "number": [0, 2, 22, 29, 33, 35, 39, 41], "numer": [2, 26, 27, 29, 41], "numpi": [25, 32], "object": [3, 22, 40], "observ": [39, 40], "obtain": 11, "octob": [26, 39, 40, 41], "od": [2, 41], "off": [6, 19, 26], "ol": [5, 6, 15, 16, 18, 26, 34, 36], "onc": 21, "one": [2, 12, 18, 22, 34, 39, 40, 41], "ones": [38, 40], "open": [], "oper": [25, 39], "optim": [1, 8, 13, 18, 24, 32, 33, 34, 35, 37, 38, 39, 40], "option": [21, 22, 27], "order": [13, 18, 35], "ordinari": [5, 6, 16, 19, 26, 32, 33, 34, 35, 41], "organ": [0, 32], "orient": [22, 40], "oslo": 31, "other": [4, 9, 11, 12, 23, 25, 26, 27, 32, 38, 39, 40, 41], "ouput": [39, 40], "our": [0, 4, 5, 11, 13, 26, 27, 32, 33, 34, 37, 38, 40, 41], "outcom": [24, 32], "output": [2, 39, 40, 41], "over": [39, 40], "overarch": [0, 4, 8, 9, 21, 22, 23, 32, 33, 39], "overview": [10, 32, 35], "own": [0, 10, 11, 26, 27, 32, 33, 41], "packag": [25, 32], "panda": [32, 33], "paper": 40, "parallel": 39, "paramet": [32, 33, 37, 38, 39, 40], "paramt": 18, "part": [13, 24, 26, 27, 34, 37, 38, 39, 40, 41], "partial": [2, 41], "pass": [1, 22, 40], "pca": 11, "pdf": 29, "percepetron": [39, 40], "perceptron": [12, 38, 39, 40], "perform": [1, 9, 40], "period": 3, "perspect": [1, 40], "pitaya": [], "plan": [33, 34, 35, 36, 37, 39, 41], "plethora": 32, "plot": [36, 37], "point": [4, 39], "poisson": [2, 41], "polici": [], "polynomi": [3, 16, 18, 34], "popul": [2, 41], "popular": 32, "possibl": 41, "practic": [13, 30, 32, 35], "pre": [1, 3, 40, 41], "preambl": [26, 27], "precis": 23, "predict": [4, 21], "predictor": [37, 38], "preprocess": [33, 35], "prerequisit": [3, 24, 32], "present": 20, "princip": 11, "principl": 3, "pro": [9, 35], "probabl": [5, 29, 36], "problem": [1, 2, 13, 32, 33, 34, 35, 37, 38, 39, 40, 41], "procedur": [9, 32], "process": [1, 3, 21, 40, 41], "program": [2, 13, 26, 27, 34, 35, 39, 41], "project": [6, 20, 26, 27, 30, 32], "prop": 13, "propag": [1, 12, 39, 40, 41], "properti": [5, 29, 33, 34, 35, 37], "python": [0, 9, 15, 24, 25, 32], "pytorch": 41, "quick": 8, "quickli": [], "r": 32, "random": [10, 11, 29], "raphson": [34, 37, 38], "rate": [26, 35, 40, 41], "read": [9, 32, 33, 35, 36, 37, 38, 39, 40], "real": [6, 21, 32, 39], "recal": 23, "recommend": [32, 33, 40], "record": [], "recurr": [4, 12, 38, 39], "reduc": [0, 33, 39], "reduct": 3, "refer": [26, 27], "referenc": 20, "reformul": [2, 41], "regress": [0, 5, 6, 7, 9, 10, 13, 15, 17, 18, 19, 26, 27, 32, 33, 34, 35, 36, 37, 38], "regular": [1, 40], "relat": [], "relev": [31, 33, 38, 40], "relu": [1, 40, 41], "remark": 3, "remind": [6, 8, 27, 32, 33, 34, 35, 39, 40], "replac": [13, 35], "report": [20, 26, 27], "repositori": [15, 36, 37], "requir": [2, 24, 27, 41], "resampl": [6, 19, 26, 36, 37], "rescal": [6, 33], "residu": [33, 34], "resourc": [2, 41], "result": [33, 34, 39, 40], "revers": 39, "revis": [], "revisit": [13, 34, 35, 37, 38], "rewrit": [32, 33, 36], "rewritten": [37, 38], "ridg": [0, 5, 6, 17, 18, 19, 26, 33, 34, 35], "rm": 13, "rmsprop": 35, "roc": 23, "role": [], "root": 40, "rule": [12, 35, 39, 40], "rung": 26, "same": [13, 35, 36, 37], "sampl": 11, "scalabl": 35, "scale": [17, 18, 19, 33, 35], "schedul": [32, 40, 41], "schemat": 9, "scheme": [2, 41], "scienc": 32, "scikit": [0, 1, 11, 32, 33, 34, 35, 36, 37, 38, 40], "second": [13, 18, 35], "select": 37, "semest": 30, "sensit": 34, "septemb": [19, 34, 35, 36, 37, 38], "seriou": 39, "session": [34, 35, 36, 37, 38, 39, 40, 41], "set": [0, 2, 3, 9, 12, 15, 28, 32, 33, 34, 39, 40, 41], "setup": [15, 41], "sgd": [13, 35], "should": [1, 27, 40, 41], "show": [], "sigmoid": 40, "similar": [13, 35, 41], "simpl": [0, 4, 9, 13, 18, 32, 33, 34, 35, 37, 39, 40], "simpler": 39, "simplest": 18, "singl": [10, 38, 39], "singular": [5, 11, 33, 34], "size": [33, 34, 35], "sklearn": 16, "slightli": 35, "smarter": 39, "smoothi": [], "sneak": 35, "soft": 8, "softmax": [1, 40], "softwar": [26, 27, 32], "solut": 41, "solv": [2, 34, 37, 38, 41], "solver": 13, "some": [13, 25, 33, 34, 37, 39], "sourc": [], "specif": 41, "specifi": [2, 41], "speed": 35, "sphinx": [], "split": [0, 15, 33], "squar": [0, 5, 6, 10, 16, 19, 26, 32, 33, 34, 35], "standard": [13, 33, 36], "start": [20, 38], "state": 0, "statist": [5, 6, 24, 29, 32, 36, 37], "steepest": [10, 13, 34], "step": [35, 36, 37], "stochast": [13, 26, 29, 35], "stop": 35, "strongli": [32, 35], "structur": [], "studi": 38, "suggest": [32, 38], "sum": [36, 37, 39, 40], "summari": [27, 30, 32], "superposit": 3, "supervis": [1, 40], "support": 8, "svd": [5, 33, 34], "synthet": [18, 37, 38], "systemat": 3, "t": 33, "take": 16, "taken": [32, 35], "teach": 30, "teacher": [30, 32], "team": [], "technic": [33, 41], "techniqu": [6, 11, 26], "technologi": 24, "tensorflow": [1, 3, 40, 41], "tent": [30, 32], "term": [36, 39, 40], "test": [0, 1, 15, 17, 27, 33, 40, 41], "texmath": [], "text": 32, "textbook": [31, 32], "than": 34, "thank": [], "theorem": [5, 8, 11, 12, 29, 36, 39], "theoret": 35, "theori": 29, "theta": [18, 36], "thi": [21, 22, 32, 39], "three": [39, 40], "through": 39, "time": 35, "tip": [13, 35], "todo": [], "togeth": [12, 39, 40], "tool": [26, 27, 32], "top": [1, 40], "topic": 32, "toward": 11, "trade": [6, 19, 26], "tradeoff": [6, 36, 37], "train": [0, 1, 4, 15, 21, 22, 32, 33, 39, 40], "transform": 3, "translat": [], "tree": [9, 10], "trial": 41, "tuesdai": [34, 38, 39, 40], "tune": [1, 40], "two": [3, 8, 22, 24, 27, 37, 38, 39, 40], "type": [2, 4, 12, 32, 38, 39, 41], "uio": 32, "understand": [22, 36, 37], "univers": [12, 31, 39], "unsupervis": 14, "up": [0, 2, 9, 12, 15, 27, 32, 33, 34, 36, 37, 39, 40, 41], "updat": [26, 35, 39, 40, 41], "us": [0, 1, 2, 3, 7, 13, 16, 18, 19, 22, 24, 26, 27, 32, 33, 34, 35, 37, 38, 39, 40, 41], "usag": [35, 40, 41], "v": [3, 35], "valid": [6, 26, 36, 37], "valu": [5, 11, 19, 29, 33, 34, 36, 37], "vanish": 40, "vari": 35, "variabl": [29, 34], "varianc": [6, 19, 26, 36, 37], "variou": [0, 27, 36, 37], "vector": [8, 12, 16, 25, 32, 33, 38], "versu": 32, "video": [35, 36, 37, 38, 39, 40], "view": [0, 4, 10, 33, 39], "virtual": 15, "visual": [1, 9, 40], "wai": [9, 26, 36, 37, 39], "warm": 27, "wave": [2, 41], "we": [32, 35, 39, 40, 41], "wednesdai": [34, 38, 39, 40], "week": [15, 16, 17, 18, 19, 20, 21, 22, 23, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41], "weekli": [], "weight": 40, "welcom": [], "what": [0, 32, 33, 34, 36, 37], "when": 35, "which": [1, 35, 40, 41], "why": [32, 35, 36, 37, 38, 39, 41], "wisconsin": 7, "word": 39, "workflow": [], "wrap": 36, "write": [4, 11, 20, 22, 26, 27, 34, 40], "x": 33, "xgboost": 10, "xor": [38, 40, 41], "yaml": [], "yet": 34, "you": 27, "your": [0, 10, 16, 18, 26, 27, 33], "z_j": [39, 40]}})
\ No newline at end of file
diff --git a/doc/LectureNotes/_build/html/statistics.html b/doc/LectureNotes/_build/html/statistics.html
index 97b1b2ccb..d169316dd 100644
--- a/doc/LectureNotes/_build/html/statistics.html
+++ b/doc/LectureNotes/_build/html/statistics.html
@@ -257,6 +257,9 @@
+Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations
+Exercises week 43
+
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
Projects
diff --git a/doc/LectureNotes/_build/html/week43.html b/doc/LectureNotes/_build/html/week43.html
new file mode 100644
index 000000000..4b059de22
--- /dev/null
+++ b/doc/LectureNotes/_build/html/week43.html
@@ -0,0 +1,4609 @@
+
+
+
+
+
+
+
+
+
+
+ Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations — Applied Data Analysis and Machine Learning
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations
+
+
+
+
+
+
+
+
+
+
+
+Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations
+Morten Hjorth-Jensen , Department of Physics, University of Oslo, Norway
+Date: October 20, 2025
+
+
+Exercises and lab session week 43
+Lab sessions on Tuesday and Wednesday.
+
+Work on writing your own neural network code and discussions of project 2. If you didn’t get time to do the exercises from the two last weeks, we recommend doing so as these exercises give you the basic elements of a neural network code.
+The exercises this week are tailored to the optional part of project 2, and deal with studying ways to display results from classification problems
+
+
+
+
+
+Lecture Monday October 20
+
+
+Setting up the back propagation algorithm and algorithm for a feed forward NN, initalizations
+This is a reminder from last week.
+The architecture (our model).
+
+Set up your inputs and outputs (scalars, vectors, matrices or higher-order arrays)
+Define the number of hidden layers and hidden nodes
+Define activation functions for hidden layers and output layers
+Define optimizer (plan learning rate, momentum, ADAgrad, RMSprop, ADAM etc) and array of initial learning rates
+Define cost function and possible regularization terms with hyperparameters
+Initialize weights and biases
+Fix number of iterations for the feed forward part and back propagation part
+
+
+
+Setting up the back propagation algorithm, part 1
+Let us write this out in the form of an algorithm.
+First , we set up the input data \(\boldsymbol{x}\) and the activations
+\(\boldsymbol{z}_1\) of the input layer and compute the activation function and
+the pertinent outputs \(\boldsymbol{a}^1\) .
+Secondly , we perform then the feed forward till we reach the output
+layer and compute all \(\boldsymbol{z}_l\) of the input layer and compute the
+activation function and the pertinent outputs \(\boldsymbol{a}^l\) for
+\(l=1,2,3,\dots,L\) .
+Notation : The first hidden layer has \(l=1\) as label and the final output layer has \(l=L\) .
+
+
+Setting up the back propagation algorithm, part 2
+Thereafter we compute the ouput error \(\boldsymbol{\delta}^L\) by computing all
+
+\[
+\delta_j^L = \sigma'(z_j^L)\frac{\partial {\cal C}}{\partial (a_j^L)}.
+\]
+Then we compute the back propagate error for each \(l=L-1,L-2,\dots,1\) as
+
+\[
+\delta_j^l = \sum_k \delta_k^{l+1}w_{kj}^{l+1}\sigma'(z_j^l).
+\]
+
+
+Setting up the Back propagation algorithm, part 3
+Finally, we update the weights and the biases using gradient descent
+for each \(l=L-1,L-2,\dots,1\) (the first hidden layer) and update the weights and biases
+according to the rules
+
+\[
+w_{ij}^l\leftarrow = w_{ij}^l- \eta \delta_j^la_i^{l-1},
+\]
+
+\[
+b_j^l \leftarrow b_j^l-\eta \frac{\partial {\cal C}}{\partial b_j^l}=b_j^l-\eta \delta_j^l,
+\]
+with \(\eta\) being the learning rate.
+
+
+Updating the gradients
+With the back propagate error for each \(l=L-1,L-2,\dots,1\) as
+
+\[
+\delta_j^l = \sum_k \delta_k^{l+1}w_{kj}^{l+1}\sigma'(z_j^l),
+\]
+we update the weights and the biases using gradient descent for each \(l=L-1,L-2,\dots,1\) and update the weights and biases according to the rules
+
+\[
+w_{ij}^l\leftarrow = w_{ij}^l- \eta \delta_j^la_i^{l-1},
+\]
+
+\[
+b_j^l \leftarrow b_j^l-\eta \frac{\partial {\cal C}}{\partial b_j^l}=b_j^l-\eta \delta_j^l,
+\]
+
+
+Activation functions
+A property that characterizes a neural network, other than its
+connectivity, is the choice of activation function(s). The following
+restrictions are imposed on an activation function for an FFNN to
+fulfill the universal approximation theorem
+
+Non-constant
+Bounded
+Monotonically-increasing
+Continuous
+
+
+Activation functions, examples
+Typical examples are the logistic Sigmoid
+
+\[
+\sigma(x) = \frac{1}{1 + e^{-x}},
+\]
+and the hyperbolic tangent function
+
+\[
+\sigma(x) = \tanh(x)
+\]
+
+
+
+The RELU function family
+The ReLU activation function suffers from a problem known as the dying
+ReLUs: during training, some neurons effectively die, meaning they
+stop outputting anything other than 0.
+In some cases, you may find that half of your network’s neurons are
+dead, especially if you used a large learning rate. During training,
+if a neuron’s weights get updated such that the weighted sum of the
+neuron’s inputs is negative, it will start outputting 0. When this
+happen, the neuron is unlikely to come back to life since the gradient
+of the ReLU function is 0 when its input is negative.
+
+
+ELU function
+To solve this problem, nowadays practitioners use a variant of the
+ReLU function, such as the leaky ReLU discussed above or the so-called
+exponential linear unit (ELU) function
+
+\[\begin{split}
+ELU(z) = \left\{\begin{array}{cc} \alpha\left( \exp{(z)}-1\right) & z < 0,\\ z & z \ge 0.\end{array}\right.
+\end{split}\]
+
+
+Which activation function should we use?
+In general it seems that the ELU activation function is better than
+the leaky ReLU function (and its variants), which is better than
+ReLU. ReLU performs better than \(\tanh\) which in turn performs better
+than the logistic function.
+If runtime performance is an issue, then you may opt for the leaky
+ReLU function over the ELU function If you don’t want to tweak yet
+another hyperparameter, you may just use the default \(\alpha\) of
+\(0.01\) for the leaky ReLU, and \(1\) for ELU. If you have spare time and
+computing power, you can use cross-validation or bootstrap to evaluate
+other activation functions.
+
+
+More on activation functions, output layers
+In most cases you can use the ReLU activation function in the hidden
+layers (or one of its variants).
+It is a bit faster to compute than other activation functions, and the
+gradient descent optimization does in general not get stuck.
+For the output layer:
+
+For classification the softmax activation function is generally a good choice for classification tasks (when the classes are mutually exclusive).
+For regression tasks, you can simply use no activation function at all.
+
+
+
+Building neural networks in Tensorflow and Keras
+Now we want to build on the experience gained from our neural network implementation in NumPy and scikit-learn
+and use it to construct a neural network in Tensorflow. Once we have constructed a neural network in NumPy
+and Tensorflow, building one in Keras is really quite trivial, though the performance may suffer.
+In our previous example we used only one hidden layer, and in this we will use two. From this it should be quite
+clear how to build one using an arbitrary number of hidden layers, using data structures such as Python lists or
+NumPy arrays.
+
+
+Tensorflow
+Tensorflow is an open source library machine learning library
+developed by the Google Brain team for internal use. It was released
+under the Apache 2.0 open source license in November 9, 2015.
+Tensorflow is a computational framework that allows you to construct
+machine learning models at different levels of abstraction, from
+high-level, object-oriented APIs like Keras, down to the C++ kernels
+that Tensorflow is built upon. The higher levels of abstraction are
+simpler to use, but less flexible, and our choice of implementation
+should reflect the problems we are trying to solve.
+Tensorflow uses so-called graphs to represent your computation
+in terms of the dependencies between individual operations, such that you first build a Tensorflow graph
+to represent your model, and then create a Tensorflow session to run the graph.
+In this guide we will analyze the same data as we did in our NumPy and
+scikit-learn tutorial, gathered from the MNIST database of images. We
+will give an introduction to the lower level Python Application
+Program Interfaces (APIs), and see how we use them to build our graph.
+Then we will build (effectively) the same graph in Keras, to see just
+how simple solving a machine learning problem can be.
+To install tensorflow on Unix/Linux systems, use pip as
+
+and/or if you use anaconda , just write (or install from the graphical user interface)
+(current release of CPU-only TensorFlow)
+
+To install the current release of GPU TensorFlow
+
+
+
+Using Keras
+Keras is a high level neural network
+that supports Tensorflow, CTNK and Theano as backends.
+If you have Anaconda installed you may run the following command
+
+You can look up the instructions here for more information.
+We will to a large extent use keras in this course.
+
+
+Collect and pre-process data
+Let us look again at the MINST data set.
+
+
+
+
+
+
+
+Using Pytorch with the full MNIST data set
+
+
+
+And a similar example using Tensorflow with Keras
+
+
+
+Building our own neural network code
+Here we present a flexible object oriented codebase
+for a feed forward neural network, along with a demonstration of how
+to use it. Before we get into the details of the neural network, we
+will first present some implementations of various schedulers, cost
+functions and activation functions that can be used together with the
+neural network.
+The codes here were developed by Eric Reber and Gregor Kajda during spring 2023.
+
+Learning rate methods
+The code below shows object oriented implementations of the Constant,
+Momentum, Adagrad, AdagradMomentum, RMS prop and Adam schedulers. All
+of the classes belong to the shared abstract Scheduler class, and
+share the update_change() and reset() methods allowing for any of the
+schedulers to be seamlessly used during the training stage, as will
+later be shown in the fit() method of the neural
+network. Update_change() only has one parameter, the gradient
+(\(δ^l_ja^{l−1}_k\) ), and returns the change which will be subtracted
+from the weights. The reset() function takes no parameters, and resets
+the desired variables. For Constant and Momentum, reset does nothing.
+
+
+
+Usage of the above learning rate schedulers
+To initalize a scheduler, simply create the object and pass in the
+necessary parameters such as the learning rate and the momentum as
+shown below. As the Scheduler class is an abstract class it should not
+called directly, and will raise an error upon usage.
+
+Here is a small example for how a segment of code using schedulers
+could look. Switching out the schedulers is simple.
+
+
+
+Cost functions
+Here we discuss cost functions that can be used when creating the
+neural network. Every cost function takes the target vector as its
+parameter, and returns a function valued only at \(x\) such that it may
+easily be differentiated.
+
+Below we give a short example of how these cost function may be used
+to obtain results if you wish to test them out on your own using
+AutoGrad’s automatics differentiation.
+
+
+
+Activation functions
+Finally, before we look at the neural network, we will look at the
+activation functions which can be specified between the hidden layers
+and as the output function. Each function can be valued for any given
+vector or matrix X, and can be differentiated via derivate().
+
+Below follows a short demonstration of how to use an activation
+function. The derivative of the activation function will be important
+when calculating the output delta term during backpropagation. Note
+that derivate() can also be used for cost functions for a more
+generalized approach.
+
+
+
+The Neural Network
+Now that we have gotten a good understanding of the implementation of
+some important components, we can take a look at an object oriented
+implementation of a feed forward neural network. The feed forward
+neural network has been implemented as a class named FFNN, which can
+be initiated as a regressor or classifier dependant on the choice of
+cost function. The FFNN can have any number of input nodes, hidden
+layers with any amount of hidden nodes, and any amount of output nodes
+meaning it can perform multiclass classification as well as binary
+classification and regression problems. Although there is a lot of
+code present, it makes for an easy to use and generalizeable interface
+for creating many types of neural networks as will be demonstrated
+below.
+
+Before we make a model, we will quickly generate a dataset we can use
+for our linear regression problem as shown below
+
+Now that we have our dataset ready for the regression, we can create
+our regressor. Note that with the seed parameter, we can make sure our
+results stay the same every time we run the neural network. For
+inititialization, we simply specify the dimensions (we wish the amount
+of input nodes to be equal to the datapoints, and the output to
+predict one value).
+
+We then fit our model with our training data using the scheduler of our choice.
+
+Due to the progress bar we can see the MSE (train_error) throughout
+the FFNN’s training. Note that the fit() function has some optional
+parameters with defualt arguments. For example, the regularization
+hyperparameter can be left ignored if not needed, and equally the FFNN
+will by default run for 100 epochs. These can easily be changed, such
+as for example:
+
+We see that given more epochs to train on, the regressor reaches a lower MSE.
+Let us then switch to a binary classification. We use a binary
+classification dataset, and follow a similar setup to the regression
+case.
+
+
+We will now make use of our validation data by passing it into our fit function as a keyword argument
+
+Finally, we will create a neural network with 2 hidden layers with activation functions.
+
+
+
+
+Multiclass classification
+Finally, we will demonstrate the use case of multiclass classification
+using our FFNN with the famous MNIST dataset, which contain images of
+digits between the range of 0 to 9.
+
+
+
+
+Testing the XOR gate and other gates
+Let us now use our code to test the XOR gate.
+
+Not bad, but the results depend strongly on the learning reate. Try different learning rates.
+
+
+
+Ordinary Differential Equations first
+An ordinary differential equation (ODE) is an equation involving functions having one variable.
+In general, an ordinary differential equation looks like
+
+
+
+\[
+\begin{equation} \label{ode} \tag{1}
+f\left(x, \, g(x), \, g'(x), \, g''(x), \, \dots \, , \, g^{(n)}(x)\right) = 0
+\end{equation}
+\]
+where \(g(x)\) is the function to find, and \(g^{(n)}(x)\) is the \(n\) -th derivative of \(g(x)\) .
+The \(f\left(x, g(x), g'(x), g''(x), \, \dots \, , g^{(n)}(x)\right)\) is just a way to write that there is an expression involving \(x\) and \(g(x), \ g'(x), \ g''(x), \, \dots \, , \text{ and } g^{(n)}(x)\) on the left side of the equality sign in (1 ).
+The highest order of derivative, that is the value of \(n\) , determines to the order of the equation.
+The equation is referred to as a \(n\) -th order ODE.
+Along with (1 ), some additional conditions of the function \(g(x)\) are typically given
+for the solution to be unique.
+
+
+The trial solution
+Let the trial solution \(g_t(x)\) be
+
+
+
+\[
+\begin{equation}
+ g_t(x) = h_1(x) + h_2(x,N(x,P))
+\label{_auto1} \tag{2}
+\end{equation}
+\]
+where \(h_1(x)\) is a function that makes \(g_t(x)\) satisfy a given set
+of conditions, \(N(x,P)\) a neural network with weights and biases
+described by \(P\) and \(h_2(x, N(x,P))\) some expression involving the
+neural network. The role of the function \(h_2(x, N(x,P))\) , is to
+ensure that the output from \(N(x,P)\) is zero when \(g_t(x)\) is
+evaluated at the values of \(x\) where the given conditions must be
+satisfied. The function \(h_1(x)\) should alone make \(g_t(x)\) satisfy
+the conditions.
+But what about the network \(N(x,P)\) ?
+As described previously, an optimization method could be used to minimize the parameters of a neural network, that being its weights and biases, through backward propagation.
+
+
+Minimization process
+For the minimization to be defined, we need to have a cost function at hand to minimize.
+It is given that \(f\left(x, \, g(x), \, g'(x), \, g''(x), \, \dots \, , \, g^{(n)}(x)\right)\) should be equal to zero in (1 ).
+We can choose to consider the mean squared error as the cost function for an input \(x\) .
+Since we are looking at one input, the cost function is just \(f\) squared.
+The cost function \(c\left(x, P \right)\) can therefore be expressed as
+
+\[
+C\left(x, P\right) = \big(f\left(x, \, g(x), \, g'(x), \, g''(x), \, \dots \, , \, g^{(n)}(x)\right)\big)^2
+\]
+If \(N\) inputs are given as a vector \(\boldsymbol{x}\) with elements \(x_i\) for \(i = 1,\dots,N\) ,
+the cost function becomes
+
+
+
+\[
+\begin{equation} \label{cost} \tag{3}
+ C\left(\boldsymbol{x}, P\right) = \frac{1}{N} \sum_{i=1}^N \big(f\left(x_i, \, g(x_i), \, g'(x_i), \, g''(x_i), \, \dots \, , \, g^{(n)}(x_i)\right)\big)^2
+\end{equation}
+\]
+The neural net should then find the parameters \(P\) that minimizes the cost function in
+(3 ) for a set of \(N\) training samples \(x_i\) .
+
+
+Minimizing the cost function using gradient descent and automatic differentiation
+To perform the minimization using gradient descent, the gradient of \(C\left(\boldsymbol{x}, P\right)\) is needed.
+It might happen so that finding an analytical expression of the gradient of \(C(\boldsymbol{x}, P)\) from (3 ) gets too messy, depending on which cost function one desires to use.
+Luckily, there exists libraries that makes the job for us through automatic differentiation.
+Automatic differentiation is a method of finding the derivatives numerically with very high precision.
+
+
+Example: Exponential decay
+An exponential decay of a quantity \(g(x)\) is described by the equation
+
+
+
+\[
+\begin{equation} \label{solve_expdec} \tag{4}
+ g'(x) = -\gamma g(x)
+\end{equation}
+\]
+with \(g(0) = g_0\) for some chosen initial value \(g_0\) .
+The analytical solution of (4 ) is
+
+
+
+\[
+\begin{equation}
+ g(x) = g_0 \exp\left(-\gamma x\right)
+\label{_auto2} \tag{5}
+\end{equation}
+\]
+Having an analytical solution at hand, it is possible to use it to compare how well a neural network finds a solution of (4 ).
+
+
+The function to solve for
+The program will use a neural network to solve
+
+
+
+\[
+\begin{equation} \label{solveode} \tag{6}
+g'(x) = -\gamma g(x)
+\end{equation}
+\]
+where \(g(0) = g_0\) with \(\gamma\) and \(g_0\) being some chosen values.
+In this example, \(\gamma = 2\) and \(g_0 = 10\) .
+
+
+The trial solution
+To begin with, a trial solution \(g_t(t)\) must be chosen. A general trial solution for ordinary differential equations could be
+
+\[
+g_t(x, P) = h_1(x) + h_2(x, N(x, P))
+\]
+with \(h_1(x)\) ensuring that \(g_t(x)\) satisfies some conditions and \(h_2(x,N(x, P))\) an expression involving \(x\) and the output from the neural network \(N(x,P)\) with \(P \) being the collection of the weights and biases for each layer. For now, it is assumed that the network consists of one input layer, one hidden layer, and one output layer.
+
+
+Setup of Network
+In this network, there are no weights and bias at the input layer, so \(P = \{ P_{\text{hidden}}, P_{\text{output}} \}\) .
+If there are \(N_{\text{hidden} }\) neurons in the hidden layer, then \(P_{\text{hidden}}\) is a \(N_{\text{hidden} } \times (1 + N_{\text{input}})\) matrix, given that there are \(N_{\text{input}}\) neurons in the input layer.
+The first column in \(P_{\text{hidden} }\) represents the bias for each neuron in the hidden layer and the second column represents the weights for each neuron in the hidden layer from the input layer.
+If there are \(N_{\text{output} }\) neurons in the output layer, then \(P_{\text{output}} \) is a \(N_{\text{output} } \times (1 + N_{\text{hidden} })\) matrix.
+Its first column represents the bias of each neuron and the remaining columns represents the weights to each neuron.
+It is given that \(g(0) = g_0\) . The trial solution must fulfill this condition to be a proper solution of (6 ). A possible way to ensure that \(g_t(0, P) = g_0\) , is to let \(F(N(x,P)) = x \cdot N(x,P)\) and \(A(x) = g_0\) . This gives the following trial solution:
+
+
+
+\[
+\begin{equation} \label{trial} \tag{7}
+g_t(x, P) = g_0 + x \cdot N(x, P)
+\end{equation}
+\]
+
+
+
+More technicalities
+The left hand side and right hand side of (8 ) must be computed separately, and then the neural network must choose weights and biases, contained in \(P\) , such that the sides are equal as best as possible.
+This means that the absolute or squared difference between the sides must be as close to zero, ideally equal to zero.
+In this case, the difference squared shows to be an appropriate measurement of how erroneous the trial solution is with respect to \(P\) of the neural network.
+This gives the following cost function our neural network must solve for:
+
+\[
+\min_{P}\Big\{ \big(g_t'(x, P) - ( -\gamma g_t(x, P) \big)^2 \Big\}
+\]
+(the notation \(\min_{P}\{ f(x, P) \}\) means that we desire to find \(P\) that yields the minimum of \(f(x, P)\) )
+or, in terms of weights and biases for the hidden and output layer in our network:
+
+\[
+\min_{P_{\text{hidden} }, \ P_{\text{output} }}\Big\{ \big(g_t'(x, \{ P_{\text{hidden} }, P_{\text{output} }\}) - ( -\gamma g_t(x, \{ P_{\text{hidden} }, P_{\text{output} }\}) \big)^2 \Big\}
+\]
+for an input value \(x\) .
+
+
+More details
+If the neural network evaluates \(g_t(x, P)\) at more values for \(x\) , say \(N\) values \(x_i\) for \(i = 1, \dots, N\) , then the total error to minimize becomes
+
+
+
+\[
+\begin{equation} \label{min} \tag{9}
+\min_{P}\Big\{\frac{1}{N} \sum_{i=1}^N \big(g_t'(x_i, P) - ( -\gamma g_t(x_i, P) \big)^2 \Big\}
+\end{equation}
+\]
+Letting \(\boldsymbol{x}\) be a vector with elements \(x_i\) and \(C(\boldsymbol{x}, P) = \frac{1}{N} \sum_i \big(g_t'(x_i, P) - ( -\gamma g_t(x_i, P) \big)^2\) denote the cost function, the minimization problem that our network must solve, becomes
+
+\[
+\min_{P} C(\boldsymbol{x}, P)
+\]
+In terms of \(P_{\text{hidden} }\) and \(P_{\text{output} }\) , this could also be expressed as
+
+\[
+\min_{P_{\text{hidden} }, \ P_{\text{output} }} C(\boldsymbol{x}, \{P_{\text{hidden} }, P_{\text{output} }\})
+\]
+
+
+A possible implementation of a neural network
+For simplicity, it is assumed that the input is an array \(\boldsymbol{x} = (x_1, \dots, x_N)\) with \(N\) elements. It is at these points the neural network should find \(P\) such that it fulfills (9 ).
+First, the neural network must feed forward the inputs.
+This means that \(\boldsymbol{x}s\) must be passed through an input layer, a hidden layer and a output layer. The input layer in this case, does not need to process the data any further.
+The input layer will consist of \(N_{\text{input} }\) neurons, passing its element to each neuron in the hidden layer. The number of neurons in the hidden layer will be \(N_{\text{hidden} }\) .
+
+
+Technicalities
+For the \(i\) -th in the hidden layer with weight \(w_i^{\text{hidden} }\) and bias \(b_i^{\text{hidden} }\) , the weighting from the \(j\) -th neuron at the input layer is:
+
+\[\begin{split}
+\begin{aligned}
+z_{i,j}^{\text{hidden}} &= b_i^{\text{hidden}} + w_i^{\text{hidden}}x_j \\
+&=
+\begin{pmatrix}
+b_i^{\text{hidden}} & w_i^{\text{hidden}}
+\end{pmatrix}
+\begin{pmatrix}
+1 \\
+x_j
+\end{pmatrix}
+\end{aligned}
+\end{split}\]
+
+
+Final technicalities I
+The result after weighting the inputs at the \(i\) -th hidden neuron can be written as a vector:
+
+\[\begin{split}
+\begin{aligned}
+\boldsymbol{z}_{i}^{\text{hidden}} &= \Big( b_i^{\text{hidden}} + w_i^{\text{hidden}}x_1 , \ b_i^{\text{hidden}} + w_i^{\text{hidden}} x_2, \ \dots \, , \ b_i^{\text{hidden}} + w_i^{\text{hidden}} x_N\Big) \\
+&=
+\begin{pmatrix}
+ b_i^{\text{hidden}} & w_i^{\text{hidden}}
+\end{pmatrix}
+\begin{pmatrix}
+1 & 1 & \dots & 1 \\
+x_1 & x_2 & \dots & x_N
+\end{pmatrix} \\
+&= \boldsymbol{p}_{i, \text{hidden}}^T X
+\end{aligned}
+\end{split}\]
+
+
+Final technicalities II
+The vector \(\boldsymbol{p}_{i, \text{hidden}}^T\) constitutes each row in \(P_{\text{hidden} }\) , which contains the weights for the neural network to minimize according to (9 ).
+After having found \(\boldsymbol{z}_{i}^{\text{hidden}} \) for every \(i\) -th neuron within the hidden layer, the vector will be sent to an activation function \(a_i(\boldsymbol{z})\) .
+In this example, the sigmoid function has been chosen to be the activation function for each hidden neuron:
+
+\[
+f(z) = \frac{1}{1 + \exp{(-z)}}
+\]
+It is possible to use other activations functions for the hidden layer also.
+The output \(\boldsymbol{x}_i^{\text{hidden}}\) from each \(i\) -th hidden neuron is:
+
+\[
+\boldsymbol{x}_i^{\text{hidden} } = f\big( \boldsymbol{z}_{i}^{\text{hidden}} \big)
+\]
+The outputs \(\boldsymbol{x}_i^{\text{hidden} } \) are then sent to the output layer.
+The output layer consists of one neuron in this case, and combines the
+output from each of the neurons in the hidden layers. The output layer
+combines the results from the hidden layer using some weights \(w_i^{\text{output}}\)
+and biases \(b_i^{\text{output}}\) . In this case,
+it is assumes that the number of neurons in the output layer is one.
+
+
+Final technicalities III
+The procedure of weighting the output neuron \(j\) in the hidden layer to the \(i\) -th neuron in the output layer is similar as for the hidden layer described previously.
+
+\[\begin{split}
+\begin{aligned}
+z_{1,j}^{\text{output}} & =
+\begin{pmatrix}
+b_1^{\text{output}} & \boldsymbol{w}_1^{\text{output}}
+\end{pmatrix}
+\begin{pmatrix}
+1 \\
+\boldsymbol{x}_j^{\text{hidden}}
+\end{pmatrix}
+\end{aligned}
+\end{split}\]
+
+
+Final technicalities IV
+Expressing \(z_{1,j}^{\text{output}}\) as a vector gives the following way of weighting the inputs from the hidden layer:
+
+\[\begin{split}
+\boldsymbol{z}_{1}^{\text{output}} =
+\begin{pmatrix}
+b_1^{\text{output}} & \boldsymbol{w}_1^{\text{output}}
+\end{pmatrix}
+\begin{pmatrix}
+1 & 1 & \dots & 1 \\
+\boldsymbol{x}_1^{\text{hidden}} & \boldsymbol{x}_2^{\text{hidden}} & \dots & \boldsymbol{x}_N^{\text{hidden}}
+\end{pmatrix}
+\end{split}\]
+In this case we seek a continuous range of values since we are approximating a function. This means that after computing \(\boldsymbol{z}_{1}^{\text{output}}\) the neural network has finished its feed forward step, and \(\boldsymbol{z}_{1}^{\text{output}}\) is the final output of the network.
+
+
+Back propagation
+The next step is to decide how the parameters should be changed such that they minimize the cost function.
+The chosen cost function for this problem is
+
+\[
+C(\boldsymbol{x}, P) = \frac{1}{N} \sum_i \big(g_t'(x_i, P) - ( -\gamma g_t(x_i, P) \big)^2
+\]
+In order to minimize the cost function, an optimization method must be chosen.
+Here, gradient descent with a constant step size has been chosen.
+
+
+Gradient descent
+The idea of the gradient descent algorithm is to update parameters in
+a direction where the cost function decreases goes to a minimum.
+In general, the update of some parameters \(\boldsymbol{\omega}\) given a cost
+function defined by some weights \(\boldsymbol{\omega}\) , \(C(\boldsymbol{x},
+\boldsymbol{\omega})\) , goes as follows:
+
+\[
+\boldsymbol{\omega}_{\text{new} } = \boldsymbol{\omega} - \lambda \nabla_{\boldsymbol{\omega}} C(\boldsymbol{x}, \boldsymbol{\omega})
+\]
+for a number of iterations or until \( \big|\big| \boldsymbol{\omega}_{\text{new} } - \boldsymbol{\omega} \big|\big|\) becomes smaller than some given tolerance.
+The value of \(\lambda\) decides how large steps the algorithm must take
+in the direction of \( \nabla_{\boldsymbol{\omega}} C(\boldsymbol{x}, \boldsymbol{\omega})\) .
+The notation \(\nabla_{\boldsymbol{\omega}}\) express the gradient with respect
+to the elements in \(\boldsymbol{\omega}\) .
+In our case, we have to minimize the cost function \(C(\boldsymbol{x}, P)\) with
+respect to the two sets of weights and biases, that is for the hidden
+layer \(P_{\text{hidden} }\) and for the output layer \(P_{\text{output}
+}\) .
+This means that \(P_{\text{hidden} }\) and \(P_{\text{output} }\) is updated by
+
+\[\begin{split}
+\begin{aligned}
+P_{\text{hidden},\text{new}} &= P_{\text{hidden}} - \lambda \nabla_{P_{\text{hidden}}} C(\boldsymbol{x}, P) \\
+P_{\text{output},\text{new}} &= P_{\text{output}} - \lambda \nabla_{P_{\text{output}}} C(\boldsymbol{x}, P)
+\end{aligned}
+\end{split}\]
+
+
+The code for solving the ODE
+
+
+
+
+Example: Population growth
+A logistic model of population growth assumes that a population converges toward an equilibrium.
+The population growth can be modeled by
+
+
+
+\[
+\begin{equation} \label{log} \tag{10}
+ g'(t) = \alpha g(t)(A - g(t))
+\end{equation}
+\]
+where \(g(t)\) is the population density at time \(t\) , \(\alpha > 0\) the growth rate and \(A > 0\) is the maximum population number in the environment.
+Also, at \(t = 0\) the population has the size \(g(0) = g_0\) , where \(g_0\) is some chosen constant.
+In this example, similar network as for the exponential decay using Autograd has been used to solve the equation. However, as the implementation might suffer from e.g numerical instability
+and high execution time (this might be more apparent in the examples solving PDEs),
+using a library like TensorFlow is recommended.
+Here, we stay with a more simple approach and implement for comparison, the simple forward Euler method.
+
+
+Setting up the problem
+Here, we will model a population \(g(t)\) in an environment having carrying capacity \(A\) .
+The population follows the model
+
+
+
+\[
+\begin{equation} \label{solveode_population} \tag{11}
+g'(t) = \alpha g(t)(A - g(t))
+\end{equation}
+\]
+where \(g(0) = g_0\) .
+In this example, we let \(\alpha = 2\) , \(A = 1\) , and \(g_0 = 1.2\) .
+
+
+The trial solution
+We will get a slightly different trial solution, as the boundary conditions are different
+compared to the case for exponential decay.
+A possible trial solution satisfying the condition \(g(0) = g_0\) could be
+
+\[
+h_1(t) = g_0 + t \cdot N(t,P)
+\]
+with \(N(t,P)\) being the output from the neural network with weights and biases for each layer collected in the set \(P\) .
+The analytical solution is
+
+\[
+g(t) = \frac{Ag_0}{g_0 + (A - g_0)\exp(-\alpha A t)}
+\]
+
+
+The program using Autograd
+The network will be the similar as for the exponential decay example, but with some small modifications for our problem.
+
+
+
+Using forward Euler to solve the ODE
+A straightforward way of solving an ODE numerically, is to use Euler’s method.
+Euler’s method uses Taylor series to approximate the value at a function \(f\) at a step \(\Delta x\) from \(x\) :
+
+\[
+f(x + \Delta x) \approx f(x) + \Delta x f'(x)
+\]
+In our case, using Euler’s method to approximate the value of \(g\) at a step \(\Delta t\) from \(t\) yields
+
+\[\begin{split}
+\begin{aligned}
+ g(t + \Delta t) &\approx g(t) + \Delta t g'(t) \\
+ &= g(t) + \Delta t \big(\alpha g(t)(A - g(t))\big)
+\end{aligned}
+\end{split}\]
+along with the condition that \(g(0) = g_0\) .
+Let \(t_i = i \cdot \Delta t\) where \(\Delta t = \frac{T}{N_t-1}\) where \(T\) is the final time our solver must solve for and \(N_t\) the number of values for \(t \in [0, T]\) for \(i = 0, \dots, N_t-1\) .
+For \(i \geq 1\) , we have that
+
+\[\begin{split}
+\begin{aligned}
+t_i &= i\Delta t \\
+&= (i - 1)\Delta t + \Delta t \\
+&= t_{i-1} + \Delta t
+\end{aligned}
+\end{split}\]
+Now, if \(g_i = g(t_i)\) then
+
+
+
+\[\begin{split}
+\begin{equation}
+ \begin{aligned}
+ g_i &= g(t_i) \\
+ &= g(t_{i-1} + \Delta t) \\
+ &\approx g(t_{i-1}) + \Delta t \big(\alpha g(t_{i-1})(A - g(t_{i-1}))\big) \\
+ &= g_{i-1} + \Delta t \big(\alpha g_{i-1}(A - g_{i-1})\big)
+ \end{aligned}
+\end{equation} \label{odenum} \tag{12}
+\end{split}\]
+for \(i \geq 1\) and \(g_0 = g(t_0) = g(0) = g_0\) .
+Equation (12 ) could be implemented in the following way,
+extending the program that uses the network using Autograd:
+
+
+
+Example: Solving the one dimensional Poisson equation
+The Poisson equation for \(g(x)\) in one dimension is
+
+
+
+\[
+\begin{equation} \label{poisson} \tag{13}
+ -g''(x) = f(x)
+\end{equation}
+\]
+where \(f(x)\) is a given function for \(x \in (0,1)\) .
+The conditions that \(g(x)\) is chosen to fulfill, are
+
+\[\begin{split}
+\begin{align*}
+ g(0) &= 0 \\
+ g(1) &= 0
+\end{align*}
+\end{split}\]
+This equation can be solved numerically using programs where e.g Autograd and TensorFlow are used.
+The results from the networks can then be compared to the analytical solution.
+In addition, it could be interesting to see how a typical method for numerically solving second order ODEs compares to the neural networks.
+
+
+The specific equation to solve for
+Here, the function \(g(x)\) to solve for follows the equation
+
+\[
+-g''(x) = f(x),\qquad x \in (0,1)
+\]
+where \(f(x)\) is a given function, along with the chosen conditions
+
+
+
+\[
+\begin{aligned}
+g(0) = g(1) = 0
+\end{aligned}\label{cond} \tag{14}
+\]
+In this example, we consider the case when \(f(x) = (3x + x^2)\exp(x)\) .
+For this case, a possible trial solution satisfying the conditions could be
+
+\[
+g_t(x) = x \cdot (1-x) \cdot N(P,x)
+\]
+The analytical solution for this problem is
+
+\[
+g(x) = x(1 - x)\exp(x)
+\]
+
+
+Solving the equation using Autograd
+
+
+
+Comparing with a numerical scheme
+The Poisson equation is possible to solve using Taylor series to approximate the second derivative.
+Using Taylor series, the second derivative can be expressed as
+
+\[
+g''(x) = \frac{g(x + \Delta x) - 2g(x) + g(x-\Delta x)}{\Delta x^2} + E_{\Delta x}(x)
+\]
+where \(\Delta x\) is a small step size and \(E_{\Delta x}(x)\) being the error term.
+Looking away from the error terms gives an approximation to the second derivative:
+
+
+
+\[
+\begin{equation} \label{approx} \tag{15}
+g''(x) \approx \frac{g(x + \Delta x) - 2g(x) + g(x-\Delta x)}{\Delta x^2}
+\end{equation}
+\]
+If \(x_i = i \Delta x = x_{i-1} + \Delta x\) and \(g_i = g(x_i)\) for \(i = 1,\dots N_x - 2\) with \(N_x\) being the number of values for \(x\) , (15 ) becomes
+
+\[\begin{split}
+\begin{aligned}
+g''(x_i) &\approx \frac{g(x_i + \Delta x) - 2g(x_i) + g(x_i -\Delta x)}{\Delta x^2} \\
+&= \frac{g_{i+1} - 2g_i + g_{i-1}}{\Delta x^2}
+\end{aligned}
+\end{split}\]
+Since we know from our problem that
+
+\[\begin{split}
+\begin{aligned}
+-g''(x) &= f(x) \\
+&= (3x + x^2)\exp(x)
+\end{aligned}
+\end{split}\]
+along with the conditions \(g(0) = g(1) = 0\) ,
+the following scheme can be used to find an approximate solution for \(g(x)\) numerically:
+
+
+
+\[\begin{split}
+\begin{equation}
+ \begin{aligned}
+ -\Big( \frac{g_{i+1} - 2g_i + g_{i-1}}{\Delta x^2} \Big) &= f(x_i) \\
+ -g_{i+1} + 2g_i - g_{i-1} &= \Delta x^2 f(x_i)
+ \end{aligned}
+\end{equation} \label{odesys} \tag{16}
+\end{split}\]
+for \(i = 1, \dots, N_x - 2\) where \(g_0 = g_{N_x - 1} = 0\) and \(f(x_i) = (3x_i + x_i^2)\exp(x_i)\) , which is given for our specific problem.
+The equation can be rewritten into a matrix equation:
+
+\[\begin{split}
+\begin{aligned}
+\begin{pmatrix}
+2 & -1 & 0 & \dots & 0 \\
+-1 & 2 & -1 & \dots & 0 \\
+\vdots & & \ddots & & \vdots \\
+0 & \dots & -1 & 2 & -1 \\
+0 & \dots & 0 & -1 & 2\\
+\end{pmatrix}
+\begin{pmatrix}
+g_1 \\
+g_2 \\
+\vdots \\
+g_{N_x - 3} \\
+g_{N_x - 2}
+\end{pmatrix}
+&=
+\Delta x^2
+\begin{pmatrix}
+f(x_1) \\
+f(x_2) \\
+\vdots \\
+f(x_{N_x - 3}) \\
+f(x_{N_x - 2})
+\end{pmatrix} \\
+\boldsymbol{A}\boldsymbol{g} &= \boldsymbol{f},
+\end{aligned}
+\end{split}\]
+which makes it possible to solve for the vector \(\boldsymbol{g}\) .
+
+
+Setting up the code
+We can then compare the result from this numerical scheme with the output from our network using Autograd:
+
+
+
+Partial Differential Equations
+A partial differential equation (PDE) has a solution here the function
+is defined by multiple variables. The equation may involve all kinds
+of combinations of which variables the function is differentiated with
+respect to.
+In general, a partial differential equation for a function \(g(x_1,\dots,x_N)\) with \(N\) variables may be expressed as
+
+
+
+\[
+\begin{equation} \label{PDE} \tag{17}
+ f\left(x_1, \, \dots \, , x_N, \frac{\partial g(x_1,\dots,x_N) }{\partial x_1}, \dots , \frac{\partial g(x_1,\dots,x_N) }{\partial x_N}, \frac{\partial g(x_1,\dots,x_N) }{\partial x_1\partial x_2}, \, \dots \, , \frac{\partial^n g(x_1,\dots,x_N) }{\partial x_N^n} \right) = 0
+\end{equation}
+\]
+where \(f\) is an expression involving all kinds of possible mixed derivatives of \(g(x_1,\dots,x_N)\) up to an order \(n\) . In order for the solution to be unique, some additional conditions must also be given.
+
+
+Type of problem
+The problem our network must solve for, is similar to the ODE case.
+We must have a trial solution \(g_t\) at hand.
+For instance, the trial solution could be expressed as
+
+\[
+\begin{align*}
+ g_t(x_1,\dots,x_N) = h_1(x_1,\dots,x_N) + h_2(x_1,\dots,x_N,N(x_1,\dots,x_N,P))
+\end{align*}
+\]
+where \(h_1(x_1,\dots,x_N)\) is a function that ensures \(g_t(x_1,\dots,x_N)\) satisfies some given conditions.
+The neural network \(N(x_1,\dots,x_N,P)\) has weights and biases described by \(P\) and \(h_2(x_1,\dots,x_N,N(x_1,\dots,x_N,P))\) is an expression using the output from the neural network in some way.
+The role of the function \(h_2(x_1,\dots,x_N,N(x_1,\dots,x_N,P))\) , is to ensure that the output of \(N(x_1,\dots,x_N,P)\) is zero when \(g_t(x_1,\dots,x_N)\) is evaluated at the values of \(x_1,\dots,x_N\) where the given conditions must be satisfied. The function \(h_1(x_1,\dots,x_N)\) should alone make \(g_t(x_1,\dots,x_N)\) satisfy the conditions.
+
+
+Network requirements
+The network tries then the minimize the cost function following the
+same ideas as described for the ODE case, but now with more than one
+variables to consider. The concept still remains the same; find a set
+of parameters \(P\) such that the expression \(f\) in (17 ) is as
+close to zero as possible.
+As for the ODE case, the cost function is the mean squared error that
+the network must try to minimize. The cost function for the network to
+minimize is
+
+\[
+C\left(x_1, \dots, x_N, P\right) = \left( f\left(x_1, \, \dots \, , x_N, \frac{\partial g(x_1,\dots,x_N) }{\partial x_1}, \dots , \frac{\partial g(x_1,\dots,x_N) }{\partial x_N}, \frac{\partial g(x_1,\dots,x_N) }{\partial x_1\partial x_2}, \, \dots \, , \frac{\partial^n g(x_1,\dots,x_N) }{\partial x_N^n} \right) \right)^2
+\]
+
+
+More details
+If we let \(\boldsymbol{x} = \big( x_1, \dots, x_N \big)\) be an array containing the values for \(x_1, \dots, x_N\) respectively, the cost function can be reformulated into the following:
+
+\[
+C\left(\boldsymbol{x}, P\right) = f\left( \left( \boldsymbol{x}, \frac{\partial g(\boldsymbol{x}) }{\partial x_1}, \dots , \frac{\partial g(\boldsymbol{x}) }{\partial x_N}, \frac{\partial g(\boldsymbol{x}) }{\partial x_1\partial x_2}, \, \dots \, , \frac{\partial^n g(\boldsymbol{x}) }{\partial x_N^n} \right) \right)^2
+\]
+If we also have \(M\) different sets of values for \(x_1, \dots, x_N\) , that is \(\boldsymbol{x}_i = \big(x_1^{(i)}, \dots, x_N^{(i)}\big)\) for \(i = 1,\dots,M\) being the rows in matrix \(X\) , the cost function can be generalized into
+
+\[
+C\left(X, P \right) = \sum_{i=1}^M f\left( \left( \boldsymbol{x}_i, \frac{\partial g(\boldsymbol{x}_i) }{\partial x_1}, \dots , \frac{\partial g(\boldsymbol{x}_i) }{\partial x_N}, \frac{\partial g(\boldsymbol{x}_i) }{\partial x_1\partial x_2}, \, \dots \, , \frac{\partial^n g(\boldsymbol{x}_i) }{\partial x_N^n} \right) \right)^2.
+\]
+
+
+Example: The diffusion equation
+In one spatial dimension, the equation reads
+
+\[
+\frac{\partial g(x,t)}{\partial t} = \frac{\partial^2 g(x,t)}{\partial x^2}
+\]
+where a possible choice of conditions are
+
+\[\begin{split}
+\begin{align*}
+g(0,t) &= 0 ,\qquad t \geq 0 \\
+g(1,t) &= 0, \qquad t \geq 0 \\
+g(x,0) &= u(x),\qquad x\in [0,1]
+\end{align*}
+\end{split}\]
+with \(u(x)\) being some given function.
+
+
+Defining the problem
+For this case, we want to find \(g(x,t)\) such that
+
+
+
+\[
+\begin{equation}
+ \frac{\partial g(x,t)}{\partial t} = \frac{\partial^2 g(x,t)}{\partial x^2}
+\end{equation} \label{diffonedim} \tag{18}
+\]
+and
+
+\[\begin{split}
+\begin{align*}
+g(0,t) &= 0 ,\qquad t \geq 0 \\
+g(1,t) &= 0, \qquad t \geq 0 \\
+g(x,0) &= u(x),\qquad x\in [0,1]
+\end{align*}
+\end{split}\]
+with \(u(x) = \sin(\pi x)\) .
+First, let us set up the deep neural network.
+The deep neural network will follow the same structure as discussed in the examples solving the ODEs.
+First, we will look into how Autograd could be used in a network tailored to solve for bivariate functions.
+
+
+Setting up the network using Autograd
+The only change to do here, is to extend our network such that
+functions of multiple parameters are correctly handled. In this case
+we have two variables in our function to solve for, that is time \(t\)
+and position \(x\) . The variables will be represented by a
+one-dimensional array in the program. The program will evaluate the
+network at each possible pair \((x,t)\) , given an array for the desired
+\(x\) -values and \(t\) -values to approximate the solution at.
+
+
+
+Setting up the network using Autograd; The trial solution
+The cost function must then iterate through the given arrays
+containing values for \(x\) and \(t\) , defines a point \((x,t)\) the deep
+neural network and the trial solution is evaluated at, and then finds
+the Jacobian of the trial solution.
+A possible trial solution for this PDE is
+
+\[
+g_t(x,t) = h_1(x,t) + x(1-x)tN(x,t,P)
+\]
+with \(A(x,t)\) being a function ensuring that \(g_t(x,t)\) satisfies our given conditions, and \(N(x,t,P)\) being the output from the deep neural network using weights and biases for each layer from \(P\) .
+To fulfill the conditions, \(A(x,t)\) could be:
+
+\[
+h_1(x,t) = (1-t)\Big(u(x) - \big((1-x)u(0) + x u(1)\big)\Big) = (1-t)u(x) = (1-t)\sin(\pi x)
+\]
+since \((0) = u(1) = 0\) and \(u(x) = \sin(\pi x)\) .
+
+
+Why the jacobian?
+The Jacobian is used because the program must find the derivative of
+the trial solution with respect to \(x\) and \(t\) .
+This gives the necessity of computing the Jacobian matrix, as we want
+to evaluate the gradient with respect to \(x\) and \(t\) (note that the
+Jacobian of a scalar-valued multivariate function is simply its
+gradient).
+In Autograd, the differentiation is by default done with respect to
+the first input argument of your Python function. Since the points is
+an array representing \(x\) and \(t\) , the Jacobian is calculated using
+the values of \(x\) and \(t\) .
+To find the second derivative with respect to \(x\) and \(t\) , the
+Jacobian can be found for the second time. The result is a Hessian
+matrix, which is the matrix containing all the possible second order
+mixed derivatives of \(g(x,t)\) .
+
+
+
+Setting up the network using Autograd; The full program
+Having set up the network, along with the trial solution and cost function, we can now see how the deep neural network performs by comparing the results to the analytical solution.
+The analytical solution of our problem is
+
+\[
+g(x,t) = \exp(-\pi^2 t)\sin(\pi x)
+\]
+A possible way to implement a neural network solving the PDE, is given below.
+Be aware, though, that it is fairly slow for the parameters used.
+A better result is possible, but requires more iterations, and thus longer time to complete.
+Indeed, the program below is not optimal in its implementation, but rather serves as an example on how to implement and use a neural network to solve a PDE.
+Using TensorFlow results in a much better execution time. Try it!
+
+
+
+Example: Solving the wave equation with Neural Networks
+The wave equation is
+
+\[
+\frac{\partial^2 g(x,t)}{\partial t^2} = c^2\frac{\partial^2 g(x,t)}{\partial x^2}
+\]
+with \(c\) being the specified wave speed.
+Here, the chosen conditions are
+
+\[\begin{split}
+\begin{align*}
+ g(0,t) &= 0 \\
+ g(1,t) &= 0 \\
+ g(x,0) &= u(x) \\
+ \frac{\partial g(x,t)}{\partial t} \Big |_{t = 0} &= v(x)
+\end{align*}
+\end{split}\]
+where \(\frac{\partial g(x,t)}{\partial t} \Big |_{t = 0}\) means the derivative of \(g(x,t)\) with respect to \(t\) is evaluated at \(t = 0\) , and \(u(x)\) and \(v(x)\) being given functions.
+
+
+The problem to solve for
+The wave equation to solve for, is
+
+
+
+\[
+\begin{equation} \label{wave} \tag{19}
+\frac{\partial^2 g(x,t)}{\partial t^2} = c^2 \frac{\partial^2 g(x,t)}{\partial x^2}
+\end{equation}
+\]
+where \(c\) is the given wave speed.
+The chosen conditions for this equation are
+
+
+
+\[\begin{split}
+\begin{aligned}
+g(0,t) &= 0, &t \geq 0 \\
+g(1,t) &= 0, &t \geq 0 \\
+g(x,0) &= u(x), &x\in[0,1] \\
+\frac{\partial g(x,t)}{\partial t}\Big |_{t = 0} &= v(x), &x \in [0,1]
+\end{aligned} \label{condwave} \tag{20}
+\end{split}\]
+In this example, let \(c = 1\) and \(u(x) = \sin(\pi x)\) and \(v(x) = -\pi\sin(\pi x)\) .
+
+
+The trial solution
+Setting up the network is done in similar matter as for the example of solving the diffusion equation.
+The only things we have to change, is the trial solution such that it satisfies the conditions from (20 ) and the cost function.
+The trial solution becomes slightly different since we have other conditions than in the example of solving the diffusion equation. Here, a possible trial solution \(g_t(x,t)\) is
+
+\[
+g_t(x,t) = h_1(x,t) + x(1-x)t^2N(x,t,P)
+\]
+where
+
+\[
+h_1(x,t) = (1-t^2)u(x) + tv(x)
+\]
+Note that this trial solution satisfies the conditions only if \(u(0) = v(0) = u(1) = v(1) = 0\) , which is the case in this example.
+
+
+The analytical solution
+The analytical solution for our specific problem, is
+
+\[
+g(x,t) = \sin(\pi x)\cos(\pi t) - \sin(\pi x)\sin(\pi t)
+\]
+
+
+Solving the wave equation - the full program using Autograd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/LectureNotes/_build/jupyter_execute/exercisesweek43.ipynb b/doc/LectureNotes/_build/jupyter_execute/exercisesweek43.ipynb
new file mode 100644
index 000000000..20e5e5ba1
--- /dev/null
+++ b/doc/LectureNotes/_build/jupyter_execute/exercisesweek43.ipynb
@@ -0,0 +1,617 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "860d70d8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "119c0988",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Exercises week 43 \n",
+ "**October 20-24, 2025**\n",
+ "\n",
+ "Date: **Deadline Friday October 24 at midnight**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "909887eb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Overarching aims of the exercises weeks 43 and 44\n",
+ "\n",
+ "The aim of the exercises this week is to gain some confidence with\n",
+ "ways to visualize the results of a classification problem. We will\n",
+ "target three ways of setting up the analysis. The first and simplest\n",
+ "one is the\n",
+ "1. so-called confusion matrix, and the next is the\n",
+ "\n",
+ "2. ROC curve and finally the\n",
+ "\n",
+ "3. Cumulative gain curve.\n",
+ "\n",
+ "We will use Logistic Regression as method for the classification in\n",
+ "this exercise. You can compare these results with those obtained with\n",
+ "your neural network code from project 2 without a hidden layer.\n",
+ "\n",
+ "In these exercises we will use binary and multi-class data sets\n",
+ "(the Iris data set from week 41).\n",
+ "\n",
+ "The underlying mathematics is described here."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1e1cb4fb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Confusion Matrix\n",
+ "\n",
+ "A **confusion matrix** summarizes a classifier’s performance by\n",
+ "tabulating predictions versus true labels. For binary classification,\n",
+ "it is a $2\\times2$ table whose entries are counts of outcomes:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7b090385",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{array}{l|cc} & \\text{Predicted Positive} & \\text{Predicted Negative} \\\\ \\hline \\text{Actual Positive} & TP & FN \\\\ \\text{Actual Negative} & FP & TN \\end{array}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1e14904b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Here TP (true positives) is the number of cases correctly predicted as\n",
+ "positive, FP (false positives) is the number incorrectly predicted as\n",
+ "positive, TN (true negatives) is correctly predicted negative, and FN\n",
+ "(false negatives) is incorrectly predicted negative . In other words,\n",
+ "“positive” means class 1 and “negative” means class 0; for example, TP\n",
+ "occurs when the prediction and actual are both positive. Formally:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e93ea290",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\text{TPR} = \\frac{\\text{TP}}{\\text{TP} + \\text{FN}}, \\quad \\text{FPR} = \\frac{\\text{FP}}{\\text{FP} + \\text{TN}},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c80bea5b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where TPR and FPR are the true and false positive rates defined below.\n",
+ "\n",
+ "In multiclass classification with $K$ classes, the confusion matrix\n",
+ "generalizes to a $K\\times K$ table. Entry $N_{ij}$ in the table is\n",
+ "the count of instances whose true class is $i$ and whose predicted\n",
+ "class is $j$. For example, a three-class confusion matrix can be written\n",
+ "as:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a0f68f5f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{array}{c|ccc} & \\text{Pred Class 1} & \\text{Pred Class 2} & \\text{Pred Class 3} \\\\ \\hline \\text{Act Class 1} & N_{11} & N_{12} & N_{13} \\\\ \\text{Act Class 2} & N_{21} & N_{22} & N_{23} \\\\ \\text{Act Class 3} & N_{31} & N_{32} & N_{33} \\end{array}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "869669b2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Here the diagonal entries $N_{ii}$ are the true positives for each\n",
+ "class, and off-diagonal entries are misclassifications. This matrix\n",
+ "allows computation of per-class metrics: e.g. for class $i$,\n",
+ "$\\mathrm{TP}_i=N_{ii}$, $\\mathrm{FN}_i=\\sum_{j\\neq i}N_{ij}$,\n",
+ "$\\mathrm{FP}_i=\\sum_{j\\neq i}N_{ji}$, and $\\mathrm{TN}_i$ is the sum of\n",
+ "all remaining entries.\n",
+ "\n",
+ "As defined above, TPR and FPR come from the binary case. In binary\n",
+ "terms with $P$ actual positives and $N$ actual negatives, one has"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2abd82a7",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\text{TPR} = \\frac{TP}{P} = \\frac{TP}{TP+FN}, \\quad \\text{FPR} =\n",
+ "\\frac{FP}{N} = \\frac{FP}{FP+TN},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2f79325c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "as used in standard confusion-matrix\n",
+ "formulations. These rates will be used in constructing ROC curves."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0ce65a47",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### ROC Curve\n",
+ "\n",
+ "The Receiver Operating Characteristic (ROC) curve plots the trade-off\n",
+ "between true positives and false positives as a discrimination\n",
+ "threshold varies. Specifically, for a binary classifier that outputs\n",
+ "a score or probability, one varies the threshold $t$ for declaring\n",
+ "**positive**, and computes at each $t$ the true positive rate\n",
+ "$\\mathrm{TPR}(t)$ and false positive rate $\\mathrm{FPR}(t)$ using the\n",
+ "confusion matrix at that threshold. The ROC curve is then the graph\n",
+ "of TPR versus FPR. By definition,"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d750fdff",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\mathrm{TPR} = \\frac{TP}{TP+FN}, \\qquad \\mathrm{FPR} = \\frac{FP}{FP+TN},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "561bfb2c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $TP,FP,TN,FN$ are counts determined by threshold $t$. A perfect\n",
+ "classifier would reach the point (FPR=0, TPR=1) at some threshold.\n",
+ "\n",
+ "Formally, the ROC curve is obtained by plotting\n",
+ "$(\\mathrm{FPR}(t),\\mathrm{TPR}(t))$ for all $t\\in[0,1]$ (or as $t$\n",
+ "sweeps through the sorted scores). The Area Under the ROC Curve (AUC)\n",
+ "quantifies the average performance over all thresholds. It can be\n",
+ "interpreted probabilistically: $\\mathrm{AUC} =\n",
+ "\\Pr\\bigl(s(X^+)>s(X^-)\\bigr)$, the probability that a random positive\n",
+ "instance $X^+$ receives a higher score $s$ than a random negative\n",
+ "instance $X^-$ . Equivalently, the AUC is the integral under the ROC\n",
+ "curve:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5ca722fe",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\mathrm{AUC} \\;=\\; \\int_{0}^{1} \\mathrm{TPR}(f)\\,df,\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "30080a86",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $f$ ranges over FPR (or fraction of negatives). A model that guesses at random yields a diagonal ROC (AUC=0.5), whereas a perfect model yields AUC=1.0."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9e627156",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Cumulative Gain\n",
+ "\n",
+ "The cumulative gain curve (or gains chart) evaluates how many\n",
+ "positives are captured as one targets an increasing fraction of the\n",
+ "population, sorted by model confidence. To construct it, sort all\n",
+ "instances by decreasing predicted probability of the positive class.\n",
+ "Then, for the top $\\alpha$ fraction of instances, compute the fraction\n",
+ "of all actual positives that fall in this subset. In formula form, if\n",
+ "$P$ is the total number of positive instances and $P(\\alpha)$ is the\n",
+ "number of positives among the top $\\alpha$ of the data, the cumulative\n",
+ "gain at level $\\alpha$ is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3e9132ef",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\mathrm{Gain}(\\alpha) \\;=\\; \\frac{P(\\alpha)}{P}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "75be6f5c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "For example, cutting off at the top 10% of predictions yields a gain\n",
+ "equal to (positives in top 10%) divided by (total positives) .\n",
+ "Plotting $\\mathrm{Gain}(\\alpha)$ versus $\\alpha$ (often in percent)\n",
+ "gives the gain curve. The baseline (random) curve is the diagonal\n",
+ "$\\mathrm{Gain}(\\alpha)=\\alpha$, while an ideal model has a steep climb\n",
+ "toward 1.\n",
+ "\n",
+ "A related measure is the {\\em lift}, often called the gain ratio. It is the ratio of the model’s capture rate to that of random selection. Equivalently,"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e5525570",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\mathrm{Lift}(\\alpha) \\;=\\; \\frac{\\mathrm{Gain}(\\alpha)}{\\alpha}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "18ff8dc2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "A lift $>1$ indicates better-than-random targeting. In practice, gain\n",
+ "and lift charts (used e.g.\\ in marketing or imbalanced classification)\n",
+ "show how many positives can be “gained” by focusing on a fraction of\n",
+ "the population ."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c3d3fde8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Other measures: Precision, Recall, and the F$_1$ Measure\n",
+ "\n",
+ "Precision and recall (sensitivity) quantify binary classification\n",
+ "accuracy in terms of positive predictions. They are defined from the\n",
+ "confusion matrix as:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f1f14c8e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\text{Precision} = \\frac{TP}{TP + FP}, \\qquad \\text{Recall} = \\frac{TP}{TP + FN}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "422cc743",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Precision is the fraction of predicted positives that are correct, and\n",
+ "recall is the fraction of actual positives that are correctly\n",
+ "identified . A high-precision classifier makes few false-positive\n",
+ "errors, while a high-recall classifier makes few false-negative\n",
+ "errors.\n",
+ "\n",
+ "The F$_1$ score (balanced F-measure) combines precision and recall into a single metric via their harmonic mean. The usual formula is:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "621a2e8b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "F_1 =2\\frac{\\text{Precision}\\times\\text{Recall}}{\\text{Precision} + \\text{Recall}}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "62eee54a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "This can be shown to equal"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7a6a2e7a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\frac{2\\,TP}{2\\,TP + FP + FN}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b96c9ff4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "The F$_1$ score ranges from 0 (worst) to 1 (best), and balances the\n",
+ "trade-off between precision and recall.\n",
+ "\n",
+ "For multi-class classification, one computes per-class\n",
+ "precision/recall/F$_1$ (treating each class as “positive” in a\n",
+ "one-vs-rest manner) and then averages. Common averaging methods are:\n",
+ "\n",
+ "Micro-averaging: Sum all true positives, false positives, and false negatives across classes, then compute precision/recall/F$_1$ from these totals.\n",
+ "Macro-averaging: Compute the F$1$ score $F{1,i}$ for each class $i$ separately, then take the unweighted mean: $F_{1,\\mathrm{macro}} = \\frac{1}{K}\\sum_{i=1}^K F_{1,i}$ . This treats all classes equally regardless of size.\n",
+ "Weighted-averaging: Like macro-average, but weight each class’s $F_{1,i}$ by its support $n_i$ (true count): $F_{1,\\mathrm{weighted}} = \\frac{1}{N}\\sum_{i=1}^K n_i F_{1,i}$, where $N=\\sum_i n_i$. This accounts for class imbalance by giving more weight to larger classes .\n",
+ "\n",
+ "Each of these averages has different use-cases. Micro-average is\n",
+ "dominated by common classes, macro-average highlights performance on\n",
+ "rare classes, and weighted-average is a compromise. These formulas\n",
+ "and concepts allow rigorous evaluation of classifier performance in\n",
+ "both binary and multi-class settings."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9274bf3f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Exercises\n",
+ "\n",
+ "Here is a simple code example which uses the Logistic regression machinery from **scikit-learn**.\n",
+ "At the end it sets up the confusion matrix and the ROC and cumulative gain curves.\n",
+ "Feel free to use these functionalities (we don't expect you to write your own code for say the confusion matrix)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "be9ff0b9",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "%matplotlib inline\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "from sklearn.model_selection import train_test_split \n",
+ "# from sklearn.datasets import fill in the data set\n",
+ "from sklearn.linear_model import LogisticRegression\n",
+ "\n",
+ "# Load the data, fill inn\n",
+ "mydata.data = ?\n",
+ "\n",
+ "X_train, X_test, y_train, y_test = train_test_split(mydata.data,cancer.target,random_state=0)\n",
+ "print(X_train.shape)\n",
+ "print(X_test.shape)\n",
+ "# Logistic Regression\n",
+ "# define which type of problem, binary or multiclass\n",
+ "logreg = LogisticRegression(solver='lbfgs')\n",
+ "logreg.fit(X_train, y_train)\n",
+ "\n",
+ "from sklearn.preprocessing import LabelEncoder\n",
+ "from sklearn.model_selection import cross_validate\n",
+ "#Cross validation\n",
+ "accuracy = cross_validate(logreg,X_test,y_test,cv=10)['test_score']\n",
+ "print(accuracy)\n",
+ "print(\"Test set accuracy with Logistic Regression: {:.2f}\".format(logreg.score(X_test,y_test)))\n",
+ "\n",
+ "import scikitplot as skplt\n",
+ "y_pred = logreg.predict(X_test)\n",
+ "skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)\n",
+ "plt.show()\n",
+ "y_probas = logreg.predict_proba(X_test)\n",
+ "skplt.metrics.plot_roc(y_test, y_probas)\n",
+ "plt.show()\n",
+ "skplt.metrics.plot_cumulative_gain(y_test, y_probas)\n",
+ "plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "51760b3e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Exercise a)\n",
+ "\n",
+ "Convince yourself about the mathematics for the confusion matrix, the ROC and the cumlative gain curves for both a binary and a multiclass classification problem."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c1d42f5f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Exercise b)\n",
+ "\n",
+ "Use a binary classification data available from **scikit-learn**. As an example you can use\n",
+ "the MNIST data set and just specialize to two numbers. To do so you can use the following code lines"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "d20bb8be",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from sklearn.datasets import load_digits\n",
+ "digits = load_digits(n_class=2) # Load only two classes, e.g., 0 and 1\n",
+ "X, y = digits.data, digits.target"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "828ea1cd",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Alternatively, you can use the _make$\\_$classification_\n",
+ "functionality. This function generates a random $n$-class classification\n",
+ "dataset, which can be configured for binary classification by setting\n",
+ "n_classes=2. You can also control the number of samples, features,\n",
+ "informative features, redundant features, and more."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "d271f0ba",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from sklearn.datasets import make_classification\n",
+ "X, y = make_classification(n_samples=1000, n_features=20, n_informative=10, n_redundant=5, n_classes=2, random_state=42)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0068b032",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "You can use this option for the multiclass case as well, see the next exercise.\n",
+ "If you prefer to study other binary classification datasets, feel free\n",
+ "to replace the above suggestions with your own dataset.\n",
+ "\n",
+ "Make plots of the confusion matrix, the ROC curve and the cumulative gain curve."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c45f5b41",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Exercise c) week 43\n",
+ "\n",
+ "As a multiclass problem, we will use the Iris data set discussed in\n",
+ "the exercises from weeks 41 and 42. This is a three-class data set and\n",
+ "you can set it up using **scikit-learn**,"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "3b045d56",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from sklearn.datasets import load_iris\n",
+ "iris = load_iris()\n",
+ "X = iris.data # Features\n",
+ "y = iris.target # Target labels"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "14cc859c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Make plots of the confusion matrix, the ROC curve and the cumulative\n",
+ "gain curve for this (or other) multiclass data set."
+ ]
+ }
+ ],
+ "metadata": {},
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
\ No newline at end of file
diff --git a/doc/LectureNotes/_build/jupyter_execute/week43.ipynb b/doc/LectureNotes/_build/jupyter_execute/week43.ipynb
new file mode 100644
index 000000000..51c09e94a
--- /dev/null
+++ b/doc/LectureNotes/_build/jupyter_execute/week43.ipynb
@@ -0,0 +1,5948 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "b10156d4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f85baa2f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations\n",
+ "**Morten Hjorth-Jensen**, Department of Physics, University of Oslo, Norway\n",
+ "\n",
+ "Date: **October 20, 2025**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "543fad4a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Plans for week 43\n",
+ "\n",
+ "**Material for the lecture on Monday October 20, 2025.**\n",
+ "\n",
+ "1. Reminder from last week, see also lecture notes from week 42 at as well as those from week 41, see see . \n",
+ "\n",
+ "2. Building our own Feed-forward Neural Network.\n",
+ "\n",
+ "3. Coding examples using Tensorflow/Keras and Pytorch examples. The Pytorch examples are adapted from Rashcka's text, see chapters 11-13.. \n",
+ "\n",
+ "4. Start discussions on how to use neural networks for solving differential equations (ordinary and partial ones). This topic continues next week as well.\n",
+ "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "72acb4e9",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Exercises and lab session week 43\n",
+ "**Lab sessions on Tuesday and Wednesday.**\n",
+ "\n",
+ "1. Work on writing your own neural network code and discussions of project 2. If you didn't get time to do the exercises from the two last weeks, we recommend doing so as these exercises give you the basic elements of a neural network code.\n",
+ "\n",
+ "2. The exercises this week are tailored to the optional part of project 2, and deal with studying ways to display results from classification problems"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "361768dc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Using Automatic differentiation\n",
+ "\n",
+ "In our discussions of ordinary differential equations and neural network codes\n",
+ "we will also study the usage of Autograd, see for example in computing gradients for deep learning. For the documentation of Autograd and examples see the Autograd documentation at and the lecture slides from week 41, see ."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3e058671",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Back propagation and automatic differentiation\n",
+ "\n",
+ "For more details on the back propagation algorithm and automatic differentiation see\n",
+ "1. \n",
+ "\n",
+ "2. \n",
+ "\n",
+ "3. Slides 12-44 at "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8cbbf2bf",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Lecture Monday October 20"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "78e2de21",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the back propagation algorithm and algorithm for a feed forward NN, initalizations\n",
+ "This is a reminder from last week.\n",
+ "\n",
+ "**The architecture (our model).**\n",
+ "\n",
+ "1. Set up your inputs and outputs (scalars, vectors, matrices or higher-order arrays)\n",
+ "\n",
+ "2. Define the number of hidden layers and hidden nodes\n",
+ "\n",
+ "3. Define activation functions for hidden layers and output layers\n",
+ "\n",
+ "4. Define optimizer (plan learning rate, momentum, ADAgrad, RMSprop, ADAM etc) and array of initial learning rates\n",
+ "\n",
+ "5. Define cost function and possible regularization terms with hyperparameters\n",
+ "\n",
+ "6. Initialize weights and biases\n",
+ "\n",
+ "7. Fix number of iterations for the feed forward part and back propagation part"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "41a3dc23",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the back propagation algorithm, part 1\n",
+ "\n",
+ "Let us write this out in the form of an algorithm.\n",
+ "\n",
+ "**First**, we set up the input data $\\boldsymbol{x}$ and the activations\n",
+ "$\\boldsymbol{z}_1$ of the input layer and compute the activation function and\n",
+ "the pertinent outputs $\\boldsymbol{a}^1$.\n",
+ "\n",
+ "**Secondly**, we perform then the feed forward till we reach the output\n",
+ "layer and compute all $\\boldsymbol{z}_l$ of the input layer and compute the\n",
+ "activation function and the pertinent outputs $\\boldsymbol{a}^l$ for\n",
+ "$l=1,2,3,\\dots,L$.\n",
+ "\n",
+ "**Notation**: The first hidden layer has $l=1$ as label and the final output layer has $l=L$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0e4ac2c0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the back propagation algorithm, part 2\n",
+ "\n",
+ "Thereafter we compute the ouput error $\\boldsymbol{\\delta}^L$ by computing all"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e9fd2f83",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\delta_j^L = \\sigma'(z_j^L)\\frac{\\partial {\\cal C}}{\\partial (a_j^L)}.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "16e2b900",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Then we compute the back propagate error for each $l=L-1,L-2,\\dots,1$ as"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f9f4b9d8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\delta_j^l = \\sum_k \\delta_k^{l+1}w_{kj}^{l+1}\\sigma'(z_j^l).\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "01be6441",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the Back propagation algorithm, part 3\n",
+ "\n",
+ "Finally, we update the weights and the biases using gradient descent\n",
+ "for each $l=L-1,L-2,\\dots,1$ (the first hidden layer) and update the weights and biases\n",
+ "according to the rules"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ce898b85",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "w_{ij}^l\\leftarrow = w_{ij}^l- \\eta \\delta_j^la_i^{l-1},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4e2e7314",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "b_j^l \\leftarrow b_j^l-\\eta \\frac{\\partial {\\cal C}}{\\partial b_j^l}=b_j^l-\\eta \\delta_j^l,\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b7114295",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $\\eta$ being the learning rate."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "69dfa048",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Updating the gradients\n",
+ "\n",
+ "With the back propagate error for each $l=L-1,L-2,\\dots,1$ as"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6efa469c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\delta_j^l = \\sum_k \\delta_k^{l+1}w_{kj}^{l+1}\\sigma'(z_j^l),\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "076e4937",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "we update the weights and the biases using gradient descent for each $l=L-1,L-2,\\dots,1$ and update the weights and biases according to the rules"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1072f5a1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "w_{ij}^l\\leftarrow = w_{ij}^l- \\eta \\delta_j^la_i^{l-1},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f77a7074",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "b_j^l \\leftarrow b_j^l-\\eta \\frac{\\partial {\\cal C}}{\\partial b_j^l}=b_j^l-\\eta \\delta_j^l,\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f12effab",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Activation functions\n",
+ "\n",
+ "A property that characterizes a neural network, other than its\n",
+ "connectivity, is the choice of activation function(s). The following\n",
+ "restrictions are imposed on an activation function for an FFNN to\n",
+ "fulfill the universal approximation theorem\n",
+ "\n",
+ " * Non-constant\n",
+ "\n",
+ " * Bounded\n",
+ "\n",
+ " * Monotonically-increasing\n",
+ "\n",
+ " * Continuous"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "31eb54b1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Activation functions, examples\n",
+ "\n",
+ "Typical examples are the logistic *Sigmoid*"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7a549168",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\sigma(x) = \\frac{1}{1 + e^{-x}},\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ce35ae73",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "and the *hyperbolic tangent* function"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d6cdfc89",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\sigma(x) = \\tanh(x)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ddd59bb0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The RELU function family\n",
+ "\n",
+ "The ReLU activation function suffers from a problem known as the dying\n",
+ "ReLUs: during training, some neurons effectively die, meaning they\n",
+ "stop outputting anything other than 0.\n",
+ "\n",
+ "In some cases, you may find that half of your network’s neurons are\n",
+ "dead, especially if you used a large learning rate. During training,\n",
+ "if a neuron’s weights get updated such that the weighted sum of the\n",
+ "neuron’s inputs is negative, it will start outputting 0. When this\n",
+ "happen, the neuron is unlikely to come back to life since the gradient\n",
+ "of the ReLU function is 0 when its input is negative."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f2a78e55",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## ELU function\n",
+ "\n",
+ "To solve this problem, nowadays practitioners use a variant of the\n",
+ "ReLU function, such as the leaky ReLU discussed above or the so-called\n",
+ "exponential linear unit (ELU) function"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "cde73faf",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "ELU(z) = \\left\\{\\begin{array}{cc} \\alpha\\left( \\exp{(z)}-1\\right) & z < 0,\\\\ z & z \\ge 0.\\end{array}\\right.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "08048672",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Which activation function should we use?\n",
+ "\n",
+ "In general it seems that the ELU activation function is better than\n",
+ "the leaky ReLU function (and its variants), which is better than\n",
+ "ReLU. ReLU performs better than $\\tanh$ which in turn performs better\n",
+ "than the logistic function.\n",
+ "\n",
+ "If runtime performance is an issue, then you may opt for the leaky\n",
+ "ReLU function over the ELU function If you don’t want to tweak yet\n",
+ "another hyperparameter, you may just use the default $\\alpha$ of\n",
+ "$0.01$ for the leaky ReLU, and $1$ for ELU. If you have spare time and\n",
+ "computing power, you can use cross-validation or bootstrap to evaluate\n",
+ "other activation functions."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a7085280",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## More on activation functions, output layers\n",
+ "\n",
+ "In most cases you can use the ReLU activation function in the hidden\n",
+ "layers (or one of its variants).\n",
+ "\n",
+ "It is a bit faster to compute than other activation functions, and the\n",
+ "gradient descent optimization does in general not get stuck.\n",
+ "\n",
+ "**For the output layer:**\n",
+ "\n",
+ "* For classification the softmax activation function is generally a good choice for classification tasks (when the classes are mutually exclusive).\n",
+ "\n",
+ "* For regression tasks, you can simply use no activation function at all."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "291e4fb2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Building neural networks in Tensorflow and Keras\n",
+ "\n",
+ "Now we want to build on the experience gained from our neural network implementation in NumPy and scikit-learn\n",
+ "and use it to construct a neural network in Tensorflow. Once we have constructed a neural network in NumPy\n",
+ "and Tensorflow, building one in Keras is really quite trivial, though the performance may suffer. \n",
+ "\n",
+ "In our previous example we used only one hidden layer, and in this we will use two. From this it should be quite\n",
+ "clear how to build one using an arbitrary number of hidden layers, using data structures such as Python lists or\n",
+ "NumPy arrays."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a8c5f4c2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Tensorflow\n",
+ "\n",
+ "Tensorflow is an open source library machine learning library\n",
+ "developed by the Google Brain team for internal use. It was released\n",
+ "under the Apache 2.0 open source license in November 9, 2015.\n",
+ "\n",
+ "Tensorflow is a computational framework that allows you to construct\n",
+ "machine learning models at different levels of abstraction, from\n",
+ "high-level, object-oriented APIs like Keras, down to the C++ kernels\n",
+ "that Tensorflow is built upon. The higher levels of abstraction are\n",
+ "simpler to use, but less flexible, and our choice of implementation\n",
+ "should reflect the problems we are trying to solve.\n",
+ "\n",
+ "[Tensorflow uses](https://www.tensorflow.org/guide/graphs) so-called graphs to represent your computation\n",
+ "in terms of the dependencies between individual operations, such that you first build a Tensorflow *graph*\n",
+ "to represent your model, and then create a Tensorflow *session* to run the graph.\n",
+ "\n",
+ "In this guide we will analyze the same data as we did in our NumPy and\n",
+ "scikit-learn tutorial, gathered from the MNIST database of images. We\n",
+ "will give an introduction to the lower level Python Application\n",
+ "Program Interfaces (APIs), and see how we use them to build our graph.\n",
+ "Then we will build (effectively) the same graph in Keras, to see just\n",
+ "how simple solving a machine learning problem can be.\n",
+ "\n",
+ "To install tensorflow on Unix/Linux systems, use pip as"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "9a0aac03",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "pip3 install tensorflow"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ca0c7865",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "and/or if you use **anaconda**, just write (or install from the graphical user interface)\n",
+ "(current release of CPU-only TensorFlow)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "d0c581f7",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "conda create -n tf tensorflow\n",
+ "conda activate tf"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fe086bc9",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "To install the current release of GPU TensorFlow"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "f551fad9",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "conda create -n tf-gpu tensorflow-gpu\n",
+ "conda activate tf-gpu"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "58152cef",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Using Keras\n",
+ "\n",
+ "Keras is a high level [neural network](https://en.wikipedia.org/wiki/Application_programming_interface)\n",
+ "that supports Tensorflow, CTNK and Theano as backends. \n",
+ "If you have Anaconda installed you may run the following command"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "579b6a4a",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "conda install keras"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5da15206",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "You can look up the [instructions here](https://keras.io/) for more information.\n",
+ "\n",
+ "We will to a large extent use **keras** in this course."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "cc970d32",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Collect and pre-process data\n",
+ "\n",
+ "Let us look again at the MINST data set."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "a4f2c8a8",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "%matplotlib inline\n",
+ "\n",
+ "# import necessary packages\n",
+ "import numpy as np\n",
+ "import matplotlib.pyplot as plt\n",
+ "import tensorflow as tf\n",
+ "from sklearn import datasets\n",
+ "\n",
+ "\n",
+ "# ensure the same random numbers appear every time\n",
+ "np.random.seed(0)\n",
+ "\n",
+ "# display images in notebook\n",
+ "%matplotlib inline\n",
+ "plt.rcParams['figure.figsize'] = (12,12)\n",
+ "\n",
+ "\n",
+ "# download MNIST dataset\n",
+ "digits = datasets.load_digits()\n",
+ "\n",
+ "# define inputs and labels\n",
+ "inputs = digits.images\n",
+ "labels = digits.target\n",
+ "\n",
+ "print(\"inputs = (n_inputs, pixel_width, pixel_height) = \" + str(inputs.shape))\n",
+ "print(\"labels = (n_inputs) = \" + str(labels.shape))\n",
+ "\n",
+ "\n",
+ "# flatten the image\n",
+ "# the value -1 means dimension is inferred from the remaining dimensions: 8x8 = 64\n",
+ "n_inputs = len(inputs)\n",
+ "inputs = inputs.reshape(n_inputs, -1)\n",
+ "print(\"X = (n_inputs, n_features) = \" + str(inputs.shape))\n",
+ "\n",
+ "\n",
+ "# choose some random images to display\n",
+ "indices = np.arange(n_inputs)\n",
+ "random_indices = np.random.choice(indices, size=5)\n",
+ "\n",
+ "for i, image in enumerate(digits.images[random_indices]):\n",
+ " plt.subplot(1, 5, i+1)\n",
+ " plt.axis('off')\n",
+ " plt.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest')\n",
+ " plt.title(\"Label: %d\" % digits.target[random_indices[i]])\n",
+ "plt.show()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "d0c06f34",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from tensorflow.keras.layers import Input\n",
+ "from tensorflow.keras.models import Sequential #This allows appending layers to existing models\n",
+ "from tensorflow.keras.layers import Dense #This allows defining the characteristics of a particular layer\n",
+ "from tensorflow.keras import optimizers #This allows using whichever optimiser we want (sgd,adam,RMSprop)\n",
+ "from tensorflow.keras import regularizers #This allows using whichever regularizer we want (l1,l2,l1_l2)\n",
+ "from tensorflow.keras.utils import to_categorical #This allows using categorical cross entropy as the cost function\n",
+ "\n",
+ "from sklearn.model_selection import train_test_split\n",
+ "\n",
+ "# one-hot representation of labels\n",
+ "labels = to_categorical(labels)\n",
+ "\n",
+ "# split into train and test data\n",
+ "train_size = 0.8\n",
+ "test_size = 1 - train_size\n",
+ "X_train, X_test, Y_train, Y_test = train_test_split(inputs, labels, train_size=train_size,\n",
+ " test_size=test_size)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "8272ca95",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "\n",
+ "epochs = 100\n",
+ "batch_size = 100\n",
+ "n_neurons_layer1 = 100\n",
+ "n_neurons_layer2 = 50\n",
+ "n_categories = 10\n",
+ "eta_vals = np.logspace(-5, 1, 7)\n",
+ "lmbd_vals = np.logspace(-5, 1, 7)\n",
+ "def create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories, eta, lmbd):\n",
+ " model = Sequential()\n",
+ " model.add(Dense(n_neurons_layer1, activation='sigmoid', kernel_regularizer=regularizers.l2(lmbd)))\n",
+ " model.add(Dense(n_neurons_layer2, activation='sigmoid', kernel_regularizer=regularizers.l2(lmbd)))\n",
+ " model.add(Dense(n_categories, activation='softmax'))\n",
+ " \n",
+ " sgd = optimizers.SGD(learning_rate=eta)\n",
+ " model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])\n",
+ " \n",
+ " return model"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "616613a7",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "DNN_keras = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object)\n",
+ " \n",
+ "for i, eta in enumerate(eta_vals):\n",
+ " for j, lmbd in enumerate(lmbd_vals):\n",
+ " DNN = create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories,\n",
+ " eta=eta, lmbd=lmbd)\n",
+ " DNN.fit(X_train, Y_train, epochs=epochs, batch_size=batch_size, verbose=0)\n",
+ " scores = DNN.evaluate(X_test, Y_test)\n",
+ " \n",
+ " DNN_keras[i][j] = DNN\n",
+ " \n",
+ " print(\"Learning rate = \", eta)\n",
+ " print(\"Lambda = \", lmbd)\n",
+ " print(\"Test accuracy: %.3f\" % scores[1])\n",
+ " print()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "f57a7b70",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "# optional\n",
+ "# visual representation of grid search\n",
+ "# uses seaborn heatmap, could probably do this in matplotlib\n",
+ "import seaborn as sns\n",
+ "\n",
+ "sns.set()\n",
+ "\n",
+ "train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n",
+ "test_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))\n",
+ "\n",
+ "for i in range(len(eta_vals)):\n",
+ " for j in range(len(lmbd_vals)):\n",
+ " DNN = DNN_keras[i][j]\n",
+ "\n",
+ " train_accuracy[i][j] = DNN.evaluate(X_train, Y_train)[1]\n",
+ " test_accuracy[i][j] = DNN.evaluate(X_test, Y_test)[1]\n",
+ "\n",
+ " \n",
+ "fig, ax = plt.subplots(figsize = (10, 10))\n",
+ "sns.heatmap(train_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n",
+ "ax.set_title(\"Training Accuracy\")\n",
+ "ax.set_ylabel(\"$\\eta$\")\n",
+ "ax.set_xlabel(\"$\\lambda$\")\n",
+ "plt.show()\n",
+ "\n",
+ "fig, ax = plt.subplots(figsize = (10, 10))\n",
+ "sns.heatmap(test_accuracy, annot=True, ax=ax, cmap=\"viridis\")\n",
+ "ax.set_title(\"Test Accuracy\")\n",
+ "ax.set_ylabel(\"$\\eta$\")\n",
+ "ax.set_xlabel(\"$\\lambda$\")\n",
+ "plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a61b50a8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Using Pytorch with the full MNIST data set"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "d220a7ad",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import torch\n",
+ "import torch.nn as nn\n",
+ "import torch.optim as optim\n",
+ "import torchvision\n",
+ "import torchvision.transforms as transforms\n",
+ "\n",
+ "# Device configuration: use GPU if available\n",
+ "device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
+ "\n",
+ "# MNIST dataset (downloads if not already present)\n",
+ "transform = transforms.Compose([\n",
+ " transforms.ToTensor(),\n",
+ " transforms.Normalize((0.5,), (0.5,)) # normalize to mean=0.5, std=0.5 (approx. [-1,1] pixel range)\n",
+ "])\n",
+ "train_dataset = torchvision.datasets.MNIST(root='./data', train=True, download=True, transform=transform)\n",
+ "test_dataset = torchvision.datasets.MNIST(root='./data', train=False, download=True, transform=transform)\n",
+ "\n",
+ "train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=64, shuffle=True)\n",
+ "test_loader = torch.utils.data.DataLoader(test_dataset, batch_size=64, shuffle=False)\n",
+ "\n",
+ "\n",
+ "class NeuralNet(nn.Module):\n",
+ " def __init__(self):\n",
+ " super(NeuralNet, self).__init__()\n",
+ " self.fc1 = nn.Linear(28*28, 100) # first hidden layer (784 -> 100)\n",
+ " self.fc2 = nn.Linear(100, 100) # second hidden layer (100 -> 100)\n",
+ " self.fc3 = nn.Linear(100, 10) # output layer (100 -> 10 classes)\n",
+ " def forward(self, x):\n",
+ " x = x.view(x.size(0), -1) # flatten images into vectors of size 784\n",
+ " x = torch.relu(self.fc1(x)) # hidden layer 1 + ReLU activation\n",
+ " x = torch.relu(self.fc2(x)) # hidden layer 2 + ReLU activation\n",
+ " x = self.fc3(x) # output layer (logits for 10 classes)\n",
+ " return x\n",
+ "\n",
+ "model = NeuralNet().to(device)\n",
+ "\n",
+ "\n",
+ "criterion = nn.CrossEntropyLoss()\n",
+ "optimizer = optim.SGD(model.parameters(), lr=0.01, weight_decay=1e-4)\n",
+ "\n",
+ "num_epochs = 10\n",
+ "for epoch in range(num_epochs):\n",
+ " model.train() # set model to training mode\n",
+ " running_loss = 0.0\n",
+ " for images, labels in train_loader:\n",
+ " # Move data to device (GPU if available, else CPU)\n",
+ " images, labels = images.to(device), labels.to(device)\n",
+ "\n",
+ " optimizer.zero_grad() # reset gradients to zero\n",
+ " outputs = model(images) # forward pass: compute predictions\n",
+ " loss = criterion(outputs, labels) # compute cross-entropy loss\n",
+ " loss.backward() # backpropagate to compute gradients\n",
+ " optimizer.step() # update weights using SGD step \n",
+ "\n",
+ " running_loss += loss.item()\n",
+ " # Compute average loss over all batches in this epoch\n",
+ " avg_loss = running_loss / len(train_loader)\n",
+ " print(f\"Epoch {epoch+1}/{num_epochs}, Loss: {avg_loss:.4f}\")\n",
+ "\n",
+ "#Evaluation on the Test Set\n",
+ "\n",
+ "\n",
+ "\n",
+ "model.eval() # set model to evaluation mode \n",
+ "correct = 0\n",
+ "total = 0\n",
+ "with torch.no_grad(): # disable gradient calculation for evaluation \n",
+ " for images, labels in test_loader:\n",
+ " images, labels = images.to(device), labels.to(device)\n",
+ " outputs = model(images)\n",
+ " _, predicted = torch.max(outputs, dim=1) # class with highest score\n",
+ " total += labels.size(0)\n",
+ " correct += (predicted == labels).sum().item()\n",
+ "\n",
+ "accuracy = 100 * correct / total\n",
+ "print(f\"Test Accuracy: {accuracy:.2f}%\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d87d7514",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## And a similar example using Tensorflow with Keras"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "c6df6115",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "\n",
+ "import tensorflow as tf\n",
+ "from tensorflow import keras\n",
+ "from tensorflow.keras import layers, regularizers\n",
+ "\n",
+ "# Check for GPU (TensorFlow will use it automatically if available)\n",
+ "gpus = tf.config.list_physical_devices('GPU')\n",
+ "print(f\"GPUs available: {gpus}\")\n",
+ "\n",
+ "# 1) Load and preprocess MNIST\n",
+ "(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()\n",
+ "# Normalize to [0, 1]\n",
+ "x_train = (x_train.astype(\"float32\") / 255.0)\n",
+ "x_test = (x_test.astype(\"float32\") / 255.0)\n",
+ "\n",
+ "# 2) Build the model: 784 -> 100 -> 100 -> 10\n",
+ "l2_reg = 1e-4 # L2 regularization strength\n",
+ "\n",
+ "model = keras.Sequential([\n",
+ " layers.Input(shape=(28, 28)),\n",
+ " layers.Flatten(),\n",
+ " layers.Dense(100, activation=\"relu\",\n",
+ " kernel_regularizer=regularizers.l2(l2_reg)),\n",
+ " layers.Dense(100, activation=\"relu\",\n",
+ " kernel_regularizer=regularizers.l2(l2_reg)),\n",
+ " layers.Dense(10, activation=\"softmax\") # output probabilities for 10 classes\n",
+ "])\n",
+ "\n",
+ "# 3) Compile with SGD + weight decay via L2 regularizers\n",
+ "model.compile(\n",
+ " optimizer=keras.optimizers.SGD(learning_rate=0.01),\n",
+ " loss=\"sparse_categorical_crossentropy\",\n",
+ " metrics=[\"accuracy\"],\n",
+ ")\n",
+ "\n",
+ "model.summary()\n",
+ "\n",
+ "# 4) Train\n",
+ "history = model.fit(\n",
+ " x_train, y_train,\n",
+ " epochs=10,\n",
+ " batch_size=64,\n",
+ " validation_split=0.1, # optional: monitor validation during training\n",
+ " verbose=1\n",
+ ")\n",
+ "\n",
+ "# 5) Evaluate on test set\n",
+ "test_loss, test_acc = model.evaluate(x_test, y_test, verbose=0)\n",
+ "print(f\"Test accuracy: {test_acc:.4f}, Test loss: {test_loss:.4f}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5fd4d319",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Building our own neural network code\n",
+ "\n",
+ "Here we present a flexible object oriented codebase\n",
+ "for a feed forward neural network, along with a demonstration of how\n",
+ "to use it. Before we get into the details of the neural network, we\n",
+ "will first present some implementations of various schedulers, cost\n",
+ "functions and activation functions that can be used together with the\n",
+ "neural network.\n",
+ "\n",
+ "The codes here were developed by Eric Reber and Gregor Kajda during spring 2023."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "64134feb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Learning rate methods\n",
+ "\n",
+ "The code below shows object oriented implementations of the Constant,\n",
+ "Momentum, Adagrad, AdagradMomentum, RMS prop and Adam schedulers. All\n",
+ "of the classes belong to the shared abstract Scheduler class, and\n",
+ "share the update_change() and reset() methods allowing for any of the\n",
+ "schedulers to be seamlessly used during the training stage, as will\n",
+ "later be shown in the fit() method of the neural\n",
+ "network. Update_change() only has one parameter, the gradient\n",
+ "($δ^l_ja^{l−1}_k$), and returns the change which will be subtracted\n",
+ "from the weights. The reset() function takes no parameters, and resets\n",
+ "the desired variables. For Constant and Momentum, reset does nothing."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "643f7a82",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "\n",
+ "class Scheduler:\n",
+ " \"\"\"\n",
+ " Abstract class for Schedulers\n",
+ " \"\"\"\n",
+ "\n",
+ " def __init__(self, eta):\n",
+ " self.eta = eta\n",
+ "\n",
+ " # should be overwritten\n",
+ " def update_change(self, gradient):\n",
+ " raise NotImplementedError\n",
+ "\n",
+ " # overwritten if needed\n",
+ " def reset(self):\n",
+ " pass\n",
+ "\n",
+ "\n",
+ "class Constant(Scheduler):\n",
+ " def __init__(self, eta):\n",
+ " super().__init__(eta)\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " return self.eta * gradient\n",
+ " \n",
+ " def reset(self):\n",
+ " pass\n",
+ "\n",
+ "\n",
+ "class Momentum(Scheduler):\n",
+ " def __init__(self, eta: float, momentum: float):\n",
+ " super().__init__(eta)\n",
+ " self.momentum = momentum\n",
+ " self.change = 0\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " self.change = self.momentum * self.change + self.eta * gradient\n",
+ " return self.change\n",
+ "\n",
+ " def reset(self):\n",
+ " pass\n",
+ "\n",
+ "\n",
+ "class Adagrad(Scheduler):\n",
+ " def __init__(self, eta):\n",
+ " super().__init__(eta)\n",
+ " self.G_t = None\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " delta = 1e-8 # avoid division ny zero\n",
+ "\n",
+ " if self.G_t is None:\n",
+ " self.G_t = np.zeros((gradient.shape[0], gradient.shape[0]))\n",
+ "\n",
+ " self.G_t += gradient @ gradient.T\n",
+ "\n",
+ " G_t_inverse = 1 / (\n",
+ " delta + np.sqrt(np.reshape(np.diagonal(self.G_t), (self.G_t.shape[0], 1)))\n",
+ " )\n",
+ " return self.eta * gradient * G_t_inverse\n",
+ "\n",
+ " def reset(self):\n",
+ " self.G_t = None\n",
+ "\n",
+ "\n",
+ "class AdagradMomentum(Scheduler):\n",
+ " def __init__(self, eta, momentum):\n",
+ " super().__init__(eta)\n",
+ " self.G_t = None\n",
+ " self.momentum = momentum\n",
+ " self.change = 0\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " delta = 1e-8 # avoid division ny zero\n",
+ "\n",
+ " if self.G_t is None:\n",
+ " self.G_t = np.zeros((gradient.shape[0], gradient.shape[0]))\n",
+ "\n",
+ " self.G_t += gradient @ gradient.T\n",
+ "\n",
+ " G_t_inverse = 1 / (\n",
+ " delta + np.sqrt(np.reshape(np.diagonal(self.G_t), (self.G_t.shape[0], 1)))\n",
+ " )\n",
+ " self.change = self.change * self.momentum + self.eta * gradient * G_t_inverse\n",
+ " return self.change\n",
+ "\n",
+ " def reset(self):\n",
+ " self.G_t = None\n",
+ "\n",
+ "\n",
+ "class RMS_prop(Scheduler):\n",
+ " def __init__(self, eta, rho):\n",
+ " super().__init__(eta)\n",
+ " self.rho = rho\n",
+ " self.second = 0.0\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " delta = 1e-8 # avoid division ny zero\n",
+ " self.second = self.rho * self.second + (1 - self.rho) * gradient * gradient\n",
+ " return self.eta * gradient / (np.sqrt(self.second + delta))\n",
+ "\n",
+ " def reset(self):\n",
+ " self.second = 0.0\n",
+ "\n",
+ "\n",
+ "class Adam(Scheduler):\n",
+ " def __init__(self, eta, rho, rho2):\n",
+ " super().__init__(eta)\n",
+ " self.rho = rho\n",
+ " self.rho2 = rho2\n",
+ " self.moment = 0\n",
+ " self.second = 0\n",
+ " self.n_epochs = 1\n",
+ "\n",
+ " def update_change(self, gradient):\n",
+ " delta = 1e-8 # avoid division ny zero\n",
+ "\n",
+ " self.moment = self.rho * self.moment + (1 - self.rho) * gradient\n",
+ " self.second = self.rho2 * self.second + (1 - self.rho2) * gradient * gradient\n",
+ "\n",
+ " moment_corrected = self.moment / (1 - self.rho**self.n_epochs)\n",
+ " second_corrected = self.second / (1 - self.rho2**self.n_epochs)\n",
+ "\n",
+ " return self.eta * moment_corrected / (np.sqrt(second_corrected + delta))\n",
+ "\n",
+ " def reset(self):\n",
+ " self.n_epochs += 1\n",
+ " self.moment = 0\n",
+ " self.second = 0"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "dfa32b7e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Usage of the above learning rate schedulers\n",
+ "\n",
+ "To initalize a scheduler, simply create the object and pass in the\n",
+ "necessary parameters such as the learning rate and the momentum as\n",
+ "shown below. As the Scheduler class is an abstract class it should not\n",
+ "called directly, and will raise an error upon usage."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "id": "4b88b24e",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "momentum_scheduler = Momentum(eta=1e-3, momentum=0.9)\n",
+ "adam_scheduler = Adam(eta=1e-3, rho=0.9, rho2=0.999)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2eea0e52",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Here is a small example for how a segment of code using schedulers\n",
+ "could look. Switching out the schedulers is simple."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "id": "090bee3c",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "weights = np.ones((3,3))\n",
+ "print(f\"Before scheduler:\\n{weights=}\")\n",
+ "\n",
+ "epochs = 10\n",
+ "for e in range(epochs):\n",
+ " gradient = np.random.rand(3, 3)\n",
+ " change = adam_scheduler.update_change(gradient)\n",
+ " weights = weights - change\n",
+ " adam_scheduler.reset()\n",
+ "\n",
+ "print(f\"\\nAfter scheduler:\\n{weights=}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e0eee286",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Cost functions\n",
+ "\n",
+ "Here we discuss cost functions that can be used when creating the\n",
+ "neural network. Every cost function takes the target vector as its\n",
+ "parameter, and returns a function valued only at $x$ such that it may\n",
+ "easily be differentiated."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "id": "191224bb",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "\n",
+ "def CostOLS(target):\n",
+ " \n",
+ " def func(X):\n",
+ " return (1.0 / target.shape[0]) * np.sum((target - X) ** 2)\n",
+ "\n",
+ " return func\n",
+ "\n",
+ "\n",
+ "def CostLogReg(target):\n",
+ "\n",
+ " def func(X):\n",
+ " \n",
+ " return -(1.0 / target.shape[0]) * np.sum(\n",
+ " (target * np.log(X + 10e-10)) + ((1 - target) * np.log(1 - X + 10e-10))\n",
+ " )\n",
+ "\n",
+ " return func\n",
+ "\n",
+ "\n",
+ "def CostCrossEntropy(target):\n",
+ " \n",
+ " def func(X):\n",
+ " return -(1.0 / target.size) * np.sum(target * np.log(X + 10e-10))\n",
+ "\n",
+ " return func"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7f4a0238",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Below we give a short example of how these cost function may be used\n",
+ "to obtain results if you wish to test them out on your own using\n",
+ "AutoGrad's automatics differentiation."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "id": "d822b656",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from autograd import grad\n",
+ "\n",
+ "target = np.array([[1, 2, 3]]).T\n",
+ "a = np.array([[4, 5, 6]]).T\n",
+ "\n",
+ "cost_func = CostCrossEntropy\n",
+ "cost_func_derivative = grad(cost_func(target))\n",
+ "\n",
+ "valued_at_a = cost_func_derivative(a)\n",
+ "print(f\"Derivative of cost function {cost_func.__name__} valued at a:\\n{valued_at_a}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7ff32a3b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Activation functions\n",
+ "\n",
+ "Finally, before we look at the neural network, we will look at the\n",
+ "activation functions which can be specified between the hidden layers\n",
+ "and as the output function. Each function can be valued for any given\n",
+ "vector or matrix X, and can be differentiated via derivate()."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "id": "90045474",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import elementwise_grad\n",
+ "\n",
+ "def identity(X):\n",
+ " return X\n",
+ "\n",
+ "\n",
+ "def sigmoid(X):\n",
+ " try:\n",
+ " return 1.0 / (1 + np.exp(-X))\n",
+ " except FloatingPointError:\n",
+ " return np.where(X > np.zeros(X.shape), np.ones(X.shape), np.zeros(X.shape))\n",
+ "\n",
+ "\n",
+ "def softmax(X):\n",
+ " X = X - np.max(X, axis=-1, keepdims=True)\n",
+ " delta = 10e-10\n",
+ " return np.exp(X) / (np.sum(np.exp(X), axis=-1, keepdims=True) + delta)\n",
+ "\n",
+ "\n",
+ "def RELU(X):\n",
+ " return np.where(X > np.zeros(X.shape), X, np.zeros(X.shape))\n",
+ "\n",
+ "\n",
+ "def LRELU(X):\n",
+ " delta = 10e-4\n",
+ " return np.where(X > np.zeros(X.shape), X, delta * X)\n",
+ "\n",
+ "\n",
+ "def derivate(func):\n",
+ " if func.__name__ == \"RELU\":\n",
+ "\n",
+ " def func(X):\n",
+ " return np.where(X > 0, 1, 0)\n",
+ "\n",
+ " return func\n",
+ "\n",
+ " elif func.__name__ == \"LRELU\":\n",
+ "\n",
+ " def func(X):\n",
+ " delta = 10e-4\n",
+ " return np.where(X > 0, 1, delta)\n",
+ "\n",
+ " return func\n",
+ "\n",
+ " else:\n",
+ " return elementwise_grad(func)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "eec681dc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Below follows a short demonstration of how to use an activation\n",
+ "function. The derivative of the activation function will be important\n",
+ "when calculating the output delta term during backpropagation. Note\n",
+ "that derivate() can also be used for cost functions for a more\n",
+ "generalized approach."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "id": "a36d4506",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "z = np.array([[4, 5, 6]]).T\n",
+ "print(f\"Input to activation function:\\n{z}\")\n",
+ "\n",
+ "act_func = sigmoid\n",
+ "a = act_func(z)\n",
+ "print(f\"\\nOutput from {act_func.__name__} activation function:\\n{a}\")\n",
+ "\n",
+ "act_func_derivative = derivate(act_func)\n",
+ "valued_at_z = act_func_derivative(a)\n",
+ "print(f\"\\nDerivative of {act_func.__name__} activation function valued at z:\\n{valued_at_z}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d2358581",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### The Neural Network\n",
+ "\n",
+ "Now that we have gotten a good understanding of the implementation of\n",
+ "some important components, we can take a look at an object oriented\n",
+ "implementation of a feed forward neural network. The feed forward\n",
+ "neural network has been implemented as a class named FFNN, which can\n",
+ "be initiated as a regressor or classifier dependant on the choice of\n",
+ "cost function. The FFNN can have any number of input nodes, hidden\n",
+ "layers with any amount of hidden nodes, and any amount of output nodes\n",
+ "meaning it can perform multiclass classification as well as binary\n",
+ "classification and regression problems. Although there is a lot of\n",
+ "code present, it makes for an easy to use and generalizeable interface\n",
+ "for creating many types of neural networks as will be demonstrated\n",
+ "below."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "id": "9dd0b112",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import math\n",
+ "import autograd.numpy as np\n",
+ "import sys\n",
+ "import warnings\n",
+ "from autograd import grad, elementwise_grad\n",
+ "from random import random, seed\n",
+ "from copy import deepcopy, copy\n",
+ "from typing import Tuple, Callable\n",
+ "from sklearn.utils import resample\n",
+ "\n",
+ "warnings.simplefilter(\"error\")\n",
+ "\n",
+ "\n",
+ "class FFNN:\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Feed Forward Neural Network with interface enabling flexible design of a\n",
+ " nerual networks architecture and the specification of activation function\n",
+ " in the hidden layers and output layer respectively. This model can be used\n",
+ " for both regression and classification problems, depending on the output function.\n",
+ "\n",
+ " Attributes:\n",
+ " ------------\n",
+ " I dimensions (tuple[int]): A list of positive integers, which specifies the\n",
+ " number of nodes in each of the networks layers. The first integer in the array\n",
+ " defines the number of nodes in the input layer, the second integer defines number\n",
+ " of nodes in the first hidden layer and so on until the last number, which\n",
+ " specifies the number of nodes in the output layer.\n",
+ " II hidden_func (Callable): The activation function for the hidden layers\n",
+ " III output_func (Callable): The activation function for the output layer\n",
+ " IV cost_func (Callable): Our cost function\n",
+ " V seed (int): Sets random seed, makes results reproducible\n",
+ " \"\"\"\n",
+ "\n",
+ " def __init__(\n",
+ " self,\n",
+ " dimensions: tuple[int],\n",
+ " hidden_func: Callable = sigmoid,\n",
+ " output_func: Callable = lambda x: x,\n",
+ " cost_func: Callable = CostOLS,\n",
+ " seed: int = None,\n",
+ " ):\n",
+ " self.dimensions = dimensions\n",
+ " self.hidden_func = hidden_func\n",
+ " self.output_func = output_func\n",
+ " self.cost_func = cost_func\n",
+ " self.seed = seed\n",
+ " self.weights = list()\n",
+ " self.schedulers_weight = list()\n",
+ " self.schedulers_bias = list()\n",
+ " self.a_matrices = list()\n",
+ " self.z_matrices = list()\n",
+ " self.classification = None\n",
+ "\n",
+ " self.reset_weights()\n",
+ " self._set_classification()\n",
+ "\n",
+ " def fit(\n",
+ " self,\n",
+ " X: np.ndarray,\n",
+ " t: np.ndarray,\n",
+ " scheduler: Scheduler,\n",
+ " batches: int = 1,\n",
+ " epochs: int = 100,\n",
+ " lam: float = 0,\n",
+ " X_val: np.ndarray = None,\n",
+ " t_val: np.ndarray = None,\n",
+ " ):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " This function performs the training the neural network by performing the feedforward and backpropagation\n",
+ " algorithm to update the networks weights.\n",
+ "\n",
+ " Parameters:\n",
+ " ------------\n",
+ " I X (np.ndarray) : training data\n",
+ " II t (np.ndarray) : target data\n",
+ " III scheduler (Scheduler) : specified scheduler (algorithm for optimization of gradient descent)\n",
+ " IV scheduler_args (list[int]) : list of all arguments necessary for scheduler\n",
+ "\n",
+ " Optional Parameters:\n",
+ " ------------\n",
+ " V batches (int) : number of batches the datasets are split into, default equal to 1\n",
+ " VI epochs (int) : number of iterations used to train the network, default equal to 100\n",
+ " VII lam (float) : regularization hyperparameter lambda\n",
+ " VIII X_val (np.ndarray) : validation set\n",
+ " IX t_val (np.ndarray) : validation target set\n",
+ "\n",
+ " Returns:\n",
+ " ------------\n",
+ " I scores (dict) : A dictionary containing the performance metrics of the model.\n",
+ " The number of the metrics depends on the parameters passed to the fit-function.\n",
+ "\n",
+ " \"\"\"\n",
+ "\n",
+ " # setup \n",
+ " if self.seed is not None:\n",
+ " np.random.seed(self.seed)\n",
+ "\n",
+ " val_set = False\n",
+ " if X_val is not None and t_val is not None:\n",
+ " val_set = True\n",
+ "\n",
+ " # creating arrays for score metrics\n",
+ " train_errors = np.empty(epochs)\n",
+ " train_errors.fill(np.nan)\n",
+ " val_errors = np.empty(epochs)\n",
+ " val_errors.fill(np.nan)\n",
+ "\n",
+ " train_accs = np.empty(epochs)\n",
+ " train_accs.fill(np.nan)\n",
+ " val_accs = np.empty(epochs)\n",
+ " val_accs.fill(np.nan)\n",
+ "\n",
+ " self.schedulers_weight = list()\n",
+ " self.schedulers_bias = list()\n",
+ "\n",
+ " batch_size = X.shape[0] // batches\n",
+ "\n",
+ " X, t = resample(X, t)\n",
+ "\n",
+ " # this function returns a function valued only at X\n",
+ " cost_function_train = self.cost_func(t)\n",
+ " if val_set:\n",
+ " cost_function_val = self.cost_func(t_val)\n",
+ "\n",
+ " # create schedulers for each weight matrix\n",
+ " for i in range(len(self.weights)):\n",
+ " self.schedulers_weight.append(copy(scheduler))\n",
+ " self.schedulers_bias.append(copy(scheduler))\n",
+ "\n",
+ " print(f\"{scheduler.__class__.__name__}: Eta={scheduler.eta}, Lambda={lam}\")\n",
+ "\n",
+ " try:\n",
+ " for e in range(epochs):\n",
+ " for i in range(batches):\n",
+ " # allows for minibatch gradient descent\n",
+ " if i == batches - 1:\n",
+ " # If the for loop has reached the last batch, take all thats left\n",
+ " X_batch = X[i * batch_size :, :]\n",
+ " t_batch = t[i * batch_size :, :]\n",
+ " else:\n",
+ " X_batch = X[i * batch_size : (i + 1) * batch_size, :]\n",
+ " t_batch = t[i * batch_size : (i + 1) * batch_size, :]\n",
+ "\n",
+ " self._feedforward(X_batch)\n",
+ " self._backpropagate(X_batch, t_batch, lam)\n",
+ "\n",
+ " # reset schedulers for each epoch (some schedulers pass in this call)\n",
+ " for scheduler in self.schedulers_weight:\n",
+ " scheduler.reset()\n",
+ "\n",
+ " for scheduler in self.schedulers_bias:\n",
+ " scheduler.reset()\n",
+ "\n",
+ " # computing performance metrics\n",
+ " pred_train = self.predict(X)\n",
+ " train_error = cost_function_train(pred_train)\n",
+ "\n",
+ " train_errors[e] = train_error\n",
+ " if val_set:\n",
+ " \n",
+ " pred_val = self.predict(X_val)\n",
+ " val_error = cost_function_val(pred_val)\n",
+ " val_errors[e] = val_error\n",
+ "\n",
+ " if self.classification:\n",
+ " train_acc = self._accuracy(self.predict(X), t)\n",
+ " train_accs[e] = train_acc\n",
+ " if val_set:\n",
+ " val_acc = self._accuracy(pred_val, t_val)\n",
+ " val_accs[e] = val_acc\n",
+ "\n",
+ " # printing progress bar\n",
+ " progression = e / epochs\n",
+ " print_length = self._progress_bar(\n",
+ " progression,\n",
+ " train_error=train_errors[e],\n",
+ " train_acc=train_accs[e],\n",
+ " val_error=val_errors[e],\n",
+ " val_acc=val_accs[e],\n",
+ " )\n",
+ " except KeyboardInterrupt:\n",
+ " # allows for stopping training at any point and seeing the result\n",
+ " pass\n",
+ "\n",
+ " # visualization of training progression (similiar to tensorflow progression bar)\n",
+ " sys.stdout.write(\"\\r\" + \" \" * print_length)\n",
+ " sys.stdout.flush()\n",
+ " self._progress_bar(\n",
+ " 1,\n",
+ " train_error=train_errors[e],\n",
+ " train_acc=train_accs[e],\n",
+ " val_error=val_errors[e],\n",
+ " val_acc=val_accs[e],\n",
+ " )\n",
+ " sys.stdout.write(\"\")\n",
+ "\n",
+ " # return performance metrics for the entire run\n",
+ " scores = dict()\n",
+ "\n",
+ " scores[\"train_errors\"] = train_errors\n",
+ "\n",
+ " if val_set:\n",
+ " scores[\"val_errors\"] = val_errors\n",
+ "\n",
+ " if self.classification:\n",
+ " scores[\"train_accs\"] = train_accs\n",
+ "\n",
+ " if val_set:\n",
+ " scores[\"val_accs\"] = val_accs\n",
+ "\n",
+ " return scores\n",
+ "\n",
+ " def predict(self, X: np.ndarray, *, threshold=0.5):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Performs prediction after training of the network has been finished.\n",
+ "\n",
+ " Parameters:\n",
+ " ------------\n",
+ " I X (np.ndarray): The design matrix, with n rows of p features each\n",
+ "\n",
+ " Optional Parameters:\n",
+ " ------------\n",
+ " II threshold (float) : sets minimal value for a prediction to be predicted as the positive class\n",
+ " in classification problems\n",
+ "\n",
+ " Returns:\n",
+ " ------------\n",
+ " I z (np.ndarray): A prediction vector (row) for each row in our design matrix\n",
+ " This vector is thresholded if regression=False, meaning that classification results\n",
+ " in a vector of 1s and 0s, while regressions in an array of decimal numbers\n",
+ "\n",
+ " \"\"\"\n",
+ "\n",
+ " predict = self._feedforward(X)\n",
+ "\n",
+ " if self.classification:\n",
+ " return np.where(predict > threshold, 1, 0)\n",
+ " else:\n",
+ " return predict\n",
+ "\n",
+ " def reset_weights(self):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Resets/Reinitializes the weights in order to train the network for a new problem.\n",
+ "\n",
+ " \"\"\"\n",
+ " if self.seed is not None:\n",
+ " np.random.seed(self.seed)\n",
+ "\n",
+ " self.weights = list()\n",
+ " for i in range(len(self.dimensions) - 1):\n",
+ " weight_array = np.random.randn(\n",
+ " self.dimensions[i] + 1, self.dimensions[i + 1]\n",
+ " )\n",
+ " weight_array[0, :] = np.random.randn(self.dimensions[i + 1]) * 0.01\n",
+ "\n",
+ " self.weights.append(weight_array)\n",
+ "\n",
+ " def _feedforward(self, X: np.ndarray):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Calculates the activation of each layer starting at the input and ending at the output.\n",
+ " Each following activation is calculated from a weighted sum of each of the preceeding\n",
+ " activations (except in the case of the input layer).\n",
+ "\n",
+ " Parameters:\n",
+ " ------------\n",
+ " I X (np.ndarray): The design matrix, with n rows of p features each\n",
+ "\n",
+ " Returns:\n",
+ " ------------\n",
+ " I z (np.ndarray): A prediction vector (row) for each row in our design matrix\n",
+ " \"\"\"\n",
+ "\n",
+ " # reset matrices\n",
+ " self.a_matrices = list()\n",
+ " self.z_matrices = list()\n",
+ "\n",
+ " # if X is just a vector, make it into a matrix\n",
+ " if len(X.shape) == 1:\n",
+ " X = X.reshape((1, X.shape[0]))\n",
+ "\n",
+ " # Add a coloumn of zeros as the first coloumn of the design matrix, in order\n",
+ " # to add bias to our data\n",
+ " bias = np.ones((X.shape[0], 1)) * 0.01\n",
+ " X = np.hstack([bias, X])\n",
+ "\n",
+ " # a^0, the nodes in the input layer (one a^0 for each row in X - where the\n",
+ " # exponent indicates layer number).\n",
+ " a = X\n",
+ " self.a_matrices.append(a)\n",
+ " self.z_matrices.append(a)\n",
+ "\n",
+ " # The feed forward algorithm\n",
+ " for i in range(len(self.weights)):\n",
+ " if i < len(self.weights) - 1:\n",
+ " z = a @ self.weights[i]\n",
+ " self.z_matrices.append(z)\n",
+ " a = self.hidden_func(z)\n",
+ " # bias column again added to the data here\n",
+ " bias = np.ones((a.shape[0], 1)) * 0.01\n",
+ " a = np.hstack([bias, a])\n",
+ " self.a_matrices.append(a)\n",
+ " else:\n",
+ " try:\n",
+ " # a^L, the nodes in our output layers\n",
+ " z = a @ self.weights[i]\n",
+ " a = self.output_func(z)\n",
+ " self.a_matrices.append(a)\n",
+ " self.z_matrices.append(z)\n",
+ " except Exception as OverflowError:\n",
+ " print(\n",
+ " \"OverflowError in fit() in FFNN\\nHOW TO DEBUG ERROR: Consider lowering your learning rate or scheduler specific parameters such as momentum, or check if your input values need scaling\"\n",
+ " )\n",
+ "\n",
+ " # this will be a^L\n",
+ " return a\n",
+ "\n",
+ " def _backpropagate(self, X, t, lam):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Performs the backpropagation algorithm. In other words, this method\n",
+ " calculates the gradient of all the layers starting at the\n",
+ " output layer, and moving from right to left accumulates the gradient until\n",
+ " the input layer is reached. Each layers respective weights are updated while\n",
+ " the algorithm propagates backwards from the output layer (auto-differentation in reverse mode).\n",
+ "\n",
+ " Parameters:\n",
+ " ------------\n",
+ " I X (np.ndarray): The design matrix, with n rows of p features each.\n",
+ " II t (np.ndarray): The target vector, with n rows of p targets.\n",
+ " III lam (float32): regularization parameter used to punish the weights in case of overfitting\n",
+ "\n",
+ " Returns:\n",
+ " ------------\n",
+ " No return value.\n",
+ "\n",
+ " \"\"\"\n",
+ " out_derivative = derivate(self.output_func)\n",
+ " hidden_derivative = derivate(self.hidden_func)\n",
+ "\n",
+ " for i in range(len(self.weights) - 1, -1, -1):\n",
+ " # delta terms for output\n",
+ " if i == len(self.weights) - 1:\n",
+ " # for multi-class classification\n",
+ " if (\n",
+ " self.output_func.__name__ == \"softmax\"\n",
+ " ):\n",
+ " delta_matrix = self.a_matrices[i + 1] - t\n",
+ " # for single class classification\n",
+ " else:\n",
+ " cost_func_derivative = grad(self.cost_func(t))\n",
+ " delta_matrix = out_derivative(\n",
+ " self.z_matrices[i + 1]\n",
+ " ) * cost_func_derivative(self.a_matrices[i + 1])\n",
+ "\n",
+ " # delta terms for hidden layer\n",
+ " else:\n",
+ " delta_matrix = (\n",
+ " self.weights[i + 1][1:, :] @ delta_matrix.T\n",
+ " ).T * hidden_derivative(self.z_matrices[i + 1])\n",
+ "\n",
+ " # calculate gradient\n",
+ " gradient_weights = self.a_matrices[i][:, 1:].T @ delta_matrix\n",
+ " gradient_bias = np.sum(delta_matrix, axis=0).reshape(\n",
+ " 1, delta_matrix.shape[1]\n",
+ " )\n",
+ "\n",
+ " # regularization term\n",
+ " gradient_weights += self.weights[i][1:, :] * lam\n",
+ "\n",
+ " # use scheduler\n",
+ " update_matrix = np.vstack(\n",
+ " [\n",
+ " self.schedulers_bias[i].update_change(gradient_bias),\n",
+ " self.schedulers_weight[i].update_change(gradient_weights),\n",
+ " ]\n",
+ " )\n",
+ "\n",
+ " # update weights and bias\n",
+ " self.weights[i] -= update_matrix\n",
+ "\n",
+ " def _accuracy(self, prediction: np.ndarray, target: np.ndarray):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Calculates accuracy of given prediction to target\n",
+ "\n",
+ " Parameters:\n",
+ " ------------\n",
+ " I prediction (np.ndarray): vector of predicitons output network\n",
+ " (1s and 0s in case of classification, and real numbers in case of regression)\n",
+ " II target (np.ndarray): vector of true values (What the network ideally should predict)\n",
+ "\n",
+ " Returns:\n",
+ " ------------\n",
+ " A floating point number representing the percentage of correctly classified instances.\n",
+ " \"\"\"\n",
+ " assert prediction.size == target.size\n",
+ " return np.average((target == prediction))\n",
+ " def _set_classification(self):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Decides if FFNN acts as classifier (True) og regressor (False),\n",
+ " sets self.classification during init()\n",
+ " \"\"\"\n",
+ " self.classification = False\n",
+ " if (\n",
+ " self.cost_func.__name__ == \"CostLogReg\"\n",
+ " or self.cost_func.__name__ == \"CostCrossEntropy\"\n",
+ " ):\n",
+ " self.classification = True\n",
+ "\n",
+ " def _progress_bar(self, progression, **kwargs):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Displays progress of training\n",
+ " \"\"\"\n",
+ " print_length = 40\n",
+ " num_equals = int(progression * print_length)\n",
+ " num_not = print_length - num_equals\n",
+ " arrow = \">\" if num_equals > 0 else \"\"\n",
+ " bar = \"[\" + \"=\" * (num_equals - 1) + arrow + \"-\" * num_not + \"]\"\n",
+ " perc_print = self._format(progression * 100, decimals=5)\n",
+ " line = f\" {bar} {perc_print}% \"\n",
+ "\n",
+ " for key in kwargs:\n",
+ " if not np.isnan(kwargs[key]):\n",
+ " value = self._format(kwargs[key], decimals=4)\n",
+ " line += f\"| {key}: {value} \"\n",
+ " sys.stdout.write(\"\\r\" + line)\n",
+ " sys.stdout.flush()\n",
+ " return len(line)\n",
+ "\n",
+ " def _format(self, value, decimals=4):\n",
+ " \"\"\"\n",
+ " Description:\n",
+ " ------------\n",
+ " Formats decimal numbers for progress bar\n",
+ " \"\"\"\n",
+ " if value > 0:\n",
+ " v = value\n",
+ " elif value < 0:\n",
+ " v = -10 * value\n",
+ " else:\n",
+ " v = 1\n",
+ " n = 1 + math.floor(math.log10(v))\n",
+ " if n >= decimals - 1:\n",
+ " return str(round(value))\n",
+ " return f\"{value:.{decimals-n-1}f}\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b5aaa66b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Before we make a model, we will quickly generate a dataset we can use\n",
+ "for our linear regression problem as shown below"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "id": "35f13536",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from sklearn.model_selection import train_test_split\n",
+ "\n",
+ "def SkrankeFunction(x, y):\n",
+ " return np.ravel(0 + 1*x + 2*y + 3*x**2 + 4*x*y + 5*y**2)\n",
+ "\n",
+ "def create_X(x, y, n):\n",
+ " if len(x.shape) > 1:\n",
+ " x = np.ravel(x)\n",
+ " y = np.ravel(y)\n",
+ "\n",
+ " N = len(x)\n",
+ " l = int((n + 1) * (n + 2) / 2) # Number of elements in beta\n",
+ " X = np.ones((N, l))\n",
+ "\n",
+ " for i in range(1, n + 1):\n",
+ " q = int((i) * (i + 1) / 2)\n",
+ " for k in range(i + 1):\n",
+ " X[:, q + k] = (x ** (i - k)) * (y**k)\n",
+ "\n",
+ " return X\n",
+ "\n",
+ "step=0.5\n",
+ "x = np.arange(0, 1, step)\n",
+ "y = np.arange(0, 1, step)\n",
+ "x, y = np.meshgrid(x, y)\n",
+ "target = SkrankeFunction(x, y)\n",
+ "target = target.reshape(target.shape[0], 1)\n",
+ "\n",
+ "poly_degree=3\n",
+ "X = create_X(x, y, poly_degree)\n",
+ "\n",
+ "X_train, X_test, t_train, t_test = train_test_split(X, target)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "12780998",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Now that we have our dataset ready for the regression, we can create\n",
+ "our regressor. Note that with the seed parameter, we can make sure our\n",
+ "results stay the same every time we run the neural network. For\n",
+ "inititialization, we simply specify the dimensions (we wish the amount\n",
+ "of input nodes to be equal to the datapoints, and the output to\n",
+ "predict one value)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "id": "3de4263c",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "input_nodes = X_train.shape[1]\n",
+ "output_nodes = 1\n",
+ "\n",
+ "linear_regression = FFNN((input_nodes, output_nodes), output_func=identity, cost_func=CostOLS, seed=2023)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e3ca1fb5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "We then fit our model with our training data using the scheduler of our choice."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "id": "714229a9",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "linear_regression.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "\n",
+ "scheduler = Constant(eta=1e-3)\n",
+ "scores = linear_regression.fit(X_train, t_train, scheduler)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2240c6b8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Due to the progress bar we can see the MSE (train_error) throughout\n",
+ "the FFNN's training. Note that the fit() function has some optional\n",
+ "parameters with defualt arguments. For example, the regularization\n",
+ "hyperparameter can be left ignored if not needed, and equally the FFNN\n",
+ "will by default run for 100 epochs. These can easily be changed, such\n",
+ "as for example:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "id": "96f9f1ab",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "linear_regression.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "\n",
+ "scores = linear_regression.fit(X_train, t_train, scheduler, lam=1e-4, epochs=1000)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "21af3f64",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "We see that given more epochs to train on, the regressor reaches a lower MSE.\n",
+ "\n",
+ "Let us then switch to a binary classification. We use a binary\n",
+ "classification dataset, and follow a similar setup to the regression\n",
+ "case."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "id": "98f0055d",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from sklearn.datasets import load_breast_cancer\n",
+ "from sklearn.preprocessing import MinMaxScaler\n",
+ "\n",
+ "wisconsin = load_breast_cancer()\n",
+ "X = wisconsin.data\n",
+ "target = wisconsin.target\n",
+ "target = target.reshape(target.shape[0], 1)\n",
+ "\n",
+ "X_train, X_val, t_train, t_val = train_test_split(X, target)\n",
+ "\n",
+ "scaler = MinMaxScaler()\n",
+ "scaler.fit(X_train)\n",
+ "X_train = scaler.transform(X_train)\n",
+ "X_val = scaler.transform(X_val)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "id": "fbd2675f",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "input_nodes = X_train.shape[1]\n",
+ "output_nodes = 1\n",
+ "\n",
+ "logistic_regression = FFNN((input_nodes, output_nodes), output_func=sigmoid, cost_func=CostLogReg, seed=2023)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "64ed3461",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "We will now make use of our validation data by passing it into our fit function as a keyword argument"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "id": "1cdc9d23",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "logistic_regression.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "\n",
+ "scheduler = Adam(eta=1e-3, rho=0.9, rho2=0.999)\n",
+ "scores = logistic_regression.fit(X_train, t_train, scheduler, epochs=1000, X_val=X_val, t_val=t_val)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "13e2f881",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Finally, we will create a neural network with 2 hidden layers with activation functions."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "id": "c28f2181",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "input_nodes = X_train.shape[1]\n",
+ "hidden_nodes1 = 100\n",
+ "hidden_nodes2 = 30\n",
+ "output_nodes = 1\n",
+ "\n",
+ "dims = (input_nodes, hidden_nodes1, hidden_nodes2, output_nodes)\n",
+ "\n",
+ "neural_network = FFNN(dims, hidden_func=RELU, output_func=sigmoid, cost_func=CostLogReg, seed=2023)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "id": "3150b724",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "neural_network.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "\n",
+ "scheduler = Adam(eta=1e-4, rho=0.9, rho2=0.999)\n",
+ "scores = neural_network.fit(X_train, t_train, scheduler, epochs=1000, X_val=X_val, t_val=t_val)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "17aebab2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "### Multiclass classification\n",
+ "\n",
+ "Finally, we will demonstrate the use case of multiclass classification\n",
+ "using our FFNN with the famous MNIST dataset, which contain images of\n",
+ "digits between the range of 0 to 9."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "id": "997c5001",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "from sklearn.datasets import load_digits\n",
+ "\n",
+ "def onehot(target: np.ndarray):\n",
+ " onehot = np.zeros((target.size, target.max() + 1))\n",
+ " onehot[np.arange(target.size), target] = 1\n",
+ " return onehot\n",
+ "\n",
+ "digits = load_digits()\n",
+ "\n",
+ "X = digits.data\n",
+ "target = digits.target\n",
+ "target = onehot(target)\n",
+ "\n",
+ "input_nodes = 64\n",
+ "hidden_nodes1 = 100\n",
+ "hidden_nodes2 = 30\n",
+ "output_nodes = 10\n",
+ "\n",
+ "dims = (input_nodes, hidden_nodes1, hidden_nodes2, output_nodes)\n",
+ "\n",
+ "multiclass = FFNN(dims, hidden_func=LRELU, output_func=softmax, cost_func=CostCrossEntropy)\n",
+ "\n",
+ "multiclass.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "\n",
+ "scheduler = Adam(eta=1e-4, rho=0.9, rho2=0.999)\n",
+ "scores = multiclass.fit(X, target, scheduler, epochs=1000)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "43d805bc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Testing the XOR gate and other gates\n",
+ "\n",
+ "Let us now use our code to test the XOR gate."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "id": "4bbaf697",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "X = np.array([ [0, 0], [0, 1], [1, 0],[1, 1]],dtype=np.float64)\n",
+ "\n",
+ "# The XOR gate\n",
+ "yXOR = np.array( [[ 0], [1] ,[1], [0]])\n",
+ "\n",
+ "input_nodes = X.shape[1]\n",
+ "output_nodes = 1\n",
+ "\n",
+ "logistic_regression = FFNN((input_nodes, output_nodes), output_func=sigmoid, cost_func=CostLogReg, seed=2023)\n",
+ "logistic_regression.reset_weights() # reset weights such that previous runs or reruns don't affect the weights\n",
+ "scheduler = Adam(eta=1e-1, rho=0.9, rho2=0.999)\n",
+ "scores = logistic_regression.fit(X, yXOR, scheduler, epochs=1000)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "31e852a7",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Not bad, but the results depend strongly on the learning reate. Try different learning rates."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9792c0c3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Solving differential equations with Deep Learning\n",
+ "\n",
+ "The Universal Approximation Theorem states that a neural network can\n",
+ "approximate any function at a single hidden layer along with one input\n",
+ "and output layer to any given precision.\n",
+ "\n",
+ "**Book on solving differential equations with ML methods.**\n",
+ "\n",
+ "[An Introduction to Neural Network Methods for Differential Equations](https://www.springer.com/gp/book/9789401798150), by Yadav and Kumar.\n",
+ "\n",
+ "**Physics informed neural networks.**\n",
+ "\n",
+ "[Scientific Machine Learning Through Physics–Informed Neural Networks: Where we are and What’s Next](https://link.springer.com/article/10.1007/s10915-022-01939-z), by Cuomo et al\n",
+ "\n",
+ "**Thanks to Kristine Baluka Hein.**\n",
+ "\n",
+ "The lectures on differential equations were developed by Kristine Baluka Hein, now PhD student at IFI.\n",
+ "A great thanks to Kristine."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9214a407",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Ordinary Differential Equations first\n",
+ "\n",
+ "An ordinary differential equation (ODE) is an equation involving functions having one variable.\n",
+ "\n",
+ "In general, an ordinary differential equation looks like"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "40a78c33",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{ode} \\tag{1}\n",
+ "f\\left(x, \\, g(x), \\, g'(x), \\, g''(x), \\, \\dots \\, , \\, g^{(n)}(x)\\right) = 0\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "42dae561",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $g(x)$ is the function to find, and $g^{(n)}(x)$ is the $n$-th derivative of $g(x)$.\n",
+ "\n",
+ "The $f\\left(x, g(x), g'(x), g''(x), \\, \\dots \\, , g^{(n)}(x)\\right)$ is just a way to write that there is an expression involving $x$ and $g(x), \\ g'(x), \\ g''(x), \\, \\dots \\, , \\text{ and } g^{(n)}(x)$ on the left side of the equality sign in ([1](#ode)).\n",
+ "The highest order of derivative, that is the value of $n$, determines to the order of the equation.\n",
+ "The equation is referred to as a $n$-th order ODE.\n",
+ "Along with ([1](#ode)), some additional conditions of the function $g(x)$ are typically given\n",
+ "for the solution to be unique."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b4bf5f2e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The trial solution\n",
+ "\n",
+ "Let the trial solution $g_t(x)$ be"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1f4f3eba",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation}\n",
+ "\tg_t(x) = h_1(x) + h_2(x,N(x,P))\n",
+ "\\label{_auto1} \\tag{2}\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d799a47c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $h_1(x)$ is a function that makes $g_t(x)$ satisfy a given set\n",
+ "of conditions, $N(x,P)$ a neural network with weights and biases\n",
+ "described by $P$ and $h_2(x, N(x,P))$ some expression involving the\n",
+ "neural network. The role of the function $h_2(x, N(x,P))$, is to\n",
+ "ensure that the output from $N(x,P)$ is zero when $g_t(x)$ is\n",
+ "evaluated at the values of $x$ where the given conditions must be\n",
+ "satisfied. The function $h_1(x)$ should alone make $g_t(x)$ satisfy\n",
+ "the conditions.\n",
+ "\n",
+ "But what about the network $N(x,P)$?\n",
+ "\n",
+ "As described previously, an optimization method could be used to minimize the parameters of a neural network, that being its weights and biases, through backward propagation."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "abb02959",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Minimization process\n",
+ "\n",
+ "For the minimization to be defined, we need to have a cost function at hand to minimize.\n",
+ "\n",
+ "It is given that $f\\left(x, \\, g(x), \\, g'(x), \\, g''(x), \\, \\dots \\, , \\, g^{(n)}(x)\\right)$ should be equal to zero in ([1](#ode)).\n",
+ "We can choose to consider the mean squared error as the cost function for an input $x$.\n",
+ "Since we are looking at one input, the cost function is just $f$ squared.\n",
+ "The cost function $c\\left(x, P \\right)$ can therefore be expressed as"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6468ecf8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "C\\left(x, P\\right) = \\big(f\\left(x, \\, g(x), \\, g'(x), \\, g''(x), \\, \\dots \\, , \\, g^{(n)}(x)\\right)\\big)^2\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e7441b12",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "If $N$ inputs are given as a vector $\\boldsymbol{x}$ with elements $x_i$ for $i = 1,\\dots,N$,\n",
+ "the cost function becomes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0ffd1c29",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{cost} \\tag{3}\n",
+ "\tC\\left(\\boldsymbol{x}, P\\right) = \\frac{1}{N} \\sum_{i=1}^N \\big(f\\left(x_i, \\, g(x_i), \\, g'(x_i), \\, g''(x_i), \\, \\dots \\, , \\, g^{(n)}(x_i)\\right)\\big)^2\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e55c8d3e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "The neural net should then find the parameters $P$ that minimizes the cost function in\n",
+ "([3](#cost)) for a set of $N$ training samples $x_i$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8a940e88",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Minimizing the cost function using gradient descent and automatic differentiation\n",
+ "\n",
+ "To perform the minimization using gradient descent, the gradient of $C\\left(\\boldsymbol{x}, P\\right)$ is needed.\n",
+ "It might happen so that finding an analytical expression of the gradient of $C(\\boldsymbol{x}, P)$ from ([3](#cost)) gets too messy, depending on which cost function one desires to use.\n",
+ "\n",
+ "Luckily, there exists libraries that makes the job for us through automatic differentiation.\n",
+ "Automatic differentiation is a method of finding the derivatives numerically with very high precision."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "547613c0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Example: Exponential decay\n",
+ "\n",
+ "An exponential decay of a quantity $g(x)$ is described by the equation"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "826651d6",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{solve_expdec} \\tag{4}\n",
+ " g'(x) = -\\gamma g(x)\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "870b960b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $g(0) = g_0$ for some chosen initial value $g_0$.\n",
+ "\n",
+ "The analytical solution of ([4](#solve_expdec)) is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5a8fd1e3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation}\n",
+ " g(x) = g_0 \\exp\\left(-\\gamma x\\right)\n",
+ "\\label{_auto2} \\tag{5}\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "55b4f286",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Having an analytical solution at hand, it is possible to use it to compare how well a neural network finds a solution of ([4](#solve_expdec))."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7e4f689b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The function to solve for\n",
+ "\n",
+ "The program will use a neural network to solve"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "01e8e999",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{solveode} \\tag{6}\n",
+ "g'(x) = -\\gamma g(x)\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7ccea9f1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $g(0) = g_0$ with $\\gamma$ and $g_0$ being some chosen values.\n",
+ "\n",
+ "In this example, $\\gamma = 2$ and $g_0 = 10$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "47fde776",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The trial solution\n",
+ "To begin with, a trial solution $g_t(t)$ must be chosen. A general trial solution for ordinary differential equations could be"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f7a8f626",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "g_t(x, P) = h_1(x) + h_2(x, N(x, P))\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "66551df0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $h_1(x)$ ensuring that $g_t(x)$ satisfies some conditions and $h_2(x,N(x, P))$ an expression involving $x$ and the output from the neural network $N(x,P)$ with $P $ being the collection of the weights and biases for each layer. For now, it is assumed that the network consists of one input layer, one hidden layer, and one output layer."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c354ef4e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setup of Network\n",
+ "\n",
+ "In this network, there are no weights and bias at the input layer, so $P = \\{ P_{\\text{hidden}}, P_{\\text{output}} \\}$.\n",
+ "If there are $N_{\\text{hidden} }$ neurons in the hidden layer, then $P_{\\text{hidden}}$ is a $N_{\\text{hidden} } \\times (1 + N_{\\text{input}})$ matrix, given that there are $N_{\\text{input}}$ neurons in the input layer.\n",
+ "\n",
+ "The first column in $P_{\\text{hidden} }$ represents the bias for each neuron in the hidden layer and the second column represents the weights for each neuron in the hidden layer from the input layer.\n",
+ "If there are $N_{\\text{output} }$ neurons in the output layer, then $P_{\\text{output}} $ is a $N_{\\text{output} } \\times (1 + N_{\\text{hidden} })$ matrix.\n",
+ "\n",
+ "Its first column represents the bias of each neuron and the remaining columns represents the weights to each neuron.\n",
+ "\n",
+ "It is given that $g(0) = g_0$. The trial solution must fulfill this condition to be a proper solution of ([6](#solveode)). A possible way to ensure that $g_t(0, P) = g_0$, is to let $F(N(x,P)) = x \\cdot N(x,P)$ and $A(x) = g_0$. This gives the following trial solution:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a574c0b7",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{trial} \\tag{7}\n",
+ "g_t(x, P) = g_0 + x \\cdot N(x, P)\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "22f440c8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Reformulating the problem\n",
+ "\n",
+ "We wish that our neural network manages to minimize a given cost function.\n",
+ "\n",
+ "A reformulation of out equation, ([6](#solveode)), must therefore be done,\n",
+ "such that it describes the problem a neural network can solve for.\n",
+ "\n",
+ "The neural network must find the set of weights and biases $P$ such that the trial solution in ([7](#trial)) satisfies ([6](#solveode)).\n",
+ "\n",
+ "The trial solution"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0ff80a83",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "g_t(x, P) = g_0 + x \\cdot N(x, P)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6829edab",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "has been chosen such that it already solves the condition $g(0) = g_0$. What remains, is to find $P$ such that"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "381c61e2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{nnmin} \\tag{8}\n",
+ "g_t'(x, P) = - \\gamma g_t(x, P)\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ac36a03d",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "is fulfilled as *best as possible*."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2899becc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## More technicalities\n",
+ "\n",
+ "The left hand side and right hand side of ([8](#nnmin)) must be computed separately, and then the neural network must choose weights and biases, contained in $P$, such that the sides are equal as best as possible.\n",
+ "This means that the absolute or squared difference between the sides must be as close to zero, ideally equal to zero.\n",
+ "In this case, the difference squared shows to be an appropriate measurement of how erroneous the trial solution is with respect to $P$ of the neural network.\n",
+ "\n",
+ "This gives the following cost function our neural network must solve for:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d52c8124",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\min_{P}\\Big\\{ \\big(g_t'(x, P) - ( -\\gamma g_t(x, P) \\big)^2 \\Big\\}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3f8f684e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "(the notation $\\min_{P}\\{ f(x, P) \\}$ means that we desire to find $P$ that yields the minimum of $f(x, P)$)\n",
+ "\n",
+ "or, in terms of weights and biases for the hidden and output layer in our network:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "92cc16c9",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\min_{P_{\\text{hidden} }, \\ P_{\\text{output} }}\\Big\\{ \\big(g_t'(x, \\{ P_{\\text{hidden} }, P_{\\text{output} }\\}) - ( -\\gamma g_t(x, \\{ P_{\\text{hidden} }, P_{\\text{output} }\\}) \\big)^2 \\Big\\}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "628e0dfc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "for an input value $x$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e54b4c6e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## More details\n",
+ "\n",
+ "If the neural network evaluates $g_t(x, P)$ at more values for $x$, say $N$ values $x_i$ for $i = 1, \\dots, N$, then the *total* error to minimize becomes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "80dc48dd",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{min} \\tag{9}\n",
+ "\\min_{P}\\Big\\{\\frac{1}{N} \\sum_{i=1}^N \\big(g_t'(x_i, P) - ( -\\gamma g_t(x_i, P) \\big)^2 \\Big\\}\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e57a1d70",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Letting $\\boldsymbol{x}$ be a vector with elements $x_i$ and $C(\\boldsymbol{x}, P) = \\frac{1}{N} \\sum_i \\big(g_t'(x_i, P) - ( -\\gamma g_t(x_i, P) \\big)^2$ denote the cost function, the minimization problem that our network must solve, becomes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8ad67e57",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\min_{P} C(\\boldsymbol{x}, P)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4eed66ce",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "In terms of $P_{\\text{hidden} }$ and $P_{\\text{output} }$, this could also be expressed as\n",
+ "\n",
+ "$$\n",
+ "\\min_{P_{\\text{hidden} }, \\ P_{\\text{output} }} C(\\boldsymbol{x}, \\{P_{\\text{hidden} }, P_{\\text{output} }\\})\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9d652c56",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## A possible implementation of a neural network\n",
+ "\n",
+ "For simplicity, it is assumed that the input is an array $\\boldsymbol{x} = (x_1, \\dots, x_N)$ with $N$ elements. It is at these points the neural network should find $P$ such that it fulfills ([9](#min)).\n",
+ "\n",
+ "First, the neural network must feed forward the inputs.\n",
+ "This means that $\\boldsymbol{x}s$ must be passed through an input layer, a hidden layer and a output layer. The input layer in this case, does not need to process the data any further.\n",
+ "The input layer will consist of $N_{\\text{input} }$ neurons, passing its element to each neuron in the hidden layer. The number of neurons in the hidden layer will be $N_{\\text{hidden} }$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9a5a1ad7",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Technicalities\n",
+ "\n",
+ "For the $i$-th in the hidden layer with weight $w_i^{\\text{hidden} }$ and bias $b_i^{\\text{hidden} }$, the weighting from the $j$-th neuron at the input layer is:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ed15e067",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "z_{i,j}^{\\text{hidden}} &= b_i^{\\text{hidden}} + w_i^{\\text{hidden}}x_j \\\\\n",
+ "&=\n",
+ "\\begin{pmatrix}\n",
+ "b_i^{\\text{hidden}} & w_i^{\\text{hidden}}\n",
+ "\\end{pmatrix}\n",
+ "\\begin{pmatrix}\n",
+ "1 \\\\\n",
+ "x_j\n",
+ "\\end{pmatrix}\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "827ac223",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Final technicalities I\n",
+ "\n",
+ "The result after weighting the inputs at the $i$-th hidden neuron can be written as a vector:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a0a7b13f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "\\boldsymbol{z}_{i}^{\\text{hidden}} &= \\Big( b_i^{\\text{hidden}} + w_i^{\\text{hidden}}x_1 , \\ b_i^{\\text{hidden}} + w_i^{\\text{hidden}} x_2, \\ \\dots \\, , \\ b_i^{\\text{hidden}} + w_i^{\\text{hidden}} x_N\\Big) \\\\\n",
+ "&=\n",
+ "\\begin{pmatrix}\n",
+ " b_i^{\\text{hidden}} & w_i^{\\text{hidden}}\n",
+ "\\end{pmatrix}\n",
+ "\\begin{pmatrix}\n",
+ "1 & 1 & \\dots & 1 \\\\\n",
+ "x_1 & x_2 & \\dots & x_N\n",
+ "\\end{pmatrix} \\\\\n",
+ "&= \\boldsymbol{p}_{i, \\text{hidden}}^T X\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0879010a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Final technicalities II\n",
+ "\n",
+ "The vector $\\boldsymbol{p}_{i, \\text{hidden}}^T$ constitutes each row in $P_{\\text{hidden} }$, which contains the weights for the neural network to minimize according to ([9](#min)).\n",
+ "\n",
+ "After having found $\\boldsymbol{z}_{i}^{\\text{hidden}} $ for every $i$-th neuron within the hidden layer, the vector will be sent to an activation function $a_i(\\boldsymbol{z})$.\n",
+ "\n",
+ "In this example, the sigmoid function has been chosen to be the activation function for each hidden neuron:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "66ac91b3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "f(z) = \\frac{1}{1 + \\exp{(-z)}}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "470c74b5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "It is possible to use other activations functions for the hidden layer also.\n",
+ "\n",
+ "The output $\\boldsymbol{x}_i^{\\text{hidden}}$ from each $i$-th hidden neuron is:\n",
+ "\n",
+ "$$\n",
+ "\\boldsymbol{x}_i^{\\text{hidden} } = f\\big( \\boldsymbol{z}_{i}^{\\text{hidden}} \\big)\n",
+ "$$\n",
+ "\n",
+ "The outputs $\\boldsymbol{x}_i^{\\text{hidden} } $ are then sent to the output layer.\n",
+ "\n",
+ "The output layer consists of one neuron in this case, and combines the\n",
+ "output from each of the neurons in the hidden layers. The output layer\n",
+ "combines the results from the hidden layer using some weights $w_i^{\\text{output}}$\n",
+ "and biases $b_i^{\\text{output}}$. In this case,\n",
+ "it is assumes that the number of neurons in the output layer is one."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bf5e6967",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Final technicalities III\n",
+ "\n",
+ "The procedure of weighting the output neuron $j$ in the hidden layer to the $i$-th neuron in the output layer is similar as for the hidden layer described previously."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "766b88f8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "z_{1,j}^{\\text{output}} & =\n",
+ "\\begin{pmatrix}\n",
+ "b_1^{\\text{output}} & \\boldsymbol{w}_1^{\\text{output}}\n",
+ "\\end{pmatrix}\n",
+ "\\begin{pmatrix}\n",
+ "1 \\\\\n",
+ "\\boldsymbol{x}_j^{\\text{hidden}}\n",
+ "\\end{pmatrix}\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5c114139",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Final technicalities IV\n",
+ "\n",
+ "Expressing $z_{1,j}^{\\text{output}}$ as a vector gives the following way of weighting the inputs from the hidden layer:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "45596281",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\boldsymbol{z}_{1}^{\\text{output}} =\n",
+ "\\begin{pmatrix}\n",
+ "b_1^{\\text{output}} & \\boldsymbol{w}_1^{\\text{output}}\n",
+ "\\end{pmatrix}\n",
+ "\\begin{pmatrix}\n",
+ "1 & 1 & \\dots & 1 \\\\\n",
+ "\\boldsymbol{x}_1^{\\text{hidden}} & \\boldsymbol{x}_2^{\\text{hidden}} & \\dots & \\boldsymbol{x}_N^{\\text{hidden}}\n",
+ "\\end{pmatrix}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2c1378fb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "In this case we seek a continuous range of values since we are approximating a function. This means that after computing $\\boldsymbol{z}_{1}^{\\text{output}}$ the neural network has finished its feed forward step, and $\\boldsymbol{z}_{1}^{\\text{output}}$ is the final output of the network."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "66a732e1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Back propagation\n",
+ "\n",
+ "The next step is to decide how the parameters should be changed such that they minimize the cost function.\n",
+ "\n",
+ "The chosen cost function for this problem is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fdf81225",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "C(\\boldsymbol{x}, P) = \\frac{1}{N} \\sum_i \\big(g_t'(x_i, P) - ( -\\gamma g_t(x_i, P) \\big)^2\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9bb52111",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "In order to minimize the cost function, an optimization method must be chosen.\n",
+ "\n",
+ "Here, gradient descent with a constant step size has been chosen."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f3e495b4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Gradient descent\n",
+ "\n",
+ "The idea of the gradient descent algorithm is to update parameters in\n",
+ "a direction where the cost function decreases goes to a minimum.\n",
+ "\n",
+ "In general, the update of some parameters $\\boldsymbol{\\omega}$ given a cost\n",
+ "function defined by some weights $\\boldsymbol{\\omega}$, $C(\\boldsymbol{x},\n",
+ "\\boldsymbol{\\omega})$, goes as follows:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "adc904df",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\boldsymbol{\\omega}_{\\text{new} } = \\boldsymbol{\\omega} - \\lambda \\nabla_{\\boldsymbol{\\omega}} C(\\boldsymbol{x}, \\boldsymbol{\\omega})\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2d01b1b5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "for a number of iterations or until $ \\big|\\big| \\boldsymbol{\\omega}_{\\text{new} } - \\boldsymbol{\\omega} \\big|\\big|$ becomes smaller than some given tolerance.\n",
+ "\n",
+ "The value of $\\lambda$ decides how large steps the algorithm must take\n",
+ "in the direction of $ \\nabla_{\\boldsymbol{\\omega}} C(\\boldsymbol{x}, \\boldsymbol{\\omega})$.\n",
+ "The notation $\\nabla_{\\boldsymbol{\\omega}}$ express the gradient with respect\n",
+ "to the elements in $\\boldsymbol{\\omega}$.\n",
+ "\n",
+ "In our case, we have to minimize the cost function $C(\\boldsymbol{x}, P)$ with\n",
+ "respect to the two sets of weights and biases, that is for the hidden\n",
+ "layer $P_{\\text{hidden} }$ and for the output layer $P_{\\text{output}\n",
+ "}$ .\n",
+ "\n",
+ "This means that $P_{\\text{hidden} }$ and $P_{\\text{output} }$ is updated by"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5077f4f7",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "P_{\\text{hidden},\\text{new}} &= P_{\\text{hidden}} - \\lambda \\nabla_{P_{\\text{hidden}}} C(\\boldsymbol{x}, P) \\\\\n",
+ "P_{\\text{output},\\text{new}} &= P_{\\text{output}} - \\lambda \\nabla_{P_{\\text{output}}} C(\\boldsymbol{x}, P)\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fb01e943",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The code for solving the ODE"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "id": "6347e101",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import grad, elementwise_grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import pyplot as plt\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "# Assuming one input, hidden, and output layer\n",
+ "def neural_network(params, x):\n",
+ "\n",
+ " # Find the weights (including and biases) for the hidden and output layer.\n",
+ " # Assume that params is a list of parameters for each layer.\n",
+ " # The biases are the first element for each array in params,\n",
+ " # and the weights are the remaning elements in each array in params.\n",
+ "\n",
+ " w_hidden = params[0]\n",
+ " w_output = params[1]\n",
+ "\n",
+ " # Assumes input x being an one-dimensional array\n",
+ " num_values = np.size(x)\n",
+ " x = x.reshape(-1, num_values)\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ "\n",
+ " ## Hidden layer:\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_input = np.concatenate((np.ones((1,num_values)), x_input ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_input)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Include bias:\n",
+ " x_hidden = np.concatenate((np.ones((1,num_values)), x_hidden ), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_hidden)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output\n",
+ "\n",
+ "# The trial solution using the deep neural network:\n",
+ "def g_trial(x,params, g0 = 10):\n",
+ " return g0 + x*neural_network(params,x)\n",
+ "\n",
+ "# The right side of the ODE:\n",
+ "def g(x, g_trial, gamma = 2):\n",
+ " return -gamma*g_trial\n",
+ "\n",
+ "# The cost function:\n",
+ "def cost_function(P, x):\n",
+ "\n",
+ " # Evaluate the trial function with the current parameters P\n",
+ " g_t = g_trial(x,P)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the neural network\n",
+ " d_net_out = elementwise_grad(neural_network,1)(P,x)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the trial function\n",
+ " d_g_t = elementwise_grad(g_trial,0)(x,P)\n",
+ "\n",
+ " # The right side of the ODE\n",
+ " func = g(x, g_t)\n",
+ "\n",
+ " err_sqr = (d_g_t - func)**2\n",
+ " cost_sum = np.sum(err_sqr)\n",
+ "\n",
+ " return cost_sum / np.size(err_sqr)\n",
+ "\n",
+ "# Solve the exponential decay ODE using neural network with one input, hidden, and output layer\n",
+ "def solve_ode_neural_network(x, num_neurons_hidden, num_iter, lmb):\n",
+ " ## Set up initial weights and biases\n",
+ "\n",
+ " # For the hidden layer\n",
+ " p0 = npr.randn(num_neurons_hidden, 2 )\n",
+ "\n",
+ " # For the output layer\n",
+ " p1 = npr.randn(1, num_neurons_hidden + 1 ) # +1 since bias is included\n",
+ "\n",
+ " P = [p0, p1]\n",
+ "\n",
+ " print('Initial cost: %g'%cost_function(P, x))\n",
+ "\n",
+ " ## Start finding the optimal weights using gradient descent\n",
+ "\n",
+ " # Find the Python function that represents the gradient of the cost function\n",
+ " # w.r.t the 0-th input argument -- that is the weights and biases in the hidden and output layer\n",
+ " cost_function_grad = grad(cost_function,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " # Evaluate the gradient at the current weights and biases in P.\n",
+ " # The cost_grad consist now of two arrays;\n",
+ " # one for the gradient w.r.t P_hidden and\n",
+ " # one for the gradient w.r.t P_output\n",
+ " cost_grad = cost_function_grad(P, x)\n",
+ "\n",
+ " P[0] = P[0] - lmb * cost_grad[0]\n",
+ " P[1] = P[1] - lmb * cost_grad[1]\n",
+ "\n",
+ " print('Final cost: %g'%cost_function(P, x))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "def g_analytic(x, gamma = 2, g0 = 10):\n",
+ " return g0*np.exp(-gamma*x)\n",
+ "\n",
+ "# Solve the given problem\n",
+ "if __name__ == '__main__':\n",
+ " # Set seed such that the weight are initialized\n",
+ " # with same weights and biases for every run.\n",
+ " npr.seed(15)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " N = 10\n",
+ " x = np.linspace(0, 1, N)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = 10\n",
+ " num_iter = 10000\n",
+ " lmb = 0.001\n",
+ "\n",
+ " # Use the network\n",
+ " P = solve_ode_neural_network(x, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " # Print the deviation from the trial solution and true solution\n",
+ " res = g_trial(x,P)\n",
+ " res_analytical = g_analytic(x)\n",
+ "\n",
+ " print('Max absolute difference: %g'%np.max(np.abs(res - res_analytical)))\n",
+ "\n",
+ " # Plot the results\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(x, res_analytical)\n",
+ " plt.plot(x, res[0,:])\n",
+ " plt.legend(['analytical','nn'])\n",
+ " plt.xlabel('x')\n",
+ " plt.ylabel('g(x)')\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "59e5acda",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The network with one input layer, specified number of hidden layers, and one output layer\n",
+ "\n",
+ "It is also possible to extend the construction of our network into a more general one, allowing the network to contain more than one hidden layers.\n",
+ "\n",
+ "The number of neurons within each hidden layer are given as a list of integers in the program below."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "id": "f1a60516",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import grad, elementwise_grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import pyplot as plt\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "# The neural network with one input layer and one output layer,\n",
+ "# but with number of hidden layers specified by the user.\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # N_hidden is the number of hidden layers\n",
+ " # deep_params is a list, len() should be used\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consists of\n",
+ " # parameters to all the hidden\n",
+ " # layers AND the output layer.\n",
+ "\n",
+ " # Assumes input x being an one-dimensional array\n",
+ " num_values = np.size(x)\n",
+ " x = x.reshape(-1, num_values)\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ "\n",
+ " # Due to multiple hidden layers, define a variable referencing to the\n",
+ " # output of the previous layer:\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output\n",
+ "\n",
+ "# The trial solution using the deep neural network:\n",
+ "def g_trial_deep(x,params, g0 = 10):\n",
+ " return g0 + x*deep_neural_network(params, x)\n",
+ "\n",
+ "# The right side of the ODE:\n",
+ "def g(x, g_trial, gamma = 2):\n",
+ " return -gamma*g_trial\n",
+ "\n",
+ "# The same cost function as before, but calls deep_neural_network instead.\n",
+ "def cost_function_deep(P, x):\n",
+ "\n",
+ " # Evaluate the trial function with the current parameters P\n",
+ " g_t = g_trial_deep(x,P)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the neural network\n",
+ " d_net_out = elementwise_grad(deep_neural_network,1)(P,x)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the trial function\n",
+ " d_g_t = elementwise_grad(g_trial_deep,0)(x,P)\n",
+ "\n",
+ " # The right side of the ODE\n",
+ " func = g(x, g_t)\n",
+ "\n",
+ " err_sqr = (d_g_t - func)**2\n",
+ " cost_sum = np.sum(err_sqr)\n",
+ "\n",
+ " return cost_sum / np.size(err_sqr)\n",
+ "\n",
+ "# Solve the exponential decay ODE using neural network with one input and one output layer,\n",
+ "# but with specified number of hidden layers from the user.\n",
+ "def solve_ode_deep_neural_network(x, num_neurons, num_iter, lmb):\n",
+ " # num_hidden_neurons is now a list of number of neurons within each hidden layer\n",
+ "\n",
+ " # The number of elements in the list num_hidden_neurons thus represents\n",
+ " # the number of hidden layers.\n",
+ "\n",
+ " # Find the number of hidden layers:\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weights and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 )\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " ## Start finding the optimal weights using gradient descent\n",
+ "\n",
+ " # Find the Python function that represents the gradient of the cost function\n",
+ " # w.r.t the 0-th input argument -- that is the weights and biases in the hidden and output layer\n",
+ " cost_function_deep_grad = grad(cost_function_deep,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " # Evaluate the gradient at the current weights and biases in P.\n",
+ " # The cost_grad consist now of N_hidden + 1 arrays; the gradient w.r.t the weights and biases\n",
+ " # in the hidden layers and output layers evaluated at x.\n",
+ " cost_deep_grad = cost_function_deep_grad(P, x)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_deep_grad[l]\n",
+ "\n",
+ " print('Final cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "def g_analytic(x, gamma = 2, g0 = 10):\n",
+ " return g0*np.exp(-gamma*x)\n",
+ "\n",
+ "# Solve the given problem\n",
+ "if __name__ == '__main__':\n",
+ " npr.seed(15)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " N = 10\n",
+ " x = np.linspace(0, 1, N)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = np.array([10,10])\n",
+ " num_iter = 10000\n",
+ " lmb = 0.001\n",
+ "\n",
+ " P = solve_ode_deep_neural_network(x, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " res = g_trial_deep(x,P)\n",
+ " res_analytical = g_analytic(x)\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of a deep neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(x, res_analytical)\n",
+ " plt.plot(x, res[0,:])\n",
+ " plt.legend(['analytical','dnn'])\n",
+ " plt.ylabel('g(x)')\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "807a375c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Example: Population growth\n",
+ "\n",
+ "A logistic model of population growth assumes that a population converges toward an equilibrium.\n",
+ "The population growth can be modeled by"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d35839bb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{log} \\tag{10}\n",
+ "\tg'(t) = \\alpha g(t)(A - g(t))\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2991d1fe",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $g(t)$ is the population density at time $t$, $\\alpha > 0$ the growth rate and $A > 0$ is the maximum population number in the environment.\n",
+ "Also, at $t = 0$ the population has the size $g(0) = g_0$, where $g_0$ is some chosen constant.\n",
+ "\n",
+ "In this example, similar network as for the exponential decay using Autograd has been used to solve the equation. However, as the implementation might suffer from e.g numerical instability\n",
+ "and high execution time (this might be more apparent in the examples solving PDEs),\n",
+ "using a library like TensorFlow is recommended.\n",
+ "Here, we stay with a more simple approach and implement for comparison, the simple forward Euler method."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ee668a71",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the problem\n",
+ "\n",
+ "Here, we will model a population $g(t)$ in an environment having carrying capacity $A$.\n",
+ "The population follows the model"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "febf10cc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{solveode_population} \\tag{11}\n",
+ "g'(t) = \\alpha g(t)(A - g(t))\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "494194e3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $g(0) = g_0$.\n",
+ "\n",
+ "In this example, we let $\\alpha = 2$, $A = 1$, and $g_0 = 1.2$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5efa7b11",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The trial solution\n",
+ "\n",
+ "We will get a slightly different trial solution, as the boundary conditions are different\n",
+ "compared to the case for exponential decay.\n",
+ "\n",
+ "A possible trial solution satisfying the condition $g(0) = g_0$ could be\n",
+ "\n",
+ "$$\n",
+ "h_1(t) = g_0 + t \\cdot N(t,P)\n",
+ "$$\n",
+ "\n",
+ "with $N(t,P)$ being the output from the neural network with weights and biases for each layer collected in the set $P$.\n",
+ "\n",
+ "The analytical solution is\n",
+ "\n",
+ "$$\n",
+ "g(t) = \\frac{Ag_0}{g_0 + (A - g_0)\\exp(-\\alpha A t)}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "568131dc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The program using Autograd\n",
+ "\n",
+ "The network will be the similar as for the exponential decay example, but with some small modifications for our problem."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "id": "8737e028",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import grad, elementwise_grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import pyplot as plt\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "# Function to get the parameters.\n",
+ "# Done such that one can easily change the paramaters after one's liking.\n",
+ "def get_parameters():\n",
+ " alpha = 2\n",
+ " A = 1\n",
+ " g0 = 1.2\n",
+ " return alpha, A, g0\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # N_hidden is the number of hidden layers\n",
+ " # deep_params is a list, len() should be used\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consists of\n",
+ " # parameters to all the hidden\n",
+ " # layers AND the output layer.\n",
+ "\n",
+ " # Assumes input x being an one-dimensional array\n",
+ " num_values = np.size(x)\n",
+ " x = x.reshape(-1, num_values)\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ "\n",
+ " # Due to multiple hidden layers, define a variable referencing to the\n",
+ " # output of the previous layer:\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "def cost_function_deep(P, x):\n",
+ "\n",
+ " # Evaluate the trial function with the current parameters P\n",
+ " g_t = g_trial_deep(x,P)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the trial function\n",
+ " d_g_t = elementwise_grad(g_trial_deep,0)(x,P)\n",
+ "\n",
+ " # The right side of the ODE\n",
+ " func = f(x, g_t)\n",
+ "\n",
+ " err_sqr = (d_g_t - func)**2\n",
+ " cost_sum = np.sum(err_sqr)\n",
+ "\n",
+ " return cost_sum / np.size(err_sqr)\n",
+ "\n",
+ "# The right side of the ODE:\n",
+ "def f(x, g_trial):\n",
+ " alpha,A, g0 = get_parameters()\n",
+ " return alpha*g_trial*(A - g_trial)\n",
+ "\n",
+ "# The trial solution using the deep neural network:\n",
+ "def g_trial_deep(x, params):\n",
+ " alpha,A, g0 = get_parameters()\n",
+ " return g0 + x*deep_neural_network(params,x)\n",
+ "\n",
+ "# The analytical solution:\n",
+ "def g_analytic(t):\n",
+ " alpha,A, g0 = get_parameters()\n",
+ " return A*g0/(g0 + (A - g0)*np.exp(-alpha*A*t))\n",
+ "\n",
+ "def solve_ode_deep_neural_network(x, num_neurons, num_iter, lmb):\n",
+ " # num_hidden_neurons is now a list of number of neurons within each hidden layer\n",
+ "\n",
+ " # Find the number of hidden layers:\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weigths and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 )\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " ## Start finding the optimal weigths using gradient descent\n",
+ "\n",
+ " # Find the Python function that represents the gradient of the cost function\n",
+ " # w.r.t the 0-th input argument -- that is the weights and biases in the hidden and output layer\n",
+ " cost_function_deep_grad = grad(cost_function_deep,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " # Evaluate the gradient at the current weights and biases in P.\n",
+ " # The cost_grad consist now of N_hidden + 1 arrays; the gradient w.r.t the weights and biases\n",
+ " # in the hidden layers and output layers evaluated at x.\n",
+ " cost_deep_grad = cost_function_deep_grad(P, x)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_deep_grad[l]\n",
+ "\n",
+ " print('Final cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " npr.seed(4155)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nt = 10\n",
+ " T = 1\n",
+ " t = np.linspace(0,T, Nt)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = [100, 50, 25]\n",
+ " num_iter = 1000\n",
+ " lmb = 1e-3\n",
+ "\n",
+ " P = solve_ode_deep_neural_network(t, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " g_dnn_ag = g_trial_deep(t,P)\n",
+ " g_analytical = g_analytic(t)\n",
+ "\n",
+ " # Find the maximum absolute difference between the solutons:\n",
+ " diff_ag = np.max(np.abs(g_dnn_ag - g_analytical))\n",
+ " print(\"The max absolute difference between the solutions is: %g\"%diff_ag)\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(t, g_analytical)\n",
+ " plt.plot(t, g_dnn_ag[0,:])\n",
+ " plt.legend(['analytical','nn'])\n",
+ " plt.xlabel('t')\n",
+ " plt.ylabel('g(t)')\n",
+ "\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0904f64d",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Using forward Euler to solve the ODE\n",
+ "\n",
+ "A straightforward way of solving an ODE numerically, is to use Euler's method.\n",
+ "\n",
+ "Euler's method uses Taylor series to approximate the value at a function $f$ at a step $\\Delta x$ from $x$:\n",
+ "\n",
+ "$$\n",
+ "f(x + \\Delta x) \\approx f(x) + \\Delta x f'(x)\n",
+ "$$\n",
+ "\n",
+ "In our case, using Euler's method to approximate the value of $g$ at a step $\\Delta t$ from $t$ yields"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6f3577a8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ " g(t + \\Delta t) &\\approx g(t) + \\Delta t g'(t) \\\\\n",
+ " &= g(t) + \\Delta t \\big(\\alpha g(t)(A - g(t))\\big)\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "56d4410b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "along with the condition that $g(0) = g_0$.\n",
+ "\n",
+ "Let $t_i = i \\cdot \\Delta t$ where $\\Delta t = \\frac{T}{N_t-1}$ where $T$ is the final time our solver must solve for and $N_t$ the number of values for $t \\in [0, T]$ for $i = 0, \\dots, N_t-1$.\n",
+ "\n",
+ "For $i \\geq 1$, we have that"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "48d2707e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "t_i &= i\\Delta t \\\\\n",
+ "&= (i - 1)\\Delta t + \\Delta t \\\\\n",
+ "&= t_{i-1} + \\Delta t\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "66d99f85",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Now, if $g_i = g(t_i)$ then"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3c9447d9",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation}\n",
+ " \\begin{aligned}\n",
+ " g_i &= g(t_i) \\\\\n",
+ " &= g(t_{i-1} + \\Delta t) \\\\\n",
+ " &\\approx g(t_{i-1}) + \\Delta t \\big(\\alpha g(t_{i-1})(A - g(t_{i-1}))\\big) \\\\\n",
+ " &= g_{i-1} + \\Delta t \\big(\\alpha g_{i-1}(A - g_{i-1})\\big)\n",
+ " \\end{aligned}\n",
+ "\\end{equation} \\label{odenum} \\tag{12}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "724b97f1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "for $i \\geq 1$ and $g_0 = g(t_0) = g(0) = g_0$.\n",
+ "\n",
+ "Equation ([12](#odenum)) could be implemented in the following way,\n",
+ "extending the program that uses the network using Autograd:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "id": "58b0da70",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "# Assume that all function definitions from the example program using Autograd\n",
+ "# are located here.\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " npr.seed(4155)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nt = 10\n",
+ " T = 1\n",
+ " t = np.linspace(0,T, Nt)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = [100,50,25]\n",
+ " num_iter = 1000\n",
+ " lmb = 1e-3\n",
+ "\n",
+ " P = solve_ode_deep_neural_network(t, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " g_dnn_ag = g_trial_deep(t,P)\n",
+ " g_analytical = g_analytic(t)\n",
+ "\n",
+ " # Find the maximum absolute difference between the solutons:\n",
+ " diff_ag = np.max(np.abs(g_dnn_ag - g_analytical))\n",
+ " print(\"The max absolute difference between the solutions is: %g\"%diff_ag)\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(t, g_analytical)\n",
+ " plt.plot(t, g_dnn_ag[0,:])\n",
+ " plt.legend(['analytical','nn'])\n",
+ " plt.xlabel('t')\n",
+ " plt.ylabel('g(t)')\n",
+ "\n",
+ " ## Find an approximation to the funtion using forward Euler\n",
+ "\n",
+ " alpha, A, g0 = get_parameters()\n",
+ " dt = T/(Nt - 1)\n",
+ "\n",
+ " # Perform forward Euler to solve the ODE\n",
+ " g_euler = np.zeros(Nt)\n",
+ " g_euler[0] = g0\n",
+ "\n",
+ " for i in range(1,Nt):\n",
+ " g_euler[i] = g_euler[i-1] + dt*(alpha*g_euler[i-1]*(A - g_euler[i-1]))\n",
+ "\n",
+ " # Print the errors done by each method\n",
+ " diff1 = np.max(np.abs(g_euler - g_analytical))\n",
+ " diff2 = np.max(np.abs(g_dnn_ag[0,:] - g_analytical))\n",
+ "\n",
+ " print('Max absolute difference between Euler method and analytical: %g'%diff1)\n",
+ " print('Max absolute difference between deep neural network and analytical: %g'%diff2)\n",
+ "\n",
+ " # Plot results\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.plot(t,g_euler)\n",
+ " plt.plot(t,g_analytical)\n",
+ " plt.plot(t,g_dnn_ag[0,:])\n",
+ "\n",
+ " plt.legend(['euler','analytical','dnn'])\n",
+ " plt.xlabel('Time t')\n",
+ " plt.ylabel('g(t)')\n",
+ "\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f1230dee",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Example: Solving the one dimensional Poisson equation\n",
+ "\n",
+ "The Poisson equation for $g(x)$ in one dimension is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ba2c6d0a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{poisson} \\tag{13}\n",
+ " -g''(x) = f(x)\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bab1c7d3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $f(x)$ is a given function for $x \\in (0,1)$.\n",
+ "\n",
+ "The conditions that $g(x)$ is chosen to fulfill, are"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "42bfde23",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{align*}\n",
+ " g(0) &= 0 \\\\\n",
+ " g(1) &= 0\n",
+ "\\end{align*}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7b3a2504",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "This equation can be solved numerically using programs where e.g Autograd and TensorFlow are used.\n",
+ "The results from the networks can then be compared to the analytical solution.\n",
+ "In addition, it could be interesting to see how a typical method for numerically solving second order ODEs compares to the neural networks."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a419909c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The specific equation to solve for\n",
+ "\n",
+ "Here, the function $g(x)$ to solve for follows the equation"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "125f8197",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "-g''(x) = f(x),\\qquad x \\in (0,1)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "16376b60",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $f(x)$ is a given function, along with the chosen conditions"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "044c76ec",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{aligned}\n",
+ "g(0) = g(1) = 0\n",
+ "\\end{aligned}\\label{cond} \\tag{14}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0ec4860b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "In this example, we consider the case when $f(x) = (3x + x^2)\\exp(x)$.\n",
+ "\n",
+ "For this case, a possible trial solution satisfying the conditions could be"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "03e27ec0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "g_t(x) = x \\cdot (1-x) \\cdot N(P,x)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "82fdb51f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "The analytical solution for this problem is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "82e39d0e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "g(x) = x(1 - x)\\exp(x)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bf029e6c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Solving the equation using Autograd"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "id": "e10d7641",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import grad, elementwise_grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import pyplot as plt\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # N_hidden is the number of hidden layers\n",
+ " # deep_params is a list, len() should be used\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consists of\n",
+ " # parameters to all the hidden\n",
+ " # layers AND the output layer.\n",
+ "\n",
+ " # Assumes input x being an one-dimensional array\n",
+ " num_values = np.size(x)\n",
+ " x = x.reshape(-1, num_values)\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ "\n",
+ " # Due to multiple hidden layers, define a variable referencing to the\n",
+ " # output of the previous layer:\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output\n",
+ "\n",
+ "\n",
+ "def solve_ode_deep_neural_network(x, num_neurons, num_iter, lmb):\n",
+ " # num_hidden_neurons is now a list of number of neurons within each hidden layer\n",
+ "\n",
+ " # Find the number of hidden layers:\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weigths and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 )\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " ## Start finding the optimal weigths using gradient descent\n",
+ "\n",
+ " # Find the Python function that represents the gradient of the cost function\n",
+ " # w.r.t the 0-th input argument -- that is the weights and biases in the hidden and output layer\n",
+ " cost_function_deep_grad = grad(cost_function_deep,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " # Evaluate the gradient at the current weights and biases in P.\n",
+ " # The cost_grad consist now of N_hidden + 1 arrays; the gradient w.r.t the weights and biases\n",
+ " # in the hidden layers and output layers evaluated at x.\n",
+ " cost_deep_grad = cost_function_deep_grad(P, x)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_deep_grad[l]\n",
+ "\n",
+ " print('Final cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "## Set up the cost function specified for this Poisson equation:\n",
+ "\n",
+ "# The right side of the ODE\n",
+ "def f(x):\n",
+ " return (3*x + x**2)*np.exp(x)\n",
+ "\n",
+ "def cost_function_deep(P, x):\n",
+ "\n",
+ " # Evaluate the trial function with the current parameters P\n",
+ " g_t = g_trial_deep(x,P)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the trial function\n",
+ " d2_g_t = elementwise_grad(elementwise_grad(g_trial_deep,0))(x,P)\n",
+ "\n",
+ " right_side = f(x)\n",
+ "\n",
+ " err_sqr = (-d2_g_t - right_side)**2\n",
+ " cost_sum = np.sum(err_sqr)\n",
+ "\n",
+ " return cost_sum/np.size(err_sqr)\n",
+ "\n",
+ "# The trial solution:\n",
+ "def g_trial_deep(x,P):\n",
+ " return x*(1-x)*deep_neural_network(P,x)\n",
+ "\n",
+ "# The analytic solution;\n",
+ "def g_analytic(x):\n",
+ " return x*(1-x)*np.exp(x)\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " npr.seed(4155)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nx = 10\n",
+ " x = np.linspace(0,1, Nx)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = [200,100]\n",
+ " num_iter = 1000\n",
+ " lmb = 1e-3\n",
+ "\n",
+ " P = solve_ode_deep_neural_network(x, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " g_dnn_ag = g_trial_deep(x,P)\n",
+ " g_analytical = g_analytic(x)\n",
+ "\n",
+ " # Find the maximum absolute difference between the solutons:\n",
+ " max_diff = np.max(np.abs(g_dnn_ag - g_analytical))\n",
+ " print(\"The max absolute difference between the solutions is: %g\"%max_diff)\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(x, g_analytical)\n",
+ " plt.plot(x, g_dnn_ag[0,:])\n",
+ " plt.legend(['analytical','nn'])\n",
+ " plt.xlabel('x')\n",
+ " plt.ylabel('g(x)')\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "82891392",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Comparing with a numerical scheme\n",
+ "\n",
+ "The Poisson equation is possible to solve using Taylor series to approximate the second derivative.\n",
+ "\n",
+ "Using Taylor series, the second derivative can be expressed as\n",
+ "\n",
+ "$$\n",
+ "g''(x) = \\frac{g(x + \\Delta x) - 2g(x) + g(x-\\Delta x)}{\\Delta x^2} + E_{\\Delta x}(x)\n",
+ "$$\n",
+ "\n",
+ "where $\\Delta x$ is a small step size and $E_{\\Delta x}(x)$ being the error term.\n",
+ "\n",
+ "Looking away from the error terms gives an approximation to the second derivative:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ad4ef510",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{approx} \\tag{15}\n",
+ "g''(x) \\approx \\frac{g(x + \\Delta x) - 2g(x) + g(x-\\Delta x)}{\\Delta x^2}\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "eb8ab804",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "If $x_i = i \\Delta x = x_{i-1} + \\Delta x$ and $g_i = g(x_i)$ for $i = 1,\\dots N_x - 2$ with $N_x$ being the number of values for $x$, ([15](#approx)) becomes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f9b7b2a0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "g''(x_i) &\\approx \\frac{g(x_i + \\Delta x) - 2g(x_i) + g(x_i -\\Delta x)}{\\Delta x^2} \\\\\n",
+ "&= \\frac{g_{i+1} - 2g_i + g_{i-1}}{\\Delta x^2}\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6a71c7bb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "Since we know from our problem that"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d19780a8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "-g''(x) &= f(x) \\\\\n",
+ "&= (3x + x^2)\\exp(x)\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "00fedc6e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "along with the conditions $g(0) = g(1) = 0$,\n",
+ "the following scheme can be used to find an approximate solution for $g(x)$ numerically:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "28005c86",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation}\n",
+ " \\begin{aligned}\n",
+ " -\\Big( \\frac{g_{i+1} - 2g_i + g_{i-1}}{\\Delta x^2} \\Big) &= f(x_i) \\\\\n",
+ " -g_{i+1} + 2g_i - g_{i-1} &= \\Delta x^2 f(x_i)\n",
+ " \\end{aligned}\n",
+ "\\end{equation} \\label{odesys} \\tag{16}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d562bb0c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "for $i = 1, \\dots, N_x - 2$ where $g_0 = g_{N_x - 1} = 0$ and $f(x_i) = (3x_i + x_i^2)\\exp(x_i)$, which is given for our specific problem.\n",
+ "\n",
+ "The equation can be rewritten into a matrix equation:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bdee81e4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{aligned}\n",
+ "\\begin{pmatrix}\n",
+ "2 & -1 & 0 & \\dots & 0 \\\\\n",
+ "-1 & 2 & -1 & \\dots & 0 \\\\\n",
+ "\\vdots & & \\ddots & & \\vdots \\\\\n",
+ "0 & \\dots & -1 & 2 & -1 \\\\\n",
+ "0 & \\dots & 0 & -1 & 2\\\\\n",
+ "\\end{pmatrix}\n",
+ "\\begin{pmatrix}\n",
+ "g_1 \\\\\n",
+ "g_2 \\\\\n",
+ "\\vdots \\\\\n",
+ "g_{N_x - 3} \\\\\n",
+ "g_{N_x - 2}\n",
+ "\\end{pmatrix}\n",
+ "&=\n",
+ "\\Delta x^2\n",
+ "\\begin{pmatrix}\n",
+ "f(x_1) \\\\\n",
+ "f(x_2) \\\\\n",
+ "\\vdots \\\\\n",
+ "f(x_{N_x - 3}) \\\\\n",
+ "f(x_{N_x - 2})\n",
+ "\\end{pmatrix} \\\\\n",
+ "\\boldsymbol{A}\\boldsymbol{g} &= \\boldsymbol{f},\n",
+ "\\end{aligned}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ddf436f5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "which makes it possible to solve for the vector $\\boldsymbol{g}$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "66ae2d44",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the code\n",
+ "\n",
+ "We can then compare the result from this numerical scheme with the output from our network using Autograd:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "id": "17f02a24",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import grad, elementwise_grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import pyplot as plt\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # N_hidden is the number of hidden layers\n",
+ " # deep_params is a list, len() should be used\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consists of\n",
+ " # parameters to all the hidden\n",
+ " # layers AND the output layer.\n",
+ "\n",
+ " # Assumes input x being an one-dimensional array\n",
+ " num_values = np.size(x)\n",
+ " x = x.reshape(-1, num_values)\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ "\n",
+ " # Due to multiple hidden layers, define a variable referencing to the\n",
+ " # output of the previous layer:\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_values)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output\n",
+ "\n",
+ "\n",
+ "def solve_ode_deep_neural_network(x, num_neurons, num_iter, lmb):\n",
+ " # num_hidden_neurons is now a list of number of neurons within each hidden layer\n",
+ "\n",
+ " # Find the number of hidden layers:\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weigths and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 )\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " ## Start finding the optimal weigths using gradient descent\n",
+ "\n",
+ " # Find the Python function that represents the gradient of the cost function\n",
+ " # w.r.t the 0-th input argument -- that is the weights and biases in the hidden and output layer\n",
+ " cost_function_deep_grad = grad(cost_function_deep,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " # Evaluate the gradient at the current weights and biases in P.\n",
+ " # The cost_grad consist now of N_hidden + 1 arrays; the gradient w.r.t the weights and biases\n",
+ " # in the hidden layers and output layers evaluated at x.\n",
+ " cost_deep_grad = cost_function_deep_grad(P, x)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_deep_grad[l]\n",
+ "\n",
+ " print('Final cost: %g'%cost_function_deep(P, x))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "## Set up the cost function specified for this Poisson equation:\n",
+ "\n",
+ "# The right side of the ODE\n",
+ "def f(x):\n",
+ " return (3*x + x**2)*np.exp(x)\n",
+ "\n",
+ "def cost_function_deep(P, x):\n",
+ "\n",
+ " # Evaluate the trial function with the current parameters P\n",
+ " g_t = g_trial_deep(x,P)\n",
+ "\n",
+ " # Find the derivative w.r.t x of the trial function\n",
+ " d2_g_t = elementwise_grad(elementwise_grad(g_trial_deep,0))(x,P)\n",
+ "\n",
+ " right_side = f(x)\n",
+ "\n",
+ " err_sqr = (-d2_g_t - right_side)**2\n",
+ " cost_sum = np.sum(err_sqr)\n",
+ "\n",
+ " return cost_sum/np.size(err_sqr)\n",
+ "\n",
+ "# The trial solution:\n",
+ "def g_trial_deep(x,P):\n",
+ " return x*(1-x)*deep_neural_network(P,x)\n",
+ "\n",
+ "# The analytic solution;\n",
+ "def g_analytic(x):\n",
+ " return x*(1-x)*np.exp(x)\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " npr.seed(4155)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nx = 10\n",
+ " x = np.linspace(0,1, Nx)\n",
+ "\n",
+ " ## Set up the initial parameters\n",
+ " num_hidden_neurons = [200,100]\n",
+ " num_iter = 1000\n",
+ " lmb = 1e-3\n",
+ "\n",
+ " P = solve_ode_deep_neural_network(x, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " g_dnn_ag = g_trial_deep(x,P)\n",
+ " g_analytical = g_analytic(x)\n",
+ "\n",
+ " # Find the maximum absolute difference between the solutons:\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.title('Performance of neural network solving an ODE compared to the analytical solution')\n",
+ " plt.plot(x, g_analytical)\n",
+ " plt.plot(x, g_dnn_ag[0,:])\n",
+ " plt.legend(['analytical','nn'])\n",
+ " plt.xlabel('x')\n",
+ " plt.ylabel('g(x)')\n",
+ "\n",
+ " ## Perform the computation using the numerical scheme\n",
+ "\n",
+ " dx = 1/(Nx - 1)\n",
+ "\n",
+ " # Set up the matrix A\n",
+ " A = np.zeros((Nx-2,Nx-2))\n",
+ "\n",
+ " A[0,0] = 2\n",
+ " A[0,1] = -1\n",
+ "\n",
+ " for i in range(1,Nx-3):\n",
+ " A[i,i-1] = -1\n",
+ " A[i,i] = 2\n",
+ " A[i,i+1] = -1\n",
+ "\n",
+ " A[Nx - 3, Nx - 4] = -1\n",
+ " A[Nx - 3, Nx - 3] = 2\n",
+ "\n",
+ " # Set up the vector f\n",
+ " f_vec = dx**2 * f(x[1:-1])\n",
+ "\n",
+ " # Solve the equation\n",
+ " g_res = np.linalg.solve(A,f_vec)\n",
+ "\n",
+ " g_vec = np.zeros(Nx)\n",
+ " g_vec[1:-1] = g_res\n",
+ "\n",
+ " # Print the differences between each method\n",
+ " max_diff1 = np.max(np.abs(g_dnn_ag - g_analytical))\n",
+ " max_diff2 = np.max(np.abs(g_vec - g_analytical))\n",
+ " print(\"The max absolute difference between the analytical solution and DNN Autograd: %g\"%max_diff1)\n",
+ " print(\"The max absolute difference between the analytical solution and numerical scheme: %g\"%max_diff2)\n",
+ "\n",
+ " # Plot the results\n",
+ " plt.figure(figsize=(10,10))\n",
+ "\n",
+ " plt.plot(x,g_vec)\n",
+ " plt.plot(x,g_analytical)\n",
+ " plt.plot(x,g_dnn_ag[0,:])\n",
+ "\n",
+ " plt.legend(['numerical scheme','analytical','dnn'])\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "51ee4433",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Partial Differential Equations\n",
+ "\n",
+ "A partial differential equation (PDE) has a solution here the function\n",
+ "is defined by multiple variables. The equation may involve all kinds\n",
+ "of combinations of which variables the function is differentiated with\n",
+ "respect to.\n",
+ "\n",
+ "In general, a partial differential equation for a function $g(x_1,\\dots,x_N)$ with $N$ variables may be expressed as"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1ec16aab",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{PDE} \\tag{17}\n",
+ " f\\left(x_1, \\, \\dots \\, , x_N, \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_1}, \\dots , \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_N}, \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_1\\partial x_2}, \\, \\dots \\, , \\frac{\\partial^n g(x_1,\\dots,x_N) }{\\partial x_N^n} \\right) = 0\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "64fd215d",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $f$ is an expression involving all kinds of possible mixed derivatives of $g(x_1,\\dots,x_N)$ up to an order $n$. In order for the solution to be unique, some additional conditions must also be given."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3efab799",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Type of problem\n",
+ "\n",
+ "The problem our network must solve for, is similar to the ODE case.\n",
+ "We must have a trial solution $g_t$ at hand.\n",
+ "\n",
+ "For instance, the trial solution could be expressed as"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "80e6d77c",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{align*}\n",
+ " g_t(x_1,\\dots,x_N) = h_1(x_1,\\dots,x_N) + h_2(x_1,\\dots,x_N,N(x_1,\\dots,x_N,P))\n",
+ "\\end{align*}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f08a42bd",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $h_1(x_1,\\dots,x_N)$ is a function that ensures $g_t(x_1,\\dots,x_N)$ satisfies some given conditions.\n",
+ "The neural network $N(x_1,\\dots,x_N,P)$ has weights and biases described by $P$ and $h_2(x_1,\\dots,x_N,N(x_1,\\dots,x_N,P))$ is an expression using the output from the neural network in some way.\n",
+ "\n",
+ "The role of the function $h_2(x_1,\\dots,x_N,N(x_1,\\dots,x_N,P))$, is to ensure that the output of $N(x_1,\\dots,x_N,P)$ is zero when $g_t(x_1,\\dots,x_N)$ is evaluated at the values of $x_1,\\dots,x_N$ where the given conditions must be satisfied. The function $h_1(x_1,\\dots,x_N)$ should alone make $g_t(x_1,\\dots,x_N)$ satisfy the conditions."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "af035b50",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Network requirements\n",
+ "\n",
+ "The network tries then the minimize the cost function following the\n",
+ "same ideas as described for the ODE case, but now with more than one\n",
+ "variables to consider. The concept still remains the same; find a set\n",
+ "of parameters $P$ such that the expression $f$ in ([17](#PDE)) is as\n",
+ "close to zero as possible.\n",
+ "\n",
+ "As for the ODE case, the cost function is the mean squared error that\n",
+ "the network must try to minimize. The cost function for the network to\n",
+ "minimize is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ee147dfb",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "C\\left(x_1, \\dots, x_N, P\\right) = \\left( f\\left(x_1, \\, \\dots \\, , x_N, \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_1}, \\dots , \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_N}, \\frac{\\partial g(x_1,\\dots,x_N) }{\\partial x_1\\partial x_2}, \\, \\dots \\, , \\frac{\\partial^n g(x_1,\\dots,x_N) }{\\partial x_N^n} \\right) \\right)^2\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "850e95ed",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## More details\n",
+ "\n",
+ "If we let $\\boldsymbol{x} = \\big( x_1, \\dots, x_N \\big)$ be an array containing the values for $x_1, \\dots, x_N$ respectively, the cost function can be reformulated into the following:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "96f9cca4",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "C\\left(\\boldsymbol{x}, P\\right) = f\\left( \\left( \\boldsymbol{x}, \\frac{\\partial g(\\boldsymbol{x}) }{\\partial x_1}, \\dots , \\frac{\\partial g(\\boldsymbol{x}) }{\\partial x_N}, \\frac{\\partial g(\\boldsymbol{x}) }{\\partial x_1\\partial x_2}, \\, \\dots \\, , \\frac{\\partial^n g(\\boldsymbol{x}) }{\\partial x_N^n} \\right) \\right)^2\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "70394cae",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "If we also have $M$ different sets of values for $x_1, \\dots, x_N$, that is $\\boldsymbol{x}_i = \\big(x_1^{(i)}, \\dots, x_N^{(i)}\\big)$ for $i = 1,\\dots,M$ being the rows in matrix $X$, the cost function can be generalized into"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d06e6c30",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "C\\left(X, P \\right) = \\sum_{i=1}^M f\\left( \\left( \\boldsymbol{x}_i, \\frac{\\partial g(\\boldsymbol{x}_i) }{\\partial x_1}, \\dots , \\frac{\\partial g(\\boldsymbol{x}_i) }{\\partial x_N}, \\frac{\\partial g(\\boldsymbol{x}_i) }{\\partial x_1\\partial x_2}, \\, \\dots \\, , \\frac{\\partial^n g(\\boldsymbol{x}_i) }{\\partial x_N^n} \\right) \\right)^2.\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b4972f88",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Example: The diffusion equation\n",
+ "\n",
+ "In one spatial dimension, the equation reads"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3d35cbd3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\frac{\\partial g(x,t)}{\\partial t} = \\frac{\\partial^2 g(x,t)}{\\partial x^2}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "984bf645",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where a possible choice of conditions are"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9d58d0ec",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{align*}\n",
+ "g(0,t) &= 0 ,\\qquad t \\geq 0 \\\\\n",
+ "g(1,t) &= 0, \\qquad t \\geq 0 \\\\\n",
+ "g(x,0) &= u(x),\\qquad x\\in [0,1]\n",
+ "\\end{align*}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "99cf8f47",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $u(x)$ being some given function."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "777ad3a8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Defining the problem\n",
+ "\n",
+ "For this case, we want to find $g(x,t)$ such that"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7182b747",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation}\n",
+ " \\frac{\\partial g(x,t)}{\\partial t} = \\frac{\\partial^2 g(x,t)}{\\partial x^2}\n",
+ "\\end{equation} \\label{diffonedim} \\tag{18}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3c40d528",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "and"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7cb1e15a",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{align*}\n",
+ "g(0,t) &= 0 ,\\qquad t \\geq 0 \\\\\n",
+ "g(1,t) &= 0, \\qquad t \\geq 0 \\\\\n",
+ "g(x,0) &= u(x),\\qquad x\\in [0,1]\n",
+ "\\end{align*}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5c4bcdb5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $u(x) = \\sin(\\pi x)$.\n",
+ "\n",
+ "First, let us set up the deep neural network.\n",
+ "The deep neural network will follow the same structure as discussed in the examples solving the ODEs.\n",
+ "First, we will look into how Autograd could be used in a network tailored to solve for bivariate functions."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c84ff432",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the network using Autograd\n",
+ "\n",
+ "The only change to do here, is to extend our network such that\n",
+ "functions of multiple parameters are correctly handled. In this case\n",
+ "we have two variables in our function to solve for, that is time $t$\n",
+ "and position $x$. The variables will be represented by a\n",
+ "one-dimensional array in the program. The program will evaluate the\n",
+ "network at each possible pair $(x,t)$, given an array for the desired\n",
+ "$x$-values and $t$-values to approximate the solution at."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "id": "ba62ab4c",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # x is now a point and a 1D numpy array; make it a column vector\n",
+ " num_coordinates = np.size(x,0)\n",
+ " x = x.reshape(num_coordinates,-1)\n",
+ "\n",
+ " num_points = np.size(x,1)\n",
+ "\n",
+ " # N_hidden is the number of hidden layers\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consist of parameters to all the hidden layers AND the output layer\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output[0][0]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7fd9e6dc",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the network using Autograd; The trial solution\n",
+ "\n",
+ "The cost function must then iterate through the given arrays\n",
+ "containing values for $x$ and $t$, defines a point $(x,t)$ the deep\n",
+ "neural network and the trial solution is evaluated at, and then finds\n",
+ "the Jacobian of the trial solution.\n",
+ "\n",
+ "A possible trial solution for this PDE is\n",
+ "\n",
+ "$$\n",
+ "g_t(x,t) = h_1(x,t) + x(1-x)tN(x,t,P)\n",
+ "$$\n",
+ "\n",
+ "with $A(x,t)$ being a function ensuring that $g_t(x,t)$ satisfies our given conditions, and $N(x,t,P)$ being the output from the deep neural network using weights and biases for each layer from $P$.\n",
+ "\n",
+ "To fulfill the conditions, $A(x,t)$ could be:\n",
+ "\n",
+ "$$\n",
+ "h_1(x,t) = (1-t)\\Big(u(x) - \\big((1-x)u(0) + x u(1)\\big)\\Big) = (1-t)u(x) = (1-t)\\sin(\\pi x)\n",
+ "$$\n",
+ "since $(0) = u(1) = 0$ and $u(x) = \\sin(\\pi x)$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6c63c928",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Why the jacobian?\n",
+ "\n",
+ "The Jacobian is used because the program must find the derivative of\n",
+ "the trial solution with respect to $x$ and $t$.\n",
+ "\n",
+ "This gives the necessity of computing the Jacobian matrix, as we want\n",
+ "to evaluate the gradient with respect to $x$ and $t$ (note that the\n",
+ "Jacobian of a scalar-valued multivariate function is simply its\n",
+ "gradient).\n",
+ "\n",
+ "In Autograd, the differentiation is by default done with respect to\n",
+ "the first input argument of your Python function. Since the points is\n",
+ "an array representing $x$ and $t$, the Jacobian is calculated using\n",
+ "the values of $x$ and $t$.\n",
+ "\n",
+ "To find the second derivative with respect to $x$ and $t$, the\n",
+ "Jacobian can be found for the second time. The result is a Hessian\n",
+ "matrix, which is the matrix containing all the possible second order\n",
+ "mixed derivatives of $g(x,t)$."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "id": "4192bf3d",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "# Set up the trial function:\n",
+ "def u(x):\n",
+ " return np.sin(np.pi*x)\n",
+ "\n",
+ "def g_trial(point,P):\n",
+ " x,t = point\n",
+ " return (1-t)*u(x) + x*(1-x)*t*deep_neural_network(P,point)\n",
+ "\n",
+ "# The right side of the ODE:\n",
+ "def f(point):\n",
+ " return 0.\n",
+ "\n",
+ "# The cost function:\n",
+ "def cost_function(P, x, t):\n",
+ " cost_sum = 0\n",
+ "\n",
+ " g_t_jacobian_func = jacobian(g_trial)\n",
+ " g_t_hessian_func = hessian(g_trial)\n",
+ "\n",
+ " for x_ in x:\n",
+ " for t_ in t:\n",
+ " point = np.array([x_,t_])\n",
+ "\n",
+ " g_t = g_trial(point,P)\n",
+ " g_t_jacobian = g_t_jacobian_func(point,P)\n",
+ " g_t_hessian = g_t_hessian_func(point,P)\n",
+ "\n",
+ " g_t_dt = g_t_jacobian[1]\n",
+ " g_t_d2x = g_t_hessian[0][0]\n",
+ "\n",
+ " func = f(point)\n",
+ "\n",
+ " err_sqr = ( (g_t_dt - g_t_d2x) - func)**2\n",
+ " cost_sum += err_sqr\n",
+ "\n",
+ " return cost_sum"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "87f8417d",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Setting up the network using Autograd; The full program\n",
+ "\n",
+ "Having set up the network, along with the trial solution and cost function, we can now see how the deep neural network performs by comparing the results to the analytical solution.\n",
+ "\n",
+ "The analytical solution of our problem is\n",
+ "\n",
+ "$$\n",
+ "g(x,t) = \\exp(-\\pi^2 t)\\sin(\\pi x)\n",
+ "$$\n",
+ "\n",
+ "A possible way to implement a neural network solving the PDE, is given below.\n",
+ "Be aware, though, that it is fairly slow for the parameters used.\n",
+ "A better result is possible, but requires more iterations, and thus longer time to complete.\n",
+ "\n",
+ "Indeed, the program below is not optimal in its implementation, but rather serves as an example on how to implement and use a neural network to solve a PDE.\n",
+ "Using TensorFlow results in a much better execution time. Try it!"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "id": "1572e93b",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import jacobian,hessian,grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import cm\n",
+ "from matplotlib import pyplot as plt\n",
+ "from mpl_toolkits.mplot3d import axes3d\n",
+ "\n",
+ "## Set up the network\n",
+ "\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # x is now a point and a 1D numpy array; make it a column vector\n",
+ " num_coordinates = np.size(x,0)\n",
+ " x = x.reshape(num_coordinates,-1)\n",
+ "\n",
+ " num_points = np.size(x,1)\n",
+ "\n",
+ " # N_hidden is the number of hidden layers\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consist of parameters to all the hidden layers AND the output layer\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output[0][0]\n",
+ "\n",
+ "## Define the trial solution and cost function\n",
+ "def u(x):\n",
+ " return np.sin(np.pi*x)\n",
+ "\n",
+ "def g_trial(point,P):\n",
+ " x,t = point\n",
+ " return (1-t)*u(x) + x*(1-x)*t*deep_neural_network(P,point)\n",
+ "\n",
+ "# The right side of the ODE:\n",
+ "def f(point):\n",
+ " return 0.\n",
+ "\n",
+ "# The cost function:\n",
+ "def cost_function(P, x, t):\n",
+ " cost_sum = 0\n",
+ "\n",
+ " g_t_jacobian_func = jacobian(g_trial)\n",
+ " g_t_hessian_func = hessian(g_trial)\n",
+ "\n",
+ " for x_ in x:\n",
+ " for t_ in t:\n",
+ " point = np.array([x_,t_])\n",
+ "\n",
+ " g_t = g_trial(point,P)\n",
+ " g_t_jacobian = g_t_jacobian_func(point,P)\n",
+ " g_t_hessian = g_t_hessian_func(point,P)\n",
+ "\n",
+ " g_t_dt = g_t_jacobian[1]\n",
+ " g_t_d2x = g_t_hessian[0][0]\n",
+ "\n",
+ " func = f(point)\n",
+ "\n",
+ " err_sqr = ( (g_t_dt - g_t_d2x) - func)**2\n",
+ " cost_sum += err_sqr\n",
+ "\n",
+ " return cost_sum /( np.size(x)*np.size(t) )\n",
+ "\n",
+ "## For comparison, define the analytical solution\n",
+ "def g_analytic(point):\n",
+ " x,t = point\n",
+ " return np.exp(-np.pi**2*t)*np.sin(np.pi*x)\n",
+ "\n",
+ "## Set up a function for training the network to solve for the equation\n",
+ "def solve_pde_deep_neural_network(x,t, num_neurons, num_iter, lmb):\n",
+ " ## Set up initial weigths and biases\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weigths and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 + 1 ) # 2 since we have two points, +1 to include bias\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: ',cost_function(P, x, t))\n",
+ "\n",
+ " cost_function_grad = grad(cost_function,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " cost_grad = cost_function_grad(P, x , t)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_grad[l]\n",
+ "\n",
+ " print('Final cost: ',cost_function(P, x, t))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " ### Use the neural network:\n",
+ " npr.seed(15)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nx = 10; Nt = 10\n",
+ " x = np.linspace(0, 1, Nx)\n",
+ " t = np.linspace(0,1,Nt)\n",
+ "\n",
+ " ## Set up the parameters for the network\n",
+ " num_hidden_neurons = [100, 25]\n",
+ " num_iter = 250\n",
+ " lmb = 0.01\n",
+ "\n",
+ " P = solve_pde_deep_neural_network(x,t, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " ## Store the results\n",
+ " g_dnn_ag = np.zeros((Nx, Nt))\n",
+ " G_analytical = np.zeros((Nx, Nt))\n",
+ " for i,x_ in enumerate(x):\n",
+ " for j, t_ in enumerate(t):\n",
+ " point = np.array([x_, t_])\n",
+ " g_dnn_ag[i,j] = g_trial(point,P)\n",
+ "\n",
+ " G_analytical[i,j] = g_analytic(point)\n",
+ "\n",
+ " # Find the map difference between the analytical and the computed solution\n",
+ " diff_ag = np.abs(g_dnn_ag - G_analytical)\n",
+ " print('Max absolute difference between the analytical solution and the network: %g'%np.max(diff_ag))\n",
+ "\n",
+ " ## Plot the solutions in two dimensions, that being in position and time\n",
+ "\n",
+ " T,X = np.meshgrid(t,x)\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Solution from the deep neural network w/ %d layer'%len(num_hidden_neurons))\n",
+ " s = ax.plot_surface(T,X,g_dnn_ag,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Analytical solution')\n",
+ " s = ax.plot_surface(T,X,G_analytical,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Difference')\n",
+ " s = ax.plot_surface(T,X,diff_ag,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ " ## Take some slices of the 3D plots just to see the solutions at particular times\n",
+ " indx1 = 0\n",
+ " indx2 = int(Nt/2)\n",
+ " indx3 = Nt-1\n",
+ "\n",
+ " t1 = t[indx1]\n",
+ " t2 = t[indx2]\n",
+ " t3 = t[indx3]\n",
+ "\n",
+ " # Slice the results from the DNN\n",
+ " res1 = g_dnn_ag[:,indx1]\n",
+ " res2 = g_dnn_ag[:,indx2]\n",
+ " res3 = g_dnn_ag[:,indx3]\n",
+ "\n",
+ " # Slice the analytical results\n",
+ " res_analytical1 = G_analytical[:,indx1]\n",
+ " res_analytical2 = G_analytical[:,indx2]\n",
+ " res_analytical3 = G_analytical[:,indx3]\n",
+ "\n",
+ " # Plot the slices\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t1)\n",
+ " plt.plot(x, res1)\n",
+ " plt.plot(x,res_analytical1)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t2)\n",
+ " plt.plot(x, res2)\n",
+ " plt.plot(x,res_analytical2)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t3)\n",
+ " plt.plot(x, res3)\n",
+ " plt.plot(x,res_analytical3)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "bf7afd74",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Example: Solving the wave equation with Neural Networks\n",
+ "\n",
+ "The wave equation is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fdef78b2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\frac{\\partial^2 g(x,t)}{\\partial t^2} = c^2\\frac{\\partial^2 g(x,t)}{\\partial x^2}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "be570613",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "with $c$ being the specified wave speed.\n",
+ "\n",
+ "Here, the chosen conditions are"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9f81e04f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "$$\n",
+ "\\begin{align*}\n",
+ "\tg(0,t) &= 0 \\\\\n",
+ "\tg(1,t) &= 0 \\\\\n",
+ "\tg(x,0) &= u(x) \\\\\n",
+ "\t\\frac{\\partial g(x,t)}{\\partial t} \\Big |_{t = 0} &= v(x)\n",
+ "\\end{align*}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "91171d8b",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $\\frac{\\partial g(x,t)}{\\partial t} \\Big |_{t = 0}$ means the derivative of $g(x,t)$ with respect to $t$ is evaluated at $t = 0$, and $u(x)$ and $v(x)$ being given functions."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "dbbbb8a5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The problem to solve for\n",
+ "\n",
+ "The wave equation to solve for, is"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3f1be58e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{equation} \\label{wave} \\tag{19}\n",
+ "\\frac{\\partial^2 g(x,t)}{\\partial t^2} = c^2 \\frac{\\partial^2 g(x,t)}{\\partial x^2}\n",
+ "\\end{equation}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d54c4188",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $c$ is the given wave speed.\n",
+ "The chosen conditions for this equation are"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "952c58e8",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "\n",
+ "
\n",
+ "\n",
+ "$$\n",
+ "\\begin{aligned}\n",
+ "g(0,t) &= 0, &t \\geq 0 \\\\\n",
+ "g(1,t) &= 0, &t \\geq 0 \\\\\n",
+ "g(x,0) &= u(x), &x\\in[0,1] \\\\\n",
+ "\\frac{\\partial g(x,t)}{\\partial t}\\Big |_{t = 0} &= v(x), &x \\in [0,1]\n",
+ "\\end{aligned} \\label{condwave} \\tag{20}\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a650bae2",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "In this example, let $c = 1$ and $u(x) = \\sin(\\pi x)$ and $v(x) = -\\pi\\sin(\\pi x)$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9e0b8996",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The trial solution\n",
+ "Setting up the network is done in similar matter as for the example of solving the diffusion equation.\n",
+ "The only things we have to change, is the trial solution such that it satisfies the conditions from ([20](#condwave)) and the cost function.\n",
+ "\n",
+ "The trial solution becomes slightly different since we have other conditions than in the example of solving the diffusion equation. Here, a possible trial solution $g_t(x,t)$ is\n",
+ "\n",
+ "$$\n",
+ "g_t(x,t) = h_1(x,t) + x(1-x)t^2N(x,t,P)\n",
+ "$$\n",
+ "\n",
+ "where\n",
+ "\n",
+ "$$\n",
+ "h_1(x,t) = (1-t^2)u(x) + tv(x)\n",
+ "$$\n",
+ "\n",
+ "Note that this trial solution satisfies the conditions only if $u(0) = v(0) = u(1) = v(1) = 0$, which is the case in this example."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0f3f1985",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## The analytical solution\n",
+ "\n",
+ "The analytical solution for our specific problem, is\n",
+ "\n",
+ "$$\n",
+ "g(x,t) = \\sin(\\pi x)\\cos(\\pi t) - \\sin(\\pi x)\\sin(\\pi t)\n",
+ "$$"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fbd35329",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Solving the wave equation - the full program using Autograd"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 40,
+ "id": "6ccf9344",
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
+ "source": [
+ "import autograd.numpy as np\n",
+ "from autograd import hessian,grad\n",
+ "import autograd.numpy.random as npr\n",
+ "from matplotlib import cm\n",
+ "from matplotlib import pyplot as plt\n",
+ "from mpl_toolkits.mplot3d import axes3d\n",
+ "\n",
+ "## Set up the trial function:\n",
+ "def u(x):\n",
+ " return np.sin(np.pi*x)\n",
+ "\n",
+ "def v(x):\n",
+ " return -np.pi*np.sin(np.pi*x)\n",
+ "\n",
+ "def h1(point):\n",
+ " x,t = point\n",
+ " return (1 - t**2)*u(x) + t*v(x)\n",
+ "\n",
+ "def g_trial(point,P):\n",
+ " x,t = point\n",
+ " return h1(point) + x*(1-x)*t**2*deep_neural_network(P,point)\n",
+ "\n",
+ "## Define the cost function\n",
+ "def cost_function(P, x, t):\n",
+ " cost_sum = 0\n",
+ "\n",
+ " g_t_hessian_func = hessian(g_trial)\n",
+ "\n",
+ " for x_ in x:\n",
+ " for t_ in t:\n",
+ " point = np.array([x_,t_])\n",
+ "\n",
+ " g_t_hessian = g_t_hessian_func(point,P)\n",
+ "\n",
+ " g_t_d2x = g_t_hessian[0][0]\n",
+ " g_t_d2t = g_t_hessian[1][1]\n",
+ "\n",
+ " err_sqr = ( (g_t_d2t - g_t_d2x) )**2\n",
+ " cost_sum += err_sqr\n",
+ "\n",
+ " return cost_sum / (np.size(t) * np.size(x))\n",
+ "\n",
+ "## The neural network\n",
+ "def sigmoid(z):\n",
+ " return 1/(1 + np.exp(-z))\n",
+ "\n",
+ "def deep_neural_network(deep_params, x):\n",
+ " # x is now a point and a 1D numpy array; make it a column vector\n",
+ " num_coordinates = np.size(x,0)\n",
+ " x = x.reshape(num_coordinates,-1)\n",
+ "\n",
+ " num_points = np.size(x,1)\n",
+ "\n",
+ " # N_hidden is the number of hidden layers\n",
+ " N_hidden = len(deep_params) - 1 # -1 since params consist of parameters to all the hidden layers AND the output layer\n",
+ "\n",
+ " # Assume that the input layer does nothing to the input x\n",
+ " x_input = x\n",
+ " x_prev = x_input\n",
+ "\n",
+ " ## Hidden layers:\n",
+ "\n",
+ " for l in range(N_hidden):\n",
+ " # From the list of parameters P; find the correct weigths and bias for this layer\n",
+ " w_hidden = deep_params[l]\n",
+ "\n",
+ " # Add a row of ones to include bias\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev ), axis = 0)\n",
+ "\n",
+ " z_hidden = np.matmul(w_hidden, x_prev)\n",
+ " x_hidden = sigmoid(z_hidden)\n",
+ "\n",
+ " # Update x_prev such that next layer can use the output from this layer\n",
+ " x_prev = x_hidden\n",
+ "\n",
+ " ## Output layer:\n",
+ "\n",
+ " # Get the weights and bias for this layer\n",
+ " w_output = deep_params[-1]\n",
+ "\n",
+ " # Include bias:\n",
+ " x_prev = np.concatenate((np.ones((1,num_points)), x_prev), axis = 0)\n",
+ "\n",
+ " z_output = np.matmul(w_output, x_prev)\n",
+ " x_output = z_output\n",
+ "\n",
+ " return x_output[0][0]\n",
+ "\n",
+ "## The analytical solution\n",
+ "def g_analytic(point):\n",
+ " x,t = point\n",
+ " return np.sin(np.pi*x)*np.cos(np.pi*t) - np.sin(np.pi*x)*np.sin(np.pi*t)\n",
+ "\n",
+ "def solve_pde_deep_neural_network(x,t, num_neurons, num_iter, lmb):\n",
+ " ## Set up initial weigths and biases\n",
+ " N_hidden = np.size(num_neurons)\n",
+ "\n",
+ " ## Set up initial weigths and biases\n",
+ "\n",
+ " # Initialize the list of parameters:\n",
+ " P = [None]*(N_hidden + 1) # + 1 to include the output layer\n",
+ "\n",
+ " P[0] = npr.randn(num_neurons[0], 2 + 1 ) # 2 since we have two points, +1 to include bias\n",
+ " for l in range(1,N_hidden):\n",
+ " P[l] = npr.randn(num_neurons[l], num_neurons[l-1] + 1) # +1 to include bias\n",
+ "\n",
+ " # For the output layer\n",
+ " P[-1] = npr.randn(1, num_neurons[-1] + 1 ) # +1 since bias is included\n",
+ "\n",
+ " print('Initial cost: ',cost_function(P, x, t))\n",
+ "\n",
+ " cost_function_grad = grad(cost_function,0)\n",
+ "\n",
+ " # Let the update be done num_iter times\n",
+ " for i in range(num_iter):\n",
+ " cost_grad = cost_function_grad(P, x , t)\n",
+ "\n",
+ " for l in range(N_hidden+1):\n",
+ " P[l] = P[l] - lmb * cost_grad[l]\n",
+ "\n",
+ "\n",
+ " print('Final cost: ',cost_function(P, x, t))\n",
+ "\n",
+ " return P\n",
+ "\n",
+ "if __name__ == '__main__':\n",
+ " ### Use the neural network:\n",
+ " npr.seed(15)\n",
+ "\n",
+ " ## Decide the vales of arguments to the function to solve\n",
+ " Nx = 10; Nt = 10\n",
+ " x = np.linspace(0, 1, Nx)\n",
+ " t = np.linspace(0,1,Nt)\n",
+ "\n",
+ " ## Set up the parameters for the network\n",
+ " num_hidden_neurons = [50,20]\n",
+ " num_iter = 1000\n",
+ " lmb = 0.01\n",
+ "\n",
+ " P = solve_pde_deep_neural_network(x,t, num_hidden_neurons, num_iter, lmb)\n",
+ "\n",
+ " ## Store the results\n",
+ " res = np.zeros((Nx, Nt))\n",
+ " res_analytical = np.zeros((Nx, Nt))\n",
+ " for i,x_ in enumerate(x):\n",
+ " for j, t_ in enumerate(t):\n",
+ " point = np.array([x_, t_])\n",
+ " res[i,j] = g_trial(point,P)\n",
+ "\n",
+ " res_analytical[i,j] = g_analytic(point)\n",
+ "\n",
+ " diff = np.abs(res - res_analytical)\n",
+ " print(\"Max difference between analytical and solution from nn: %g\"%np.max(diff))\n",
+ "\n",
+ " ## Plot the solutions in two dimensions, that being in position and time\n",
+ "\n",
+ " T,X = np.meshgrid(t,x)\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Solution from the deep neural network w/ %d layer'%len(num_hidden_neurons))\n",
+ " s = ax.plot_surface(T,X,res,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Analytical solution')\n",
+ " s = ax.plot_surface(T,X,res_analytical,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ "\n",
+ " fig = plt.figure(figsize=(10,10))\n",
+ " ax = fig.add_suplot(projection='3d')\n",
+ " ax.set_title('Difference')\n",
+ " s = ax.plot_surface(T,X,diff,linewidth=0,antialiased=False,cmap=cm.viridis)\n",
+ " ax.set_xlabel('Time $t$')\n",
+ " ax.set_ylabel('Position $x$');\n",
+ "\n",
+ " ## Take some slices of the 3D plots just to see the solutions at particular times\n",
+ " indx1 = 0\n",
+ " indx2 = int(Nt/2)\n",
+ " indx3 = Nt-1\n",
+ "\n",
+ " t1 = t[indx1]\n",
+ " t2 = t[indx2]\n",
+ " t3 = t[indx3]\n",
+ "\n",
+ " # Slice the results from the DNN\n",
+ " res1 = res[:,indx1]\n",
+ " res2 = res[:,indx2]\n",
+ " res3 = res[:,indx3]\n",
+ "\n",
+ " # Slice the analytical results\n",
+ " res_analytical1 = res_analytical[:,indx1]\n",
+ " res_analytical2 = res_analytical[:,indx2]\n",
+ " res_analytical3 = res_analytical[:,indx3]\n",
+ "\n",
+ " # Plot the slices\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t1)\n",
+ " plt.plot(x, res1)\n",
+ " plt.plot(x,res_analytical1)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t2)\n",
+ " plt.plot(x, res2)\n",
+ " plt.plot(x,res_analytical2)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.figure(figsize=(10,10))\n",
+ " plt.title(\"Computed solutions at time = %g\"%t3)\n",
+ " plt.plot(x, res3)\n",
+ " plt.plot(x,res_analytical3)\n",
+ " plt.legend(['dnn','analytical'])\n",
+ "\n",
+ " plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "988e09cf",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "## Resources on differential equations and deep learning\n",
+ "\n",
+ "1. [Artificial neural networks for solving ordinary and partial differential equations by I.E. Lagaris et al](https://pdfs.semanticscholar.org/d061/df393e0e8fbfd0ea24976458b7d42419040d.pdf)\n",
+ "\n",
+ "2. [Neural networks for solving differential equations by A. Honchar](https://becominghuman.ai/neural-networks-for-solving-differential-equations-fa230ac5e04c)\n",
+ "\n",
+ "3. [Solving differential equations using neural networks by M.M Chiaramonte and M. Kiener](http://cs229.stanford.edu/proj2013/ChiaramonteKiener-SolvingDifferentialEquationsUsingNeuralNetworks.pdf)\n",
+ "\n",
+ "4. [Introduction to Partial Differential Equations by A. Tveito, R. Winther](https://www.springer.com/us/book/9783540225515)"
+ ]
+ }
+ ],
+ "metadata": {},
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
\ No newline at end of file