RANSOC ensures your users experience the full breadth of your product's capabilities, not just the most obvious ones.
Imagine a virtual character capable of a wide range of facial expressions or actions. Without RANSOC, users might only see a limited subset, assuming that's all the character can do. RANSOC guarantees they eventually encounter the entire spectrum, fostering surprise, engagement, and a deeper appreciation for your creation.
pip install -e .
Requires Python 3.9+. Dependencies (numpy, matplotlib, seaborn) are installed automatically.
Each result option (“planet”) lives at a position in n-dimensional space; each query (“star”) is a point in that same space. RANSOC.query() picks the closest planet, then rebalances masses so that repeatedly-hit planets become less likely to be hit again — surfacing the full range of results over time instead of always returning the single closest match.
from ransoc import RANSOC, RANSOCConfig, DistanceMetric, Star
# Positions of candidate results ("planets") in feature space
positions = [
[0.0, 0.0], # e.g. "happy"
[1.0, 0.0], # e.g. "sad"
[0.0, 1.0], # e.g. "surprised"
[1.0, 1.0], # e.g. "angry"
]
planet_ids = ["happy", "sad", "surprised", "angry"]
ransoc = RANSOC(
positions,
config=RANSOCConfig(alpha=0.1, distance_metric=DistanceMetric.EUCLIDEAN),
planet_ids=planet_ids,
)
# User queries repeatedly near "happy" [0.1, 0.1]
star = Star(position=[0.1, 0.1], mass=1.0)
for epoch in range(10):
winner_idx, planet = ransoc.query(star)
print(f"Epoch {epoch}: {planet.id} (mass remaining: {planet.mass:.3f})")
Core formulation of Real-time Adaptive Normalization for the Satisfaction of Curiosity.
Paper 2Mathematical proof demonstrating guaranteed exploration across finite epochs.
Paper 3Physical interpretation using celestial mechanics and multi-body gravitational potential.