All Projects → seanwu1105 → neural-network-sandbox

seanwu1105 / neural-network-sandbox

Licence: MIT license
A toy about fundamental neural network algorithms and Qt Quick 2 interface.

Programming Languages

QML
638 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to neural-network-sandbox

Vscode Qt For Python
Qt for Python (PyQt5 and PySide2) extension for Visual Studio Code.
Stars: ✭ 47 (-31.88%)
Mutual labels:  qml, pyqt
Scihubeva
A Cross Platform Sci-Hub GUI Application
Stars: ✭ 683 (+889.86%)
Mutual labels:  qml, pyqt
python-qt-live-coding
Live coding environment for Python, Qt and QML.
Stars: ✭ 35 (-49.28%)
Mutual labels:  qml, pyqt
Stackoverflow
my answers in Stack Overflow
Stars: ✭ 211 (+205.8%)
Mutual labels:  qml, pyqt
sandbox
Simple Windows Sandbox Configuration
Stars: ✭ 37 (-46.38%)
Mutual labels:  sandbox
ida migrator
IDA Migrator is an IDA Pro plugin which helps migrate existing work from one database instance to another. It Conveniently migrates function names, structures and enums.
Stars: ✭ 65 (-5.8%)
Mutual labels:  pyqt
bppgrid
QtQuick 2 Table component, modeled on TableView QML Type and some other Cool qml components
Stars: ✭ 54 (-21.74%)
Mutual labels:  qml
QmlTreeWidget
A TreeView component, implemented by QML, providing convenient interfaces and customizable stylesheet, also available for iOS and Android.
Stars: ✭ 34 (-50.72%)
Mutual labels:  qml
HydroJudge
The next generation judging system for Hydro (and vijos)
Stars: ✭ 33 (-52.17%)
Mutual labels:  sandbox
mini-qml
Minimal Qt deployment for Linux, Windows, macOS and WebAssembly.
Stars: ✭ 44 (-36.23%)
Mutual labels:  qml
qt-quick-responsive-helper
A simple toolbar for QtQuick based applications, to let developers test different resolutions and dpi settings easily. It was made to be integrated with minimal effort (only one QML file), and to be configurable for your specific usage.
Stars: ✭ 26 (-62.32%)
Mutual labels:  qml
plasma-drydock
A plasma widget to start and stop docker containers
Stars: ✭ 25 (-63.77%)
Mutual labels:  qml
Sparrow.2
Sparrow.2 is a V-Play like library. Pure QML implement. Level up from Sparrow.
Stars: ✭ 31 (-55.07%)
Mutual labels:  qml
libTech
Game engine inspired by id Tech and Source written in C#
Stars: ✭ 42 (-39.13%)
Mutual labels:  sandbox
vatsinator-legacy
An open-source Vatsim monitor
Stars: ✭ 12 (-82.61%)
Mutual labels:  qml
VaspStudio
An useful tool to submit your VASP job on HPC, manage your jobs and extract eneries...自动化VASP任务提交、计算结果提取,任务文件管理的工具
Stars: ✭ 63 (-8.7%)
Mutual labels:  pyqt
rvw developers core
SFCC Developers Core Cartridge. A Salesforce Commerce Cloud (Demandware) Cartridge for Developers.
Stars: ✭ 43 (-37.68%)
Mutual labels:  sandbox
qt-qml-project-template-with-ci
Template for a Qt/QML application with batteries included: GitHub C.I. for your QML app; automated gui testing with Xvfb; automatic code-format checks and more. Compiles for Desktop and Mobile (Linux, Mac, Windows, and Android).
Stars: ✭ 33 (-52.17%)
Mutual labels:  qml
harbour-sailfishconnect
KDE Connect for Sailfish OS
Stars: ✭ 39 (-43.48%)
Mutual labels:  qml
qml-asteroid
QML components, styles and demos for AsteroidOS.
Stars: ✭ 51 (-26.09%)
Mutual labels:  qml

Neural Network Sandbox

An assignment collection for course CE5037 Neural Network in National Central University, Taiwan.

Features

  • Back-end completely separates from front-end by setContextProperty() and BridgeProperty
  • Animated Qt Chart in QML.
  • Automatically update UI when specific variables in back-end changed.
  • Modulized UI components.

Actually, neural networks are not the point.

Previews

perceptron preview

mlp preview

rbfn preview

som preview

Introduction to Architecture

I created the toy, Neural Network Sandbox, to explore if I could completely separate business logic (algorithms) from UI with Python and QML. Take mlp_algorithm.py for example, the class does not know anything about UI but the users still can interact with it via a QML app.

The QML UI needs to automatically observe some variables in the business logic. Thus, I need to inherit each algorithm with the Observable class. For example, ObservableMlpAlgorithm inherits Observable and MlpAlgorithm. Whenever a property has changed in the MlpAlgorithm, ObserableMlpAlgorithm.__setattr__(self, name, value) would be called. I can know which property has changed with the name parameter and notify the Observer with its new value.

But who is the observer? The bridge classes are the observer in this scenario. I created the bridge classes (e.g. mlp_bridge.py) containing a list of BridgeProperty. When a property has been updated by the observable via setattr(self, name, value), the corresponding (having the same name) BridgeProperty will get updated. When a BridgeProperty has been updated, its setter method will be called and emit PyQt signal to change QML UI.

In the early version of the project, there is no BridgeProperty class. For instance, the old version of perceptron_bridge.py having multiple pyqtProperty and its setter. To make the code cleaner, I have to create these pyqtProperties dynamically. BridgeProperty and BridgeMeta classes solve the problem. You can find more details from this Stackoverflow answer about creating pyqtProperty dynamically and this Stackoverflow answer about different ways to communicate between QML and Python.

Actually, after I finished the project, I feel it is a little bit over-engineered, and there are still many boilerplates scattering in the project. My solution to separate business logic (algorithms) from UI is definitely NOT the best way, which can be further improved. Hence, if you have a better idea about the architecture, feel free to create a pull request.

By the way, as far as I know, the architecture mentioned above cannot be applied to PySide2 currently due to this issue. I hope the Qt company would provide a cleaner and simpler solution regarding the interaction between Python and QML in the future (Qt 6).

Installation

Clone the project.

git clone https://github.com/seanwu1105/neural-network-sandbox

Install requirements.

pip install -r requirements.txt

Start the application.

python main.py
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].