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.0.1.tar.gz (125.8 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.0.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: perceptron_emulator-1.0.1.tar.gz
  • Upload date:
  • Size: 125.8 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.0.1.tar.gz
Algorithm Hash digest
SHA256 8aabb727b545862ef862e9c38f7d1dc8feae5987546b82586120eb7d9857b314
MD5 6b1fdb9d99837e231814691e936c0f16
BLAKE2b-256 92e651053359bcdb16fa3b745c1d46a26525dd155cb167aa273a0468ca5dc03d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for perceptron_emulator-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1f15059a1b68c44df867149f3ffe268ad6d474e668593b0ed46d3d898116abd
MD5 32a559b1e14cca859865ddf929b8f414
BLAKE2b-256 2c8a23211dd971157560f32a06d3979f7635b103f6be42920a84ee06e9a0acfe

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