Computational Neuroscience, Machine Learning and Python tutorials
fa255f80a4
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com> |
||
---|---|---|
_layouts | ||
arduino/basics | ||
cv2 | ||
data_analysis/spectral_coherence | ||
flow | ||
helper | ||
matlab | ||
matplotlib | ||
numpy | ||
other | ||
pandas/basics | ||
PyBind11 | ||
python_basics | ||
pytorch | ||
pywavelet | ||
scikit-learn | ||
scipy | ||
sympy/intro | ||
template | ||
tensorflow/intro | ||
tk/overview | ||
workflow | ||
_config.yaml | ||
LICENSE | ||
README.md |
How to Python in computational neuroscience, data mining, and more
{:.no_toc}
* TOC {:toc}All the tutorials are tested with Python 3.11.x. Older version might have a problem with the new versions of type anotations.
Flow chart
- Basic Structure of a Computer
- Representation of Numbers in the Computer
- Systematic Programming
- Flow chart symbols
- Examples
- Flow chart for baking bread
Workflow
- Python installation
- VS Code installation
- VS Code configuration
- VS Code Microsoft Tutorials
- VS Code Python Interactive window
- VS Code Markdown
- VS Code Debugging
- VS Code Working remotely via ssh
Important VS Code notes:
- You can mark segments of source node with your mouse (or keyboard) and use the TAB key to increase the level of the indentation or use SHIFT + TAB do decrease the indentation level.
- Linux: CTRL + SHIFT + 7 toggles between comment and normal source code.
- The function key F2 allows you to change variable and function names. VS Code goes through all the node in your Project directory and changes all occurrences of the function or variable name accordingly. The same is true if you change a file name in a project directory.
Python: The Basics of the basics
- Overview
- Hello, Python
- Style Rulez
- Programming Recommendations
- Basic Math Operations
- Truth Value Testing
- Formatted String Literals
- Flow Control Overview
- Sequence Types
- Mapping Types
- Functions
- Type annotations
- Files
- JSON and dict for parameter files
- Creating order via sub-directories: os.makedirs
- Finding files in a directory: glob
- Class
- Exceptions (try / except)
- Importing Modules
- Built-in Functions
- Built-in Keywords
Python: Special topics
- pickle: save and load Python objects
- The Python Standard Library
- Dataclass
- Organizing parameters: dataclasses and dataconf
- ProcessPoolExecutor: A fast way to implement multiprocessing
- Logging
- Python Scopes and Namespaces
- Collection of distinct hashable objects -- set and frozenset
Numpy: The Basics of the basics
- The N-dimensional array (ndarray)
- Dimensions and shape
- Making a matrix from numerical ranges
- Convert other data into numpy arrays e.g. asarray
- New matrix
- Save and load
- Reshape and flatten
- Slices and Views
- Concatenate Matrices and arrays
- Merging matrices
- Unique
- Where
- Extending an existing matrix: tile, repeat, pad
- Boolean matricies and logic functions
- Advanced Indexing
- Available dtypes
- Constants
- Math functions
- Linear algebra
- Random numbers the non-legacy way
- Statistics
- FFT
- Meshgrid
- Flip, rot90, and roll a matrix
- Iterate
Numpy: Special topics
- Einstein summation
- Numba: Numpy just in time compiler -- speeding Numpy up
- Memory layout of Numpy matrices
- Stack and Split, Compress
- Beyond normal np.save
- Trim Zeros of a 1d array
- Iterating over an array / matrix
- Manipulation of integers and their bits
- Numpy <-> JSON over Pandas
- Resize: Compensation for bad planning? Don't!
- Dealing with the main diagonal / triangles of a matrix
Numpy: Matlab topics
In the case you know Matlab check here: NumPy for MATLAB users
Matplotlib.pyplot
- Simple plot and imshow examples
- Subplot
- subplots and gridspec: A more flexible placement
- Overview of the available functions
- Animation and Slider
Pandas
Sci-kit Learn
- Overview
- KMeans
- PCA
- FastICA
- ROC (pure numpy)
- Support Vector Machine
- K Nearest Neighbours (pure numpy)
SciPy
Python: Questions of spectral nature
Python: Daily little helper
- TQDM: Make your progress visible
- Argh: Organize your command line arguments
- psutil vs os.cpu_count: How many "CPUs" do I have?
- ZeroMQ: Microservices as well as connecting computers via message queue
- Austin: Time and memory profiling
OpenCV2 and Python
PyTorch
- Get CUDA ready!
- Converting the original MNIST files into numpy
- Interfacing Data
- Data augmentation
- Layers
- Creating networks
- Train the network
- Fisher Exact Test: Test if your performance difference is significant
- Write your own layer
- How to take advantage of an optimizer for your non-Pytorch project
- How to take advantage of a learning rate scheduler for your non-Pytorch project
- Unfold: How to manually calculate the indices for a sliding 2d window
PyBind11
- Expanding Python with C++ modules
- The fast and furious way (CPU and GPU CUDA)
- PyBind11 Stub-Generation
Tensorflow / Keras
Sympy
Numerical Integration, Differentiation, and Differential Equations
Arduino
Matlab: Basics
{: .topic-optional} This pages are in a rough state. e.g. equations are broken. Don't know why...