mirror of
https://github.com/ArthurDanjou/artmcp.git
synced 2026-01-14 14:44:21 +01:00
Ajouter la documentation pour le projet "Dropout Reduces Underfitting" avec une implémentation TensorFlow/Keras et des objectifs scientifiques
This commit is contained in:
220
content/projects/artmcp.md
Normal file
220
content/projects/artmcp.md
Normal file
@@ -0,0 +1,220 @@
|
||||
---
|
||||
slug: artmcp
|
||||
title: 🤖 ArtMcp
|
||||
description: A comprehensive Model Context Protocol (MCP) server exposing professional profile information about Arthur Danjou.
|
||||
publishedAt: 2025/10/27
|
||||
readingTime: 3
|
||||
favorite: true
|
||||
tags:
|
||||
- web
|
||||
- nuxt
|
||||
- mcp
|
||||
---
|
||||
|
||||
🤖 [ArtMcp](https://github.com/arthurdanjou/artmcp) - Arthur Danjou's MCP Server
|
||||
|
||||
A comprehensive [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server exposing professional profile information about Arthur Danjou. Built with [Nuxt](https://nuxt.com) and deployed on [NuxtHub](https://hub.nuxt.com) at the Edge.
|
||||
|
||||
🔗 **Live Server**: https://mcp.arthurdanjou.fr
|
||||
|
||||
## 🎯 Features
|
||||
|
||||
### MCP Resources
|
||||
|
||||
The server exposes the following resources through the Model Context Protocol:
|
||||
|
||||
- **📊 Skills** (`resource://artmcp/skills`) - Complete list of technical skills (programming languages, frameworks, tools)
|
||||
- **💼 Experiences** (`resource://artmcp/experiences`) - Professional work experience and projects
|
||||
- **🚀 Projects** (`resource://artmcp/projects`) - Portfolio of personal and professional projects
|
||||
- **🎓 Education** (`resource://artmcp/education`) - Academic background and degrees
|
||||
- **🌐 Languages** (`resource://artmcp/languages`) - Spoken languages with proficiency levels
|
||||
- **👤 Profile** (`resource://artmcp/profile`) - Comprehensive profile with bio, location, availability, career goals, and work preferences
|
||||
- **🎨 Hobbies** (`resource://artmcp/hobbies`) - Personal interests and activities
|
||||
- **📞 Contact** (`resource://artmcp/contact`) - Professional contact information and social links
|
||||
- **🛠️ Uses** (`resource://artmcp/uses`) - Tools, hardware, and software setup
|
||||
|
||||
### MCP Tools
|
||||
|
||||
- **`activity`** - Real-time current activity and status of Arthur Danjou
|
||||
- **`resume-link`** - Get download link for resume in English or French
|
||||
- **`stats`** - Detailed coding statistics and analytics from WakaTime
|
||||
- **`status-page`** - Real-time status and uptime monitoring for homelab infrastructure
|
||||
- **`uses-by-category`** - Filter uses by category (homelab, ide, hardware, software)
|
||||
- **`weather`** - Get current weather for a city
|
||||
|
||||
### MCP Prompts
|
||||
|
||||
Pre-configured prompts for common queries about:
|
||||
- Resume generation
|
||||
- Skills and expertise
|
||||
- Projects showcase
|
||||
- Real-time activity
|
||||
- Contact information
|
||||
- And more...
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
This project uses:
|
||||
- **Nuxt 4** with Nitro for server-side rendering
|
||||
- **@nuxt/content** for content management
|
||||
- **@nuxtjs/mcp-toolkit** for MCP server implementation
|
||||
- **NuxtHub** for edge deployment on Cloudflare Workers
|
||||
- **nuxt-studio** for content management studio
|
||||
- **Zod** for schema validation
|
||||
|
||||
## 🚀 Getting Started
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Node.js 18+ or Bun
|
||||
- pnpm 10.12.1+
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
pnpm install
|
||||
```
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Create a `.env` file (optional):
|
||||
|
||||
```bash
|
||||
# Discord integration (optional)
|
||||
NUXT_DISCORD_USER_ID=""
|
||||
NUXT_DISCORD_ID=""
|
||||
NUXT_DISCORD_TOKEN=""
|
||||
|
||||
# Wakatime integration (optional)
|
||||
NUXT_WAKATIME_USER_ID=""
|
||||
NUXT_WAKATIME_CODING=""
|
||||
NUXT_WAKATIME_EDITORS=""
|
||||
NUXT_WAKATIME_LANGUAGES=""
|
||||
NUXT_WAKATIME_OS=""
|
||||
|
||||
# Status page (optional)
|
||||
NUXT_STATUS_PAGE=""
|
||||
```
|
||||
|
||||
### Development
|
||||
|
||||
Start the development server on `http://localhost:3000`:
|
||||
|
||||
```bash
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### Production
|
||||
|
||||
Build the application for production:
|
||||
|
||||
```bash
|
||||
pnpm build
|
||||
```
|
||||
|
||||
### Deployment
|
||||
|
||||
Deploy to NuxtHub/Cloudflare:
|
||||
|
||||
```bash
|
||||
pnpm deploy
|
||||
```
|
||||
|
||||
## 📚 API Endpoints
|
||||
|
||||
All resources are also available as REST API endpoints:
|
||||
|
||||
- `GET /api/skills`
|
||||
- `GET /api/experiences`
|
||||
- `GET /api/projects`
|
||||
- `GET /api/education`
|
||||
- `GET /api/languages`
|
||||
- `GET /api/profile`
|
||||
- `GET /api/hobbies`
|
||||
- `GET /api/contact`
|
||||
- `GET /api/uses`
|
||||
- `GET /api/activity`
|
||||
- `GET /api/wakatime`
|
||||
- `GET /api/status-page`
|
||||
- `GET /api/resumes/{en|fr}` - Download resume
|
||||
|
||||
## 🧪 Development
|
||||
|
||||
### Linting
|
||||
|
||||
```bash
|
||||
pnpm lint
|
||||
```
|
||||
|
||||
### Type Checking
|
||||
|
||||
```bash
|
||||
npx tsc --noEmit --skipLibCheck
|
||||
```
|
||||
|
||||
## 📂 Content Structure
|
||||
|
||||
Content is managed in the `content/` directory:
|
||||
|
||||
```
|
||||
content/
|
||||
├── skills.json # Technical skills
|
||||
├── languages.json # Spoken languages
|
||||
├── profile.md # Comprehensive profile info
|
||||
├── contact.json # Contact information
|
||||
├── hobbies.md # Personal interests
|
||||
├── documentation.md # MCP documentation
|
||||
├── experiences/*.md # Work experiences
|
||||
├── projects/*.md # Project portfolio
|
||||
├── education/*.md # Academic background
|
||||
└── uses/*.md # Tools and setup
|
||||
```
|
||||
|
||||
## 🔧 Technologies
|
||||
|
||||
- **Frontend/Backend**: Nuxt 4, Vue 3, Nitro
|
||||
- **MCP**: @nuxtjs/mcp-toolkit
|
||||
- **Content**: Nuxt Content with better-sqlite3
|
||||
- **Content Studio**: nuxt-studio
|
||||
- **Deployment**: Cloudflare Workers via NuxtHub
|
||||
- **Validation**: Zod schemas
|
||||
|
||||
## 📖 MCP Integration
|
||||
|
||||
To use this server with an MCP client:
|
||||
|
||||
1. Configure your MCP client to connect to `https://mcp.arthurdanjou.fr/mcp`
|
||||
2. Or use the API directly via REST endpoints
|
||||
|
||||
Example MCP client configuration:
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"artmcp": {
|
||||
"url": "https://mcp.arthurdanjou.fr/mcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
This is a personal portfolio project. Feel free to use it as inspiration for your own MCP server!
|
||||
|
||||
## 📝 License
|
||||
|
||||
Private project - All rights reserved
|
||||
|
||||
## 👤 About
|
||||
|
||||
**Arthur Danjou**
|
||||
- Data Science & Applied AI student at Paris Dauphine-PSL University, passionate about machine learning and mathematical modelling
|
||||
- 📍 Paris, France
|
||||
- 🔗 [LinkedIn](https://go.arthurdanjou.fr/linkedin)
|
||||
- 🐙 [GitHub](https://go.arthurdanjou.fr/github)
|
||||
- 📧 [Email](https://go.arthurdanjou.fr/mail-pro)
|
||||
|
||||
---
|
||||
|
||||
Built with ❤️ using Nuxt and the Model Context Protocol
|
||||
154
content/projects/dropout-reduces-underfitting.md
Normal file
154
content/projects/dropout-reduces-underfitting.md
Normal file
@@ -0,0 +1,154 @@
|
||||
---
|
||||
slug: dropout-reduces-underfitting
|
||||
title: 🔬 Dropout reduces underfitting
|
||||
description: TensorFlow/Keras implementation of "Dropout Reduces Underfitting" (Liu et al., 2023). A comparative study of Early and Late Dropout strategies to optimize model convergence.
|
||||
publishedAt: 2054/12/10
|
||||
readingTime: 4
|
||||
favorite: false
|
||||
tags:
|
||||
- python
|
||||
- reserch
|
||||
- machine-learning
|
||||
- tensorflow
|
||||
---
|
||||
|
||||
📉 [Dropout Reduces Underfitting](https://github.com/arthurdanjou/dropoutreducesunderfitting): Reproduction & Analysis
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
> **Study and reproduction of the paper:** Liu, Z., et al. (2023). *Dropout Reduces Underfitting*. arXiv:2303.01500.
|
||||
|
||||
The paper is available at: [https://arxiv.org/abs/2303.01500](https://arxiv.org/abs/2303.01500)
|
||||
|
||||
This repository contains a robust and modular implementation in **TensorFlow/Keras** of **Early Dropout** and **Late Dropout** strategies. The goal is to verify the hypothesis that dropout, traditionally used to reduce overfitting, can also combat underfitting when applied solely during the initial training phase.
|
||||
|
||||
## 🎯 Scientific Objectives
|
||||
|
||||
The study aims to validate the three operating regimes of Dropout described in the paper:
|
||||
|
||||
1. **Early Dropout** (Targeting Underfitting): Active only during the initial phase to reduce gradient variance and align their direction, allowing for better final optimization.
|
||||
2. **Late Dropout** (Targeting Overfitting): Disabled at the start to allow rapid learning, then activated to regularize final convergence.
|
||||
3. **Standard Dropout**: Constant rate throughout training (Baseline).
|
||||
4. **No Dropout**: Control experiment without dropout.
|
||||
|
||||
## 🛠️ Technical Architecture
|
||||
|
||||
Unlike naive Keras callback implementations, this project uses a **dynamic approach via the TensorFlow graph** to ensure the dropout rate is properly updated on the GPU without model recompilation.
|
||||
|
||||
### Key Components
|
||||
|
||||
* **`DynamicDropout`**: A custom layer inheriting from `keras.layers.Layer` that reads its rate from a shared `tf.Variable`.
|
||||
* **`DropoutScheduler`**: A Keras `Callback` that drives the rate variable based on the current epoch and the chosen strategy (`early`, `late`, `standard`).
|
||||
* **`ExperimentPipeline`**: An orchestrator class that handles data loading (MNIST, CIFAR-10, Fashion MNIST), model creation (Dense or CNN), and execution of comparative benchmarks.
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
.
|
||||
├── README.md # This documentation file
|
||||
├── Dropout reduces underfitting.pdf # Original research paper
|
||||
├── pipeline.py # Main experiment pipeline
|
||||
├── pipeline.ipynb # Jupyter notebook for experiments
|
||||
├── pipeline_mnist.ipynb # Jupyter notebook for MNIST experiments
|
||||
├── pipeline_cifar10.ipynb # Jupyter notebook for CIFAR-10 experiments
|
||||
├── pipeline_cifar100.ipynb # Jupyter notebook for CIFAR-100 experiments
|
||||
├── pipeline_fashion_mnist.ipynb # Jupyter notebook for Fashion MNIST experiments
|
||||
├── requirements.txt # Python dependencies
|
||||
├── .python-version # Python version specification
|
||||
└── uv.lock # Dependency lock file
|
||||
```
|
||||
|
||||
## 🚀 Installation
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://github.com/arthurdanjou/dropoutreducesunderfitting.git
|
||||
cd dropoutreducesunderfitting
|
||||
```
|
||||
|
||||
## Install dependencies
|
||||
```bash
|
||||
pip install tensorflow numpy matplotlib seaborn scikit-learn
|
||||
```
|
||||
|
||||
## 📊 Usage
|
||||
|
||||
The main notebook pipeline.ipynb contains all necessary code. Here is how to run a typical experiment via the pipeline API.
|
||||
1. Initialization
|
||||
|
||||
Choose your dataset (cifar10, fashion_mnist, mnist) and architecture (cnn, dense).
|
||||
```python
|
||||
from pipeline import ExperimentPipeline
|
||||
|
||||
# Fashion MNIST is recommended to observe underfitting/overfitting nuances
|
||||
exp = ExperimentPipeline(dataset_name="fashion_mnist", model_type="cnn")
|
||||
```
|
||||
|
||||
2. Learning Curves Comparison
|
||||
|
||||
Compare training dynamics (Loss & Accuracy) of the three strategies.
|
||||
|
||||
```python
|
||||
exp.compare_learning_curves(
|
||||
modes=["standard", "early", "late"],
|
||||
switch_epoch=10, # The epoch where dropout state changes
|
||||
rate=0.4, # Dropout rate
|
||||
epochs=30
|
||||
)
|
||||
```
|
||||
|
||||
3. Ablation Studies
|
||||
|
||||
Study the impact of the "Early" phase duration or Dropout intensity.
|
||||
|
||||
```python
|
||||
# Impact of the switch epoch on final performance
|
||||
exp.compare_switch_epochs(
|
||||
switch_epochs=[5, 10, 15, 20],
|
||||
modes=["early"],
|
||||
rate=0.4,
|
||||
epochs=30
|
||||
)
|
||||
|
||||
# Impact of the dropout rate
|
||||
exp.compare_drop_rates(
|
||||
rates=[0.2, 0.4, 0.6],
|
||||
modes=["standard", "early"],
|
||||
switch_epoch=10,
|
||||
epochs=25
|
||||
)
|
||||
```
|
||||
|
||||
4. Data Regimes (Data Scarcity)
|
||||
|
||||
Verify the paper's hypothesis that Early Dropout shines on large datasets (or limited models) while Standard Dropout protects small datasets.
|
||||
|
||||
```python
|
||||
# Training on 10%, 50% and 100% of the dataset
|
||||
exp.run_dataset_size_comparison(
|
||||
fractions=[0.1, 0.5, 1.0],
|
||||
modes=["standard", "early"],
|
||||
rate=0.3,
|
||||
switch_epoch=10
|
||||
)
|
||||
```
|
||||
|
||||
## 📈 Expected Results
|
||||
|
||||
According to the paper, you should observe:
|
||||
|
||||
- Early Dropout: Higher initial Loss, followed by a sharp drop after the switch_epoch, often reaching a lower minimum than Standard Dropout (reduction of underfitting).
|
||||
- Late Dropout: Rapid rise in accuracy at the start (potential overfitting), then stabilized by the activation of dropout.
|
||||
|
||||
## 📝 Authors
|
||||
|
||||
- [Arthur Danjou](https://github.com/ArthurDanjou)
|
||||
- [Alexis Mathieu](https://github.com/Alex6535)
|
||||
- [Axelle Meric](https://github.com/AxelleMeric)
|
||||
- [Philippine Quellec](https://github.com/Philippine35890)
|
||||
- [Moritz Von Siemens](https://github.com/MoritzSiem)
|
||||
M.Sc. Statistical and Financial Engineering (ISF) - Data Science Track at Université Paris-Dauphine PSL
|
||||
|
||||
Based on the work of Liu, Z., et al. (2023). Dropout Reduces Underfitting.
|
||||
Reference in New Issue
Block a user