This project implements a nonparametric experimental framework combining deep neural networks, designed to study neural network performance across different dimensions and sample sizes.
.
├── README.md
├── main.py # Main entry point
├── config.py # Configuration management
├── experiment_runner.py # Experiment execution logic
├── network_estimator.py # Neural network model implementation
├── data_generator.py # Data generator
├── plotter.py # Results visualization and plotting
└── plot_results.py # Legacy plotting script (for backward compatibility)
- Support for multiple input dimensions (d=20, 100, 500)
- Adaptive network architecture design (theory-based)
- Sparse training process
- GPU acceleration support (Mac MPS)
- Parallel experiment execution
- Automated result collection and visualization
- Modular configuration management
- Flexible plotting system
- Python 3.8+
- PyTorch 2.0+
- NumPy
- Pandas
- Matplotlib
- Seaborn
- tqdm
- Clone the repository:
git clone [repository-url]- Install dependencies:
pip install -r requirements.txt# Enable MPS backend (Mac GPU support)
export PYTORCH_ENABLE_MPS_FALLBACK=1
python main.pyParameters are configured in config.py:
- Dimensions (d): [20, 100, 500]
- Sample sizes (n):
- d=20: [512, 1024, 2048, 4096]
- d=100,500: [2048, 4096, 8192, 16384]
- Noise levels (ξ): [0.1, 10.0]
- Replications per point (m): 10
- Macro replications (R): 30
Network architecture parameters are automatically determined based on theoretical calculations:
- φ(n) = n^(-2β/(2β+1))
- Depth = max(1, int(n * φ(n)))
- Width = int(2 * n * φ(n))
- Sparsity is calculated based on total parameters and target non-zero parameters
Experiment results are saved in experiments/experiment_[timestamp] directory:
results.json: Contains all experiment configurations and resultsdata/: Stores generated data- Computation time statistics
- RMSE evaluation results
Use plotter.py to generate visualizations:
python main.py --plot path/to/results.jsonGenerated plots include:
- RMSE vs Sample Size
- Computation Time vs Sample Size
- Computation Time vs Total Parameters
- GPU acceleration recommended for large-scale experiments
- Ensure sufficient storage space for experiment results
- Performance can be optimized by adjusting the number of parallel processes
- Configuration can be modified through
config.pywithout changing the main code - The legacy
plot_results.pyis maintained for backward compatibility
Contributions are welcome. Before submitting code, please:
- Run the complete test suite
- Update relevant documentation
- Follow existing code style
[Your License Type]