{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "0bb0a40b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import configparser"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "04fac679",
   "metadata": {},
   "outputs": [],
   "source": [
    "class model_params():\n",
    "    def __init__(self, config):\n",
    "        parser = configparser.ConfigParser()\n",
    "        parser.read(config)\n",
    "        self.mask_only = parser.getboolean(\"train\",\"mask_only\")\n",
    "        self.sisnr = parser.getboolean(\"train\",\"sisdr\")\n",
    "        self.lr = parser.getfloat(\"train\",\"lr\")\n",
    "        self.batch_size = parser.getint(\"train\",\"batch_size\")\n",
    "        self.epochs = parser.getint(\"train\",\"epochs\")\n",
    "        self.weight_decay = parser.getfloat(\"train\",\"weight_decay\")\n",
    "        \n",
    "        self.conv_out_ch = parser.getint(\"train\",\"conv_ch\")\n",
    "        self.fc_hidden = parser.getint(\"train\",\"fc_hidden\")\n",
    "        self.fc_group = parser.getint(\"train\",\"fc_group\")\n",
    "        self.gru_hidden = parser.getint(\"train\",\"gru_hidden\")\n",
    "        self.gru_group = parser.getint(\"train\",\"gru_group\")\n",
    "\n",
    "        self.nb_erb = parser.getint(\"deepfilternet\",\"nb_erb\")\n",
    "        self.nb_df = parser.getint(\"deepfilternet\",\"nb_df\")\n",
    "        self.sr = parser.getint(\"deepfilternet\",\"sr\")\n",
    "        self.fft_size = parser.getint(\"deepfilternet\",\"fft_size\")\n",
    "        self.hop_size = parser.getint(\"deepfilternet\",\"hop_size\")\n",
    "        self.length_sec = parser.getint(\"deepfilternet\",\"length_sec\")\n",
    "        self.model_ver = parser[\"deepfilternet\"][\"model_ver\"]\n",
    "        \n",
    "        self.df_order = parser.getint(\"df\",\"df_order\")\n",
    "        self.df_lookahead = parser.getint(\"df\",\"df_lookahead\")\n",
    "        self.df_gamma = parser.getfloat(\"df\",\"gamma\")\n",
    "        self.df_factor = parser.getfloat(\"df\",\"factor\")\n",
    "        \n",
    "        self.conv_lookahead = parser.getint(\"mask\",\"conv_lookahead\")\n",
    "        self.mask_factor = parser.getfloat(\"mask\",\"factor\")\n",
    "        self.mask_gamma = parser.getfloat(\"mask\",\"gamma\")\n",
    "        \n",
    "        self.alpha_factor = parser.getfloat(\"alpha\",\"factor\")\n",
    "        \n",
    "\n",
    "        \n",
    "p = model_params('config.ini')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d0154fc7",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
