This repository contains Thermal Control AI Project which ensures precise temperature maintenance in climate zones within Biosphere 2, using advanced algorithms to autonomously regulate settings and achieve the desired environmental conditions. By integrating with existing infrastructure and providing predictive analytics, this project revolutionizes thermal management, driving sustainability, user comfort, and resource optimization.
Directory local - the default folder for storing your local files which will not be tracked by git. Feel free to put here any files or data you don't want to track with git (exception: see Ignore changes for configuration files section for more information):
local/configs- default directory to save your configuration files;local/data- default directory to save datasets;local/checkpoints- trained models are saved here.
Directory model contains main scripts for model, losses, metrics and dataset class:
model/dataset.py- holds a PyTorchDatasetclass;model/loss.py- holds loss functions;model/metrics.py- holds additional metrics to estimate models;model/model.py- holds PyTorchnn.Moduleclasses, which is base class for all neural network modules;model/pl_model.py- holdsLightningModuleclass.
Directory utils contains utility or helper scripts that can be used across different parts of a project:
utils/get_data.py- entry point to load data from database and generate dataset;utils/test_dataset.py- holds script to test dataset;utils/util.py- contains functions used across different parts of a project.
Main prerequisites are:
pytorch- machine learning library;numpy- scientific computation library;lightning- training wrapper;neptune-client=0.16.18- Neptune Logger. Used in integration with PyTorch Lightning;matplotlib- visualization library;pyyaml- a full-featured YAML processing framework. Needed to read configuration files.
Optional:
oracledb- extension module allowing Python programs to connect to Oracle Database. Needed to generate dataset if you do not have it.
You can create a conda environment with all required dependencies from environment.yml file:
conda env create -f environment.ymlActivate this environment:
conda activate biosphereInstall Lightning and neptune-client separately using pip (make sure you first activated biosphere environment):
pip install lightning
pip install "neptune-client<1.0.0"Files tokens.yaml, train.yaml and get_data.yaml are tracked by git, since its templates for your configuration files. It is highly recommended to make them untracked for git before making any changes:
git update-index --skip-worktree local/configs/tokens.yaml
git update-index --skip-worktree local/configs/train.yaml
git update-index --skip-worktree local/configs/get_data.yamlIf you need to remove the update-index flag (make them trackable again, if you need to update template for example):
git update-index --no-skip-worktree <file_name>To list all flagged files:
git ls-files -v|grep '^S'You can read more about git update-index --skip-worktree here.
Before modifying configuration files, it is strongly recommended that you mark them as untracked in Git (see Ignore changes for configuration files). This prevents personal configuration changes from being committed accidentally. Only push updates to the template files when you intentionally want to change them.
- Specify your tokens in
local/configs/tokens.yamlfile; - Configure the file
local/configs/get_data.yamlaccording to your preference for the dataset; - Load and generate dataset by:
cd utils
python get_data.py-
Specify your tokens in
local/configs/tokens.yamlfile; -
Configure the file
local/configs/train.yamlaccording to your preference for the experiment; -
Start training by:
python train.pyIf you want to use a configuration file other than the default one, you can specify it:
python <script_name.py> <path_to_config/config_name.yaml>