This repository contains materials produced and used in teaching during Erasmus+ project: Jupyter@edu.
In order to run notebooks, one can clone this repository and setup Python environment based on included environment.yml
file.
The other possibility is to launch binder container which starts temporary Jupyter Notebook or Jupyter lab interface
You can find here a collection of notebooks which have been used in teaching at European University Cyprus, University of Augsburg and University of Silesia. They contain different approaches to the way of using Jupyter
notebook and nbgrader
software.
Most of notebooks contain tests and are compatible with nbgrader
software. It means that it is easy to produce student version (without solution) and check automatically correctness of the solution.
Exercises in scientific programming contain 8 selected problems in scientific programming. Is has been used in a small class. The main notebook containing the problem description and tests was distributed among students. Supplementary notebooks explaining in details some technical aspects were available for each topic. In this way the materials was accessible for students with little programming skills. More advanced students can proceed directly to the main problem.
-
BirthdayProblem.ipynb solves a classical problem of finding two persons have their birthday on the same day of the year by means of a simulation. It contains drawing birthdays at random. The supplemental material explains in brief lists and sets in Python: ~ListsAndSets.ipynb.
-
GameOfLife.ipynb The game of life simulates the dynamics of some living species according to a few simple rules devised by the British mathematician J. H. Conway. The exercise contain its implementation using
numpy
andscipy
library. It introduces user to the practical application of discrete convolution operator. An important and attractive element is also visualization of time evolution of the system usingipywidgets
interface tomatplotlib
library. -
JuliaSet.ipynb Julia sets offer a possibility to generate beautiful images. The supplementary notebooks contain in depth explanation of:
-
Parrondo Paradox We will define two games for which the probability to loose exceeds the probability to win. Surprisingly, by choosing an appropriate alternating sequence of the two loosing games, one finds that one wins in the long run. This situation is known as Parrondo's paradox. The notebooks provide guided implementation of simulation algorithm of this phenomena. Supplementary materials explains some aspects of random number generation and provide instructions for implementing all parts of the algorithm GameA.ipynb, GameB.ipynb, AlternatingAB.ipynb
-
Calculation of Pi by means of the arithmetic-geometric mean. This problem is supplemented by IntegerAsString.ipynb.
-
Symbolic computation Polynomials. This exercise contains supplementary explanations of Python sets:Sets.ipynb,Setdefault.ipynb
-
Determine the number of primes which can be interpreted as time Prime Time.ipynb. This exercise contain practice of important aspects of Python programming: list comprehension and demonstrates an algorithm known as Sieve of Eratosthenes
-
Diagonal sum in a spiral is an interesting inspiration to gain some algorithmic practice in using Python functions and lists.
This collection of notebooks illustrates the application of symbolic computer algebra in Python to problems of general relativity. It is based on SymPy and GraviPy. It uses interactive 3d visualization using K3D-jupyter.
- Introduction to GraviPy
- Geodesics and Christoffel symbols
- Schwarzschild solution
- Embedding of the Schwarzschild solution
- Eddington-Finkelstein coordinates
- Tolman-Oppenheimer-Volkoff equation
This set of exercises contain problem sets for tutorials and supplementary materials lectures.
All exercises are compatible with nbgrader
and it has been used in a classroom.
- Introduction of numpy
- Step by step implementation of naive Bayes classifier
- Classical approach to MNIST dataset. There are two versions of this material, the second one uses smaller NIST8x8 dataset.
- Logistic regression with the steepest descent method. This approach uses
numpy
vector notation: dot products and broadcasting rules. - Principal Componen Analysis - implementation with
numpy.linalg
module. - Step by stem implementation of kNN algorithm and minimum distance classifier
- Classification Trees, random forest and boosting with XGboost library.
- Neural networks
- Minimalization algorithms in machine learning minimum
- Implementation of a single neuron in object oriented fashion. It is used for logistic regression, AND gate and OR gate
- Implementation of a neural network from scratch:
- single layer
- network of layers
- the implementation is tested on XOR gate, function fitting and MNIST dataset.
- Cross validation in machine learning.
This collection contains notebooks which were distributed during lectures. They contain worked example of current topic with a simple task which has to be completed in several minutes. The answers were collected during the same lecture using nbgrader software.
- Types of a norm of a vector
- Plotting Gaussian distribution approximating arbitrarily distributed data.
- Linear regression - implementation of linear regression and "gradient checking".
- Stochastic gradient descent algorithm: implementation in the case of linear regression in one variable and many variables.
- Confusion matrix and Receiver operating characteristic
- Perceptron implementation of an algorithm, dual form and kernel trick.
- Properties of SVM method based on experiments of its implementation in sklearn.
- Minimal distance classifier as a linear classifier. Exact computation of decision areas.
- Gini index - implementation and properties.
- Fisher's Linear Discriminant Analysis LDA - implementation and its comparison to
sklearn
- Clustering using k-means
- Implementation of a forward pass in fully connected neural network using numpy vectorized operations.
- Implementation of a backward pass in fully connected neural network using numpy vectorized operations..
- 01-Intro_Tutorial_Students.ipynb
- 02_Sets_1.ipynb
- 03_Sets_2.ipynb
- 04_Functions_1.ipynb
- 05_Functions_2.ipynb
- 06_Relations_1.ipynb
- 07_Relations_2.ipynb
- 08_Gravity_Kepler's_Laws.ipynb
- 09_Electromagnetic_fields.ipynb
- 10_Newton's Law of Gravity.ipynb
- 11_Planets_Dancing.ipynb
- 12_Projectile Motion.ipynb
- 13_Toy Model of the Solar System.ipynb
- 14_Work_&_Energy.ipynb
Java kernel (IJava), makes possible to use Jupyter notebook for java programming. There are materials of 13 notebooks.
- Built-in data types
- Operators and instructions
- Object data types
- Fields methods and constructors
- Basic Java API
- Inheritance and polymorphism
- Abstract classes and interfaces
- Handling exceptions
- Multithreading
- Generic data types
- Sets, lists, queues- maps
- Case study I - Arkanoid
- Case study II - http server
This repository was created as part of the Erasmus+ project Jupyter@edu |