Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Randomness to the Feedbacks #19

Open
Killua145337 opened this issue Dec 31, 2024 · 0 comments
Open

Introduce Randomness to the Feedbacks #19

Killua145337 opened this issue Dec 31, 2024 · 0 comments

Comments

@Killua145337
Copy link

Killua145337 commented Dec 31, 2024

Introducing a variable response ratio for feedback aligns with principles from neuroscience and psychology, particularly the dopamine reward system. Research shows that unpredictable rewards, like those used in variable ratio reinforcement schedules, significantly enhance engagement and motivation. This mechanism is why slot machines and video games are so addictive—they keep the brain anticipating the next reward.

By integrating this approach into learning feedback, we can make the experience more engaging and rewarding. The unpredictability triggers dopamine release, reinforcing positive behaviors (like studying) more effectively than predictable feedback schedules, ultimately improving focus, retention, and long-term motivation.
Here are my suggested code changes to the main.py code:

` def on_answer_card(
ease_tuple: Tuple[bool, Literal[1, 2, 3, 4]], reviewer: Reviewer, card: Card
) -> Tuple[bool, Literal[1, 2, 3, 4]]:
if not conf["review_effect"]:
return ease_tuple

# Generate a random value between 0 and 1
random_chance = random.random()  # Returns a float between 0.0 and 1.0
threshold = 0.35  # Define the base threshold for showing effects. I found this value to have the best effect on my brain. Can tweak to achieve the best results for your brain. This value is not the randomness value but is 1-randomness. The higher the threshold, the less likely for that feedback to appear. This is why I'm setting a double threshold for again and hard, I want the person to feel more rewarded rather than punished.

button_count = mw.col.sched.answerButtons(card)
ease_num = ease_tuple[1]
ease = Ease.from_num(ease_num, button_count)

# Determine the response type
if ease == Ease.Again:
    ans = "again"
    effective_threshold = threshold * 2  # Double the threshold for "Again"
elif ease == Ease.Hard:
    ans = "hard"
    effective_threshold = threshold * 2 # Double the threshold for "Hard"
elif ease == Ease.Good:
    ans = "good"
    effective_threshold = threshold # Full threshold for "Good"
elif ease == Ease.Easy:
    ans = "easy"
    effective_threshold = threshold  # Full threshold for "Easy"

# Only play audio and show visual effects if the random value exceeds the effective threshold
if random_chance > effective_threshold:
    maybe_play_audio(ans)
    reviewer.web.eval(f"if (typeof avfAnswer === 'function') avfAnswer('{ans}')")

return ease_tuple

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant