SciPy - Python Library for Mathematical Functions

This section provides a tutorial example on how to install Python 3 SciPy library on macOS computers. SciPy is widely used by Python users for mathematical functions required in neural network models.

What Is SciPy? SciPy is an open-source Python library for scientific computing developed initially by Travis Oliphant and now maintained by the SciPy community.

If you want to build neural network models in Python, you should install SciPy and get familiar with its functionalities by following this tutorial. This is because neural network models require lots of mathematical functions, which are provided in SciPy.

1. Install SciPy library using the "pip3" (Package Installer for Python 3) command:

herong$ python3 --version
Python 3.8.0

herong$ sudo pip3 install scipy
Collecting scipy
  Downloading https://files.pythonhosted.org/packages/...
Installing collected packages: scipy
Successfully installed scipy-1.5.0

3. Verify SciPy installation by importing "scipy" package, retrieving its version string, and calling some statistical functions.

herong$ python3
Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27)

>>> import scipy as sp
>>> sp.1.20
'1.5.0'

>>> import numpy as np
>>> s = np.random.rand(1000000)

>>> from scipy import stats

>>> stats.tmean(s)
0.5000266615822236

>>> stats.tvar(s)
0.08345433925168123

Note that:

Cool! You have SciPy library ready on your Python 3 environment for matrix operations.

For more readings on SciPy, visit SciPy documentation Website at https://docs.scipy.org/doc/scipy/reference/.

Table of Contents

 About This Book

 Deep Playground for Classical Neural Networks

Building Neural Networks with Python

 Python Environment on macOS

 NumPy - Python Library for Matrix operations

SciPy - Python Library for Mathematical Functions

 Simple Example of Neural Networks

 TensorFlow - Machine Learning Platform

 PyTorch - Machine Learning Platform

 CNN (Convolutional Neural Network)

 RNN (Recurrent Neural Network)

 GNN (Graph Neural Network)

 References

 Full Version in PDF/EPUB