Developed through the innovative “SolveIt” tool and methodology currently featured at Answer.ai, this Python package embodies a transformative approach to problem-solving. Rather than treating AI as a mysterious black box that simply produces answers, it leverages AI as an illuminating tool that deepens our understanding of problems and guides us toward solutions.
At its core, the package draws inspiration from George Pólya’s seminal “How to Solve It” framework. What makes this implementation unique is its radical commitment to transparency and literate programming - the entire development process is meticulously documented in this “How was it created?” notebook, serving as both a comprehensive guide and a testament to the step-by-step problem-solving methodology.
The package’s source code emerges naturally from this foundational notebook, carefully refactoring the core functionality that was thoughtfully developed through deliberate, incremental steps. This approach ensures that every component is not only well-documented but also deeply understood.
Features
Multiple initialization methods:
Random initialization
PCA-based initialization (for faster convergence)
Flexible training options:
Customizable learning rate schedules
Adjustable neighborhood functions
Quantization and Topographic Errors monitoring plots during training:
Comprehensive quality metrics:
Quantization Error
Topographic Error
Rich visualization tools:
U-Matrix visualization
Hit histograms and Component planes (coming soon)
Installation
pip install teuvo
Quick Start
from teuvo.core import SOMimport numpy as npfrom sklearn.datasets import load_digits# Load and normalize MNIST dataX, y = load_digits(return_X_y=True)X_norm = (X - np.mean(X, axis=-1, keepdims=True))/X.max()# Create and train SOMsom = SOM(grid_sz=(20,20), input_dim=64, init='pca')som.fit(X_norm, n_epochs=20, verbose=True)# Visualize resultssom.plot_umatrix(figsize=(4,4))