From 3cf33a69a08c6daa1cc85c92744eecd25728b684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Louf?= Date: Fri, 14 Oct 2022 11:05:46 +0200 Subject: [PATCH] Remove primers for Python and NumPy from the documentation --- doc/tutorial/index.rst | 7 ----- doc/tutorial/numpy.rst | 70 ----------------------------------------- doc/tutorial/python.rst | 14 --------- 3 files changed, 91 deletions(-) delete mode 100644 doc/tutorial/numpy.rst delete mode 100644 doc/tutorial/python.rst diff --git a/doc/tutorial/index.rst b/doc/tutorial/index.rst index 67d253ef0d..d1af55959d 100644 --- a/doc/tutorial/index.rst +++ b/doc/tutorial/index.rst @@ -22,13 +22,6 @@ Throughout the tutorial, bear in mind that there is a :ref:`glossary` as well as *index* and *modules* links in the upper-right corner of each page to help you out. -Prerequisites -------------- -.. toctree:: - - python - numpy - Basics ------ diff --git a/doc/tutorial/numpy.rst b/doc/tutorial/numpy.rst deleted file mode 100644 index 5c70830b41..0000000000 --- a/doc/tutorial/numpy.rst +++ /dev/null @@ -1,70 +0,0 @@ - -.. _numpy: - -.. testsetup:: - - import numpy - -*************** -NumPy refresher -*************** - -Here are some quick guides to NumPy: - * `NumPy for MATLAB users `__ - * `Numpy User Guide `__ - * `More detailed Numpy tutorial `__ - * `100 NumPy exercises `__ - * `From Python to Numpy free book `__ - - .. [TODO: More doc, e.g. see _test_tensor.py] - - -Matrix conventions for machine learning -======================================= - - -Rows are horizontal and columns are vertical. -Every row is an example. Therefore, inputs[10,5] is a matrix of 10 examples -where each example has dimension 5. If this would be the input of a -neural network then the weights from the input to the first hidden -layer would represent a matrix of size (5, #hid). - -Consider this array: - ->>> numpy.asarray([[1., 2], [3, 4], [5, 6]]) -array([[ 1., 2.], - [ 3., 4.], - [ 5., 6.]]) ->>> numpy.asarray([[1., 2], [3, 4], [5, 6]]).shape -(3, 2) - -This is a 3x2 matrix, i.e. there are 3 rows and 2 columns. - -To access the entry in the 3rd row (row #2) and the 1st column (column #0): - ->>> numpy.asarray([[1., 2], [3, 4], [5, 6]])[2, 0] -5.0 - - -To remember this, keep in mind that we read left-to-right, top-to-bottom, -so each thing that is contiguous is a row. That is, there are 3 rows -and 2 columns. - -Broadcasting -============ - -Numpy does *broadcasting* of arrays of different shapes during -arithmetic operations. What this means in general is that the smaller -array (or scalar) is *broadcasted* across the larger array so that they have -compatible shapes. The example below shows an instance of -*broadcasting*: - ->>> a = numpy.asarray([1.0, 2.0, 3.0]) ->>> b = 2.0 ->>> a * b -array([ 2., 4., 6.]) - -The smaller array ``b`` (actually a scalar here, which works like a 0-d array) in this case is *broadcasted* to the same size -as ``a`` during the multiplication. This trick is often useful in -simplifying how expression are written. More detail about *broadcasting* -can be found in the `numpy user guide `__. diff --git a/doc/tutorial/python.rst b/doc/tutorial/python.rst deleted file mode 100644 index 68e896cf26..0000000000 --- a/doc/tutorial/python.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. _python: - - -*************** -Python tutorial -*************** - -In this documentation, we suppose that the reader knows Python. Here is a small list of Python -tutorials/exercises if you need to learn it or only need a refresher: - - * `Python Challenge `__ - * `Dive into Python `__ - * `Google Python Class `__ - * `Enthought Python course `__ (free for academics)