https://github.com/agh-studies-projects/p2p-network-design-patterns
https://github.com/agh-studies-projects/p2p-network-design-patterns
agh design-patterns grid-search
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/agh-studies-projects/p2p-network-design-patterns
- Owner: AGH-studies-projects
- Created: 2024-11-14T11:27:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-14T19:24:16.000Z (over 1 year ago)
- Last Synced: 2025-03-31T09:16:23.487Z (over 1 year ago)
- Topics: agh, design-patterns, grid-search
- Language: Python
- Homepage:
- Size: 446 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Design Patterns Project :rocket:
- **[Command](https://refactoring.guru/design-patterns/command)** π - Encapsulates tasks as objects, making it easy to queue and execute tasks dynamically across peers.
- **[Strategy](https://refactoring.guru/design-patterns/strategy)** π§ - Manages grid search methods (e.g., Random Search, Bayesian Search) with flexibility to plug in new strategies.
- **[Singleton](https://refactoring.guru/design-patterns/singleton)** π - Ensures a single instance of the peer network configuration across the system.
- **[Facade](https://refactoring.guru/design-patterns/facade)** - Provides a simplified interface to manage complex P2P interactions and task scheduling.
## **Context**
### **What is Peer-to-Peer?** π€
Peer-to-peer (P2P) is a decentralized network design where nodes (peers) communicate directly with each other. Thereβs no central serverβeach peer can act as both a client and a server. This architecture makes systems more robust, scalable, and fault-tolerant.
### **What is Grid Search?** π
Grid Search is a brute-force technique for **hyperparameter tuning**. It systematically tests all possible combinations of hyperparameters to find the optimal configuration for a machine learning model.
#### **Cookie-Baking Example πͺ**
Imagine youβre baking cookies and experimenting with:
- **Sugar**: 100g, 150g, 200g
- **Baking Time**: 10 mins, 15 mins, 20 mins
Grid Search will:
1. **Test all combinations**: (100g, 10 mins), (100g, 15 mins), β¦ (200g, 20 mins).
2. **Taste each batch** π΄ to find the perfect cookie recipe (hyperparameter set) based on flavor (model performance).
## **Installation** βοΈ
Make sure you have **Python `3.10.3`** installed. Then, follow these steps:
1. Clone the repository:
```bash
git clone https://github.com/your-username/peer-to-peer-grid-search.git
cd peer-to-peer-grid-search
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
## **Usage** π
### **Starting the P2P Grid Search**
3. **Execute the grid search**:
```bash
python app.py --port [PORT]
```
4. **Important notes**:
- The app will inform in the console when the training is finished.
- You can control possible hyperparams in the app.py file. List of possible models and params is available in file [p2p_network/src/validation/possible_models_and_params.json](p2p_network/src/validation/possible_models_and_params.json).
- The logs of the training are stored in [p2p_network/src/logger/log.text](p2p_network/src/logger/log.text). You can also find example logs in this file, on this repository.
**For more information about the architecture, read [docs.pdf](docs.pdf). Unfortunately, we provide only Polish version of the document for now.**
## **Why Peer-to-Peer?** π
1. **Scalability**: Add or remove peers dynamically without disrupting the network.
2. **Fault Tolerance**: Tasks are redistributed if a peer fails.
3. **Efficiency**: Leverages the computational power of multiple machines.
## **Key Features** π
- π **Decentralized Task Distribution**: No single point of failure.
- β‘ **Parallel Execution**: Tasks run concurrently across peers.
- π οΈ **Pluggable Search Strategies**: Swap or extend search methods easily.
## **License** π
This project is licensed under the MIT License.