{"id":20574768,"url":"https://github.com/sven4500/neuroinformatics","last_synced_at":"2026-04-07T16:31:10.587Z","repository":{"id":259770880,"uuid":"438768981","full_name":"sven4500/neuroinformatics","owner":"sven4500","description":"Лабораторные работы по курсу \"Нейроинформатика\"","archived":false,"fork":false,"pushed_at":"2026-03-21T16:41:46.000Z","size":65,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-22T06:46:35.013Z","etag":null,"topics":["keras","keras-tensorflow","machine-learning","machinelearning","ml","neuroinformatics","py3","python","python-3","python3","pytorch","tensorflow","tensorflow2","tf","tf2","torch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sven4500.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-15T20:49:53.000Z","updated_at":"2026-03-21T16:31:16.000Z","dependencies_parsed_at":"2024-10-27T23:51:00.674Z","dependency_job_id":"1808cc33-9627-4865-aab6-40f541dd2216","html_url":"https://github.com/sven4500/neuroinformatics","commit_stats":null,"previous_names":["sven4500/neuroinformatics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sven4500/neuroinformatics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sven4500%2Fneuroinformatics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sven4500%2Fneuroinformatics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sven4500%2Fneuroinformatics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sven4500%2Fneuroinformatics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sven4500","download_url":"https://codeload.github.com/sven4500/neuroinformatics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sven4500%2Fneuroinformatics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31520391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keras","keras-tensorflow","machine-learning","machinelearning","ml","neuroinformatics","py3","python","python-3","python3","pytorch","tensorflow","tensorflow2","tf","tf2","torch"],"created_at":"2024-11-16T05:37:02.894Z","updated_at":"2026-04-07T16:31:10.568Z","avatar_url":"https://github.com/sven4500.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Neuroinformatics\n\nThis repository contains laboratory assignments for the \"Neuroinformatics\" course. The first four assignments are implemented in Python 3.9.11 using the Keras (TensorFlow) 2.9.1 library. Subsequent assignments are implemented in PyTorch.\n\nMachine configuration: AMD Ryzen 5 5600H 3.30 GHz 6 cores / 12 threads, 16 GB RAM. No GPU is used for model training.\n\n## Lab 1. Rosenblatt's Perceptron\n\nThe first assignment explores the classification problem using Rosenblatt's perceptron — a simple mathematical model of a single neuron. The perceptron is an adder with the Heaviside step function. The perceptron model in this assignment is modified because TensorFlow cannot work with non-differentiable functions such as the Heaviside step function. The step function is replaced with the sigmoid activation function, assuming that any value above 0.5 corresponds to 1 and any value below 0.5 corresponds to 0. It is also worth noting that the quality of model training strongly depends on the initial conditions — the values of the weights and bias.\n\n**Files:**\n- `lab1-1.py` - Binary classification (2 classes)\n- `lab1-2.py` - Multiclass classification (4 classes)\n\nAverage training time: 15 s.\n\n## Lab 2. ADALINE Network\n\nThe first part explores the ADALINE (Adaptive LInear NEuron) network. In terms of architecture, the ADALINE network repeats the previously studied Rosenblatt's perceptron, except for the activation function — as the name implies, it is linear here. **It is also worth noting the Widrow-Hoff learning rule, which was proposed for training the ADALINE network as the precursor to gradient-based learning methods.** The network is explored in the context of a signal approximation task.\n\n**Files:**\n- `lab2-1.py` - Signal approximation / Time series prediction\n\nAverage training time: 5 s.\n\nThe second part explores the ADALINE network applied to a filtering task. The input signal is a harmonic oscillation distorted relative to the true signal in amplitude and phase shift.\n\n**Files:**\n- `lab2-2.py` - Signal filtering / Noise removal\n\nAverage training time: 6 s.\n\n## Lab 3. Multilayer Networks\n\nThis assignment explores fully connected feedforward neural networks applied to classification and approximation tasks. The work can be divided into two parts: classification and approximation. For the classification task, a neural network model is trained to predict whether a point on a two-dimensional plane belongs to one of three geometric figures. A point is considered to belong to a figure if it lies on its boundary.\n\nThere are exactly three classes (figures) on the plane, so each point in space can be easily converted into a pixel of the RGB color space. Pure red, green, and blue represent the corresponding class. Other colors form transition states.\n\n**Files:**\n- `lab3-1.py` - Geometric shape classification (three-layer network 2 → 40 → 12 → 3)\n- `lab3-2.py` - Approximation of a complex nonlinear function\n\nAverage model training time: 30 s.\n\n## Lab 4. Radial Basis Function Networks\n\nThis assignment explores networks based on radial basis functions (RBF). Unlike previous architectures, RBF layer neurons compute the distance from the input vector to a trainable center and apply a Gaussian activation function. The advantage of RBF networks lies in their ability to efficiently approximate functions using fewer parameters. The networks are implemented using a custom RBFLayer with trainable center (mu) and width (sigma) parameters.\n\n**Files:**\n- `lab4-1.py` — Geometric shape classification using 10 RBF functions. Visualizes the positions of the found centers on the plot.\n- `lab4-2.py` — Nonlinear function approximation using 15 RBF functions. Displays the centers and predicted values.\n\n## Lab 5. Recurrent Neural Networks\n\nThis assignment explores recurrent neural networks, which have memory of previous states. The work is divided into two architectures: the Elman network and the Hopfield network. Recurrent networks are implemented in PyTorch for the first time.\n\n**Files:**\n- `lab5-1.py` — Elman network (PyTorch) for pattern recognition in a signal. A custom ElmanLayer stores the context vector of the previous state. Task: binary classification of temporal signal patterns (labels −1 and +1).\n- `lab5-2.py` — Hopfield network (PyTorch) for image restoration. A custom HopfieldLayer implements associative memory. Task: restoring a damaged image from a partially noisy input. Includes an animated visualization of the convergence process.\n- `lab5-3.py` — Alternative implementation of the Elman network in Keras (TensorFlow).\n\n## Lab 6. Self-Organizing Maps (Kohonen Maps)\n\nThis assignment explores unsupervised learning using Kohonen self-organizing maps (SOM). Unlike previous methods that require target labels, SOM learns without a teacher, revealing the topological structure in data. The algorithm is based on finding the closest neuron (Best Matching Unit, BMU) and updating the weights in its neighborhood with a decreasing learning rate and radius of influence.\n\n**Files:**\n- `lab6-1.py` — Self-organizing map for the RGB color space. A neuron grid of size 64×48 self-organizes to represent four input colors (red, orange, green, blue). Includes an animated visualization of the self-organization process, as well as plots of the decreasing radius and learning rate.\n- `lab6-2.py` — Self-organizing map for two-dimensional data. A 64×48 neuron grid adapts to a set of points on the plane.\n\n## Lab 7. Autoencoders\n\nThis assignment explores the autoencoder architecture for data compression and reconstruction. An autoencoder consists of an encoder that compresses input data into a lower-dimensional latent representation, and a decoder that reconstructs the data from the compressed representation.\n\n**Files:**\n- `lab7-1.py` — Autoencoder for images from the CIFAR-10 dataset (PyTorch).\n  - Encoder architecture: 3072 → 4608 → 96 (with tanh activation function).\n  - Decoder architecture: 96 → 4608 → 3072 (with tanh activation function).\n  - Interactive interface with three sliders to manipulate three random components of the latent representation and observe the change in the reconstructed image.\n  - Button to randomly sample an image from the dataset.\n\n## Lab 8. NARX Network\n\nThis assignment explores the Nonlinear AutoRegressive network with eXogenous inputs (NARX). The network uses Tapped Delay Lines (TDL) to store previous values of the input and output signals, allowing it to model nonlinear dynamic systems.\n\n**Files:**\n- `lab8-1.py` — NARX network (PyTorch) for identification of a nonlinear dynamic system. The architecture includes two TDL (Tapped Delay Line) modules for the input and output signals, as well as a two-layer network with a tanh activation function. Task: predicting the output signal of a nonlinear system from the input signal.\n\n---\n\n## Project Structure\n\n```\nneuroinformatics/\n├── lab1-1.py    # Lab 1, part 1: Perceptron (binary classification)\n├── lab1-2.py    # Lab 1, part 2: Perceptron (4 classes)\n├── lab2-1.py    # Lab 2, part 1: ADALINE (time series approximation)\n├── lab2-2.py    # Lab 2, part 2: ADALINE (noisy signal filtering)\n├── lab3-1.py    # Lab 3, part 1: Multilayer network (shape classification)\n├── lab3-2.py    # Lab 3, part 2: Multilayer network (function approximation)\n├── lab4-1.py    # Lab 4, part 1: RBF network (classification)\n├── lab4-2.py    # Lab 4, part 2: RBF network (approximation)\n├── lab5-1.py    # Lab 5, part 1: Elman network (PyTorch)\n├── lab5-2.py    # Lab 5, part 2: Hopfield network (PyTorch)\n├── lab5-3.py    # Lab 5, part 3: Elman network (TensorFlow/Keras)\n├── lab6-1.py    # Lab 6, part 1: Kohonen map for colors (NumPy)\n├── lab6-2.py    # Lab 6, part 2: Kohonen map for 2D data (NumPy)\n├── lab7-1.py    # Lab 7: CIFAR-10 autoencoder (PyTorch)\n├── lab8-1.py    # Lab 8: NARX network (PyTorch)\n├── README.md    # This file (English)\n└── README.ru.md # Documentation (Russian)\n```\n\n## Environment Requirements\n\n- Python 3.9.11\n- TensorFlow / Keras 2.9.1 (Labs 1–4, Lab 5-3)\n- PyTorch (Labs 5-1, 5-2, 6–8)\n- NumPy\n- Matplotlib\n- Pillow (for image processing in Lab 5-2)\n- tqdm (for displaying training progress)\n\n## General Notes\n\nThe main metrics used to evaluate model quality across all assignments are:\n- **Loss function**: MSE (Mean Squared Error).\n- **Quality metric**: MAE (Mean Absolute Error).\n\nEach assignment typically generates plots with several subplots:\n- Loss curve over epochs.\n- Quality metric curve over epochs (where applicable).\n- Visualization of input data or model output.\n- Scalar field (2D) or other relevant visualization.\n\nStarting from Lab 5, implementations transition from TensorFlow/Keras to PyTorch, providing greater flexibility when defining custom architectures (e.g., Hopfield networks, NARX). Labs 5 and 6 include animated visualizations, and Lab 7 includes interactive controls (sliders and a button).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsven4500%2Fneuroinformatics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsven4500%2Fneuroinformatics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsven4500%2Fneuroinformatics/lists"}