Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions 510_23BAI10157_23BAI10274/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 🧠 Synapse — AI-Powered Study Planner

Synapse is an intelligent, personalized study planner that uses **Reinforcement Learning (Q-Learning)** to generate optimized study roadmaps based on your strengths and weaknesses.

It combines AI decision-making with a clean GUI to help you focus on what matters most.

---

## 🚀 Features

- 🎯 Personalized Study Plan based on your current skill levels
- 🧠 AI-Powered Scheduling using Q-learning
- 📊 Adaptive Learning – improves recommendations over time
- 🔄 Balanced Subject Distribution (avoids repetition & burnout)
- 💡 Actionable Tasks for each subject (Beginner → Advanced)
- 🖥️ Modern GUI built with Tkinter

---

## 🗂️ Project Structure

.
├── app.py
├── brain.py
├── logic.py
└── q_table.json

---

## ⚙️ How It Works

1. Input your confidence levels for each subject (0–100%)
2. The AI identifies weak areas
3. Generates a study sequence using reinforcement learning
4. Displays a roadmap with actionable tasks

---

## 🧠 AI Approach

- Uses Q-Learning
- State: (time_slot, weakest_subject)
- Action: next subject to study
- Reward system encourages improvement and balance

---

## 🖥️ Installation & Setup

### Clone the repository
git clone https://github.com/manasvi-maheshwari/synapse-study-planner.git

### Install dependencies
pip install numpy

### Run the application
python app.py

---

## 🔮 Future Improvements

- Data visualization
- Web & mobile versions
- Cloud sync
- More customization

---

## 📄 License

MIT License
351 changes: 351 additions & 0 deletions 510_23BAI10157_23BAI10274/app.py

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions 510_23BAI10157_23BAI10274/brain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import numpy as np
import json
import os

class StudyAI:
def __init__(self, subjects, slots=6):
self.subjects = subjects
self.q = np.zeros((slots + 1, len(subjects), len(subjects)))

def choose(self, slot, weakest_idx, explore=True):
import random
if explore and random.random() < 0.2:
return random.randint(0, len(self.subjects) - 1)
return int(np.argmax(self.q[slot][weakest_idx]))

def learn(self, slot, weakest, choice, reward, next_slot, next_weakest):
cur = self.q[slot][weakest][choice]
best = np.max(self.q[next_slot][next_weakest])
self.q[slot][weakest][choice] += 0.1 * (reward + 0.9 * best - cur)

def save(self, file="q_table.json"):
with open(file, "w") as f: json.dump(self.q.tolist(), f)

def load(self, file="q_table.json"):
if os.path.exists(file):
with open(file) as f: self.q = np.array(json.load(f))
return True
return False
61 changes: 61 additions & 0 deletions 510_23BAI10157_23BAI10274/logic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import random

def run_simulation(ai, subjects, difficulty, scores, slots=6, explore=True):
current_scores = scores.copy()
history = []
last_choice = -1
recent_choices = [] # track last N picks for cooldown
subject_counts = {s: 0 for s in subjects}
n = len(subjects)

# Ensure slots >= number of subjects so every subject gets at least one slot
slots = max(slots, n)

for slot in range(slots):
weakest_idx = min(range(n), key=lambda i: current_scores[subjects[i]])

# --- Cooldown mask: block subjects picked in last (n-1) turns ---
cooldown = max(1, n - 1)
blocked = set(recent_choices[-cooldown:]) if len(subjects) > 1 else set()

# Force-include any subject that has had zero slots so far
unvisited = [i for i in range(n) if subject_counts[subjects[i]] == 0]
if unvisited:
# Pick the weakest unvisited subject
choice = min(unvisited, key=lambda i: current_scores[subjects[i]])
else:
# Let AI choose, but mask out recently used subjects
raw_choice = ai.choose(slot, weakest_idx, explore)
if raw_choice in blocked:
# Fall back to weakest subject not on cooldown
available = [i for i in range(n) if i not in blocked]
if not available:
available = list(range(n)) # safety valve
choice = min(available, key=lambda i: current_scores[subjects[i]])
else:
choice = raw_choice

subj = subjects[choice]
subject_counts[subj] += 1

# --- Gain: diminishing returns as score rises ---
gap = 1.0 - current_scores[subj]
gain = gap * difficulty[subj] * random.uniform(0.12, 0.22)
current_scores[subj] = min(1.0, current_scores[subj] + gain)

# --- Reward shaping ---
reward = gain * 20
if choice == weakest_idx:
reward += 5 # good: tackled weakest
if choice == last_choice:
reward -= 15 # strong repetition penalty
if subject_counts[subj] > slots // n + 1:
reward -= 10 # penalise over-concentration

ai.learn(slot, weakest_idx, choice, reward, slot + 1, weakest_idx)
history.append({"subj": subj, "score": current_scores[subj], "gain": gain})

recent_choices.append(choice)
last_choice = choice

return history
Binary file removed CAM DATA B21 RL.xlsx
Binary file not shown.
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 🧠 Synapse — AI-Powered Study Planner

Synapse is an intelligent, personalized study planner that uses **Reinforcement Learning (Q-Learning)** to generate optimized study roadmaps based on your strengths and weaknesses.

It combines AI decision-making with a clean GUI to help you focus on what matters most.

---

## 🚀 Features

- 🎯 Personalized Study Plan based on your current skill levels
- 🧠 AI-Powered Scheduling using Q-learning
- 📊 Adaptive Learning – improves recommendations over time
- 🔄 Balanced Subject Distribution (avoids repetition & burnout)
- 💡 Actionable Tasks for each subject (Beginner → Advanced)
- 🖥️ Modern GUI built with Tkinter

---

## 🗂️ Project Structure

.
├── app.py
├── brain.py
├── logic.py
└── q_table.json

---

## ⚙️ How It Works

1. Input your confidence levels for each subject (0–100%)
2. The AI identifies weak areas
3. Generates a study sequence using reinforcement learning
4. Displays a roadmap with actionable tasks

---

## 🧠 AI Approach

- Uses Q-Learning
- State: (time_slot, weakest_subject)
- Action: next subject to study
- Reward system encourages improvement and balance

---

## 🖥️ Installation & Setup

### Clone the repository
git clone https://github.com/manasvi-maheshwari/synapse-study-planner.git

### Install dependencies
pip install numpy

### Run the application
python app.py

---

## 🔮 Future Improvements

- Data visualization
- Web & mobile versions
- Cloud sync
- More customization

---

## 📄 License

MIT License
Loading