Skip to main content

A GUI-based physical perceptron emulator with custom hardware-style widgets

Project description

⚡ Perceptron Emulator

Perceptron Emulator

A stunning GUI-based perceptron emulator with physical hardware-style controls

License: MIT Python 3.9+ PyQt6

FeaturesInstallationUsageHardware BuildDocumentation


✨ Features

🎛️ Physical-Style Interface

  • Toggle Switches - Tactile ON/OFF inputs with visual feedback
  • LED Indicators - Real-time input state visualization
  • Rotary Knobs - Smooth weight adjustment with labeled scales
  • Analog Meter - Classic needle display for output visualization
  • Zero-Centered Design - Intuitive top-centered zero position

🔧 Dynamic Configuration

  • Variable Grid Size - Adjust from 2×2 to 8×8 inputs on the fly
  • Relative Sizing - All widgets scale proportionally for perfect visibility
  • Responsive Layout - Adapts to different screen sizes

💾 Persistent Storage

  • Auto-Save - Weights and bias saved automatically (1s after changes)
  • XDG Compliant - Configuration stored in ~/.config/perceptron-emulator/
  • Named Presets - Save, load, and manage multiple configurations
  • State Restoration - Picks up exactly where you left off

⚙️ Perceptron Logic

Implements the classic perceptron calculation:

output = Σ(input_i × weight_i) + bias
  • 16 Binary Inputs (default 4×4 grid)
  • 16 Adjustable Weights (-30 to +30 range)
  • Bias Control (-30 to +30 range)
  • Real-Time Calculation - Instant visual feedback

📦 Installation

From PyPI (Recommended)

pip install perceptron-emulator

From Source

git clone https://github.com/rexackermann/perceptron-emulator.git
cd perceptron-emulator
pip install -r requirements.txt

🚀 Usage

Launch the Application

# If installed via pip
perceptron-emulator

# If running from source
python main.py

Controls

  • Toggle Switches - Click to toggle inputs ON/OFF
  • Weight Knobs - Click and drag to rotate (positive clockwise, negative counterclockwise)
  • Bias Knob - Adjust the bias offset
  • Grid Size - Use spinboxes at top to change dimensions
  • File Menu - Save/Load/Delete presets (Ctrl+S, Ctrl+O)

Keyboard Shortcuts

  • Ctrl+S - Save current configuration as preset
  • Ctrl+O - Load a saved preset

🔨 Build Your Own Hardware

Want to build a physical version? Check out HARDWARE.md for:

  • Complete component list (BOM)
  • Circuit schematics and wiring diagrams
  • Step-by-step assembly instructions
  • Calibration procedures
  • Troubleshooting guide

📚 Documentation

Project Structure

perceptron-emulator/
├── main.py          # Main application and UI
├── logic.py         # Perceptron calculation engine
├── widgets.py       # Custom PyQt6 widgets
├── config.py        # XDG configuration management
├── HARDWARE.md      # Physical circuit build guide
├── README.md        # This file
└── requirements.txt # Python dependencies

Configuration Files

  • Config: ~/.config/perceptron-emulator/config.json
  • Presets: ~/.config/perceptron-emulator/presets/*.json

Requirements

  • Python 3.9+
  • PyQt6 >= 6.0.0
  • NumPy >= 1.20.0

🎨 Screenshots

Main Interface

Main Interface

Dark-themed interface with physical-style controls and real-time output visualization


🤝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest new features
  • Submit pull requests

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


👤 Author

Rex Ackermann


🌟 Acknowledgments

  • Inspired by classic analog computing equipment
  • Built with PyQt6 for cross-platform compatibility
  • Designed for both education and experimentation

⭐ Star this repo if you find it useful! ⭐

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

perceptron_emulator-1.1.1.tar.gz (125.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

perceptron_emulator-1.1.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file perceptron_emulator-1.1.1.tar.gz.

File metadata

  • Download URL: perceptron_emulator-1.1.1.tar.gz
  • Upload date:
  • Size: 125.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for perceptron_emulator-1.1.1.tar.gz
Algorithm Hash digest
SHA256 40054941415bf99ff1770554639f371c569e0271bcde0dbcdd9fdf2f0959f0ef
MD5 fe0481e1e77039f3a35a240e4fb53042
BLAKE2b-256 fe526cd3c8f2226d1763fa2f50ad7d49baa17c09b2fcee16791be2d0975c7eb2

See more details on using hashes here.

File details

Details for the file perceptron_emulator-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for perceptron_emulator-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58af2c48a51715f67339aaae71e623e8700975fa147519801be4e8e930f815aa
MD5 c1b36fd45e64615f141ea4e96863131a
BLAKE2b-256 fbfbc05e0bc4bc0ce951175e1d150a76aca0ae3adecf73f60ec158f4830a288a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page