{"id":31541292,"url":"https://github.com/jeffasante/facade","last_synced_at":"2026-05-14T20:31:38.979Z","repository":{"id":316972698,"uuid":"1065523761","full_name":"jeffasante/facade","owner":"jeffasante","description":"An adaptive ad recommendation system using Deep Reinforcement Learning (DQN) to optimize ad placements and user engagement in simulated environments.","archived":false,"fork":false,"pushed_at":"2025-09-27T22:43:38.000Z","size":2542,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-07T19:58:21.944Z","etag":null,"topics":["ad-recommendation","artificial-intelligence","deep-learning","reinforcement-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeffasante.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-27T22:34:50.000Z","updated_at":"2025-09-27T22:43:41.000Z","dependencies_parsed_at":"2025-09-28T00:29:35.422Z","dependency_job_id":null,"html_url":"https://github.com/jeffasante/facade","commit_stats":null,"previous_names":["jeffasante/facade"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jeffasante/facade","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffasante%2Ffacade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffasante%2Ffacade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffasante%2Ffacade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffasante%2Ffacade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeffasante","download_url":"https://codeload.github.com/jeffasante/facade/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeffasante%2Ffacade/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33042106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ad-recommendation","artificial-intelligence","deep-learning","reinforcement-learning"],"created_at":"2025-10-04T10:58:29.082Z","updated_at":"2026-05-14T20:31:38.974Z","avatar_url":"https://github.com/jeffasante.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Facade\n\nAn adaptive ad recommendation system using Deep Reinforcement Learning.\n\n## Description\n\nThis project simulates an ad environment where a Deep Q-Network (DQN) agent learns to make optimal decisions about ad placements, balancing immediate revenue with long-term user engagement.\n\n![Policy Comparison](results/facade_results/policy_comparison.png)\n\n## Try it in Google Colab\n\nFor a quick demo without installation, try the interactive notebook:  \n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/15yyhranLEL_CsIT3H2HamYBimuqqKSk6?usp=sharing)\n\n## Installation\n\n1. Clone the repository.\n2. Create a virtual environment:\n\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. Install dependencies:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n## Usage\n\n### Training a Model\n\nRun the training script:\n\n```bash\npython main.py\n```\n\nThis trains the DQN agent and saves the model to `facade_model.pkl`.\n\n### Running Inference\n\nUse the inference script:\n\n```bash\npython inference.py\n```\n\nExample outputs:\n\n**Demo 1:**\n\n```text\n--- Running in INFERENCE demo mode ---\n\nLoading trained model from 'facade_model.pkl'...\nModel loaded successfully.\n\nCreated a sample user with interests in 'tech' and 'food'.\n\nSimulating start of session. Initial state for the agent:\n[0.0721851  0.873756   0.36416262 0.7099551  0.48997286 0.\n 0.         0.         0.3608316  0.         0.         0.\n 0.         0.        ]\n\n==================== Agent's Decision ====================\nRecommended Action: Show Ad #18\n  - Category: fashion\n  - Relevance Score: 0.5925505232093682\n  - Click Value: $1.48\n==========================================================\n```\n\n**Demo 2:**\n\n```text\n--- Running in INFERENCE demo mode ---\n\nLoading trained model from 'facade_model.pkl'...\nModel loaded successfully.\n\nCreated a sample user with interests in 'food' and 'travel'.\n\nSimulating start of session. Initial state for the agent:\n[0.26137498 0.19076613 0.14005695 0.9419397  0.6099581  0.\n 0.         0.         0.70459545 0.         0.         0.\n 0.         0.        ]\n\n==================== Agent's Decision ====================\nRecommended Action: Show Ad #5\n  - Category: travel\n  - Relevance Score: 0.7119103721059065\n  - Click Value: $3.10\n==========================================================\n```\n\n**Demo 3:**\n\n```text\n--- Running in INFERENCE demo mode ---\n\nLoading trained model from 'facade_model.pkl'...\nModel loaded successfully.\n\nCreated a sample user with interests in 'food' and 'tech'.\n\nSimulating start of session. Initial state for the agent:\n[0.48964655 0.82860184 0.36085954 0.8294869  0.5173254  0.\n 0.         0.         0.31208152 0.         0.         0.\n 0.         0.        ]\n\n==================== Agent's Decision ====================\nRecommended Action: Show Ad #9\n  - Category: sports\n  - Relevance Score: 0.38044689483262445\n  - Click Value: $3.52\n==========================================================\n```\n\n## Features\n\n- Custom simulated environment for ad-user interactions\n- DQN agent implemented with JAX/Flax\n- User simulation with interest profiles and fatigue\n- Evaluation against baseline policies\n- Analysis and visualization of results\n\n## Project Structure\n\n- `src/`: Core source code (agent, environment, user, system)\n- `results/`: Output plots and statistics\n- `docs/`: Research documentation\n\n## Documentation\n\nFor more detailed information:\n\n- [Research](docs/RESEARCH.md)\n- [Summary of Experimental Phases](docs/summary-of-experimental-phases.md)\n\n## Results\n\nTraining results, including plots and statistics, are saved in `results/facade_results/`. Key outputs include policy comparisons, training progress, and user journey analysis.\n\n## Contributing\n\nContributions are welcome. Please open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffasante%2Ffacade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffasante%2Ffacade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffasante%2Ffacade/lists"}