Coverage Control Library
Loading...
Searching...
No Matches
config_parser.py
Go to the documentation of this file.
1# This file is part of the CoverageControl library
2#
3# Author: Saurav Agarwal
4# Contact: sauravag@seas.upenn.edu, agr.saurav1@gmail.com
5# Repository: https://github.com/KumarRobotics/CoverageControl
6#
7# Copyright (c) 2024, Saurav Agarwal
8#
9# The CoverageControl library is free software: you can redistribute it and/or
10# modify it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or (at your
12# option) any later version.
13#
14# The CoverageControl library is distributed in the hope that it will be
15# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17# Public License for more details.
18#
19# You should have received a copy of the GNU General Public License along with
20# CoverageControl library. If not, see <https://www.gnu.org/licenses/>.
21
22"""
23This file contains the configuration parser for the models
24"""
25
26
27class CNNConfigParser:
28 """
29 Class to parse the configuration for the CNN model
30 """
31
32 def __init__(self):
33 self.config = None
34 self.input_dim = None
35 self.output_dim = None
36 self.num_layers = None
37 self.latent_size = None
38 self.kernel_size = None
39 self.image_size = None
40
41 def parse(self, config: dict) -> None:
42 """
43 Parse the configuration for the CNN model
44
45 Args:
46 config (dict): Configuration for the CNN model
47 """
48 self.config = config
49 self.input_dim = self.config["InputDim"]
50 self.output_dim = self.config["OutputDim"]
51 self.num_layers = self.config["NumLayers"]
52 self.latent_size = self.config["LatentSize"]
53 self.kernel_size = self.config["KernelSize"]
54 self.image_size = self.config["ImageSize"]
55
56
57class GNNConfigParser:
58 """
59 Class to parse the configuration for the GNN model
60 """
61
62 def __init__(self):
63 self.config = None
64 self.input_dim = None
65 self.output_dim = None
66 self.num_hops = None
67 self.num_layers = None
68 self.latent_size = None
69
70 def parse(self, config: dict) -> None:
71 """
72 Parse the configuration for the GNN model
73 """
74 self.config = config
75 self.input_dim = self.config["InputDim"]
76 self.output_dim = self.config["OutputDim"]
77 self.num_hops = self.config["NumHops"]
78 self.num_layers = self.config["NumLayers"]
79 self.latent_size = self.config["LatentSize"]
This file contains the configuration parser for the models.
None parse(self, dict config)
Parse the configuration for the CNN model.
Class to parse the configuration for the GNN model.
None parse(self, dict config)
Parse the configuration for the GNN model.