├── .gitignore ├── LICENSE ├── README.md ├── REQUIREMENTS.txt ├── base ├── __init__.py ├── data_loader_base.py ├── grid_search_base.py └── model_base.py ├── configuration_files ├── fashion_config.json ├── stl10_config.json └── template.json ├── data_loader ├── __init__.py ├── fashion_mnist_loader.py └── stl10_loader.py ├── dataset └── stl-10 │ └── stl-10 ├── hyperparameter_optimization ├── __init__.py └── grid_search_fashion_mnist.py ├── mains ├── __init__.py ├── fashion_mnist_mains.py └── stl10_mains.py ├── model ├── __init__.py └── fashion_mnist_model.py ├── resources ├── architecture_diagrams │ ├── images-src │ │ ├── BaseModel_ClassDiagram.mdj │ │ ├── CNN_Main_ClassDiagram.mdj │ │ ├── DataLoader_classDiagram.mdj │ │ ├── Sequence_Diagram.mdj │ │ └── project_architecture.odg │ └── images │ │ ├── DataLoader_ClassDiagram.png │ │ ├── Main_ClassDiagram.png │ │ ├── ModelBase_ClassDiagram.png │ │ ├── Sequence_Diagram.png │ │ └── project_architecture.png └── parameter_descriptions.md ├── run_experiments.sh └── utils ├── __init__.py ├── model_utils.py ├── process_argument.py └── process_configuration.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Santosh Pattar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ConvNet Implementation: An Object Oriented Approach using Keras API. 2 | 3 | We aim to construct an object-oriented project template for working with Convolution Neural Networks (ConvNet) through Keras API. This template provides basic structures that helps to simplify the development process for new projects that aims to construct ConvNet models. 4 | 5 | # Table Of Contents 6 | 7 | - [About](#about): Project details. 8 | - [Installation](#installation-and-execution): Project setup guide. 9 | - [Architecture](#architecture): Architecture description. 10 | - [Project Structure](##project-structure): File arrangments in different folders. 11 | - [Architectural Modules](##architectural-modules): Description of the modules. 12 | - [Implementation Example](#implementation-example): Example implementation using the template. 13 | - [Implementation Guidelines](#implementation-guidelines): Guidelines to follow for specific Keras project implementation. 14 | - [Further Reading](#further-reading): References for future reading. 15 | - [FAQs](#Frequently-Asked-Questions): Most frequently asked questions. 16 | - [Future Works](#Future-Works): Activities in progress. 17 | - [Acknowledgments](#acknowledgments): Acknowledgments. 18 | - [Contributors](#contributors): Project contributors. 19 | 20 | # About 21 | 22 | This project aims to construct an *Object-oriented* python code to implement Convolution Neural Networks (ConvNet) using Keras API. 23 | 24 | A *ConvNet* consists of an input and an output layer, as well as multiple hidden layers. These layers of a ConvNet typically consist of convolutional, pooling, batch normalization, fully connected and normalization layers. 25 | 26 | We provide a simple keras project template that incorporates fundamentals of object-oriented programming to simplify the development process. Using this template one can easily start a ConvNet implementation without having to worry much about the helper classes and concentrate only on the construction, training and testing phases of the deep learning model. 27 | 28 | # Installation and Execution 29 | 30 | 1. Install the dependencies of the project through the command: `pip install -r REQUIREMENTS.txt` 31 | 2. Run the ConvNet experiment using the bash-interface: `./run-experiments.sh` 32 | 33 | # Architecture 34 | 35 | Architectural modules are as depicted in the following figure: 36 | 37 | ![Architecture](./resources/architecture_diagrams/images/project_architecture.png) 38 | 39 | ## Project Structure 40 | 41 | ``` 42 | ├── requirements - Specifies the library dependencies. 43 | | 44 | ├── resources - This folder holds the project resources. 45 | | 46 | ├── run_experiments.sh - Interface script to run a ConvNet experiment. 47 | | 48 | ├── configuration_files - This folder holds the configuration files for the experiment, in Key:Value pair. 49 | │   ├── template.json - Sample configuration file, with all the parameters. 50 | │   ├── fashion_config.json - Configuration file for the Fashion-MNIST experiment. 51 | │   └── stl10_config.json - Configuration file for the Stl-10 experiment. 52 | | 53 | ├── dataset - This folder houses the dataset for the experiments. 54 | │   └── stl-10 - Houses the Stl-10 dataset. 55 | | 56 | ├── base - Package for abstract base class. 57 | │   ├── data_loader_base.py - Abstract Data Loader class to load the dataset. 58 | │   ├── grid_search_base.py - Abstract Grid Search class to find optimal hyperparameters. 59 | │   └── model_base.py - Abstract Base Model class to define a ConvNet model. 60 | | 61 | ├── data_loader - Package for data loader. 62 | │   ├── fashion_mnist_loader.py - Fashion-MNIST dataset loader. 63 | │   └── stl10_loader.py - Stl-10 dataset loader. 64 | | 65 | ├── model - Package for ConvNet model definition, training and evaluation. 66 | │   └── fashion_mnist_model.py - Module to construct the ConvNet for Fashion-MNIST. 67 | | 68 | ├── mains - Package for execution pipeline. 69 | │   ├── fashion_mnist_mains.py - Module for Fashion-MNIST execution pipeline. 70 | │   └── stl10_mains.py - Module for Stl-10 execution pipeline. 71 | | 72 | ├── hyperparameter_optimization - Package for hyperparameter grid search. 73 | │   └── grid_search_fashion_mnist.py - Module for Fashion-MNIST hyperparameter grid search. 74 | | 75 | ├── utils - Package for utilites. 76 | | ├── model_utils.py - Module for reporting the experimental results. 77 | | ├── process_argument.py - Module to process the arguments for execution pipeline. 78 | | └── process_configuration.py - Module for processing the configuration file. 79 | | 80 | └── experiments - This folder holds the experimental results. 81 | ├── graphs - This folder holds the plots of loss and accuracy. 82 | └── saved_models - This folder holds the saved ConvNet model at specific check points. 83 | ``` 84 | 85 | ## Architectural Modules 86 | 87 | - ### **Run Experiments** 88 | 89 | - An experiment is a run of the ConvNet model with a different combination of datasets and configuration parameters. 90 | - *run_experiments* is a shell script that acts as an interface to run a ConvNet experiment. It sets up the python executable path and runs the mains python script. 91 | - Several arguments control the ConvNet model's execution. They are described below: 92 | - **Experiment options:** 93 | 1. *-x, --experiment*: Indicates name of the experiment to be run. As of now, acceptable values are: *fashion-mnist* for Fashion-MNIST dataset and *stl-10* for STL-10 dataset. 94 | 2. *-c, --config* Specifies the path to the configuration file. 95 | 3. *-e, --epoch* Specifies the number of training epochs. 96 | 97 | - **Other options:** 98 | 1. *-h, --help* display this help and exit. 99 | - An example to run an experiment on Fashion-MNIST dataset using default configuration parameters:
100 | `./run_experiments.sh -x fashion-mnist` or `./run_experiments.sh --experiment fashion-mnist` 101 | 102 | - An example to run an experiment on Fashion-MNIST dataset using command line configuration parameters:
103 | - with epoch size: `./run_experiments.sh -x fashion-mnist -e 5` or `./run_experiments.sh --experiment fashion-mnist --epoch 5`
104 | - with configuration file and epoch size: `./run_experiments.sh -x fashion-mnist -c fashion_config.json -e 5` 105 | 106 | - ### **Configuration Files** 107 | 108 | - The "configuration files" folder holds the JSON files that contains the configuration parameters to run the ConvNet experiments in Key:Value pairs. 109 | - Description of these parameters along with their acceptable values are present [here](./resources/parameter_descriptions.md). 110 | - We also provide a template configuration file located [here](./configuration_files/template.json) that holds all the possible parameters required by the ConvNet experiment. 111 | 112 | - ### **Dataset** 113 | 114 | - Dataset folder houses the dataset used for training and testing the ConvNet model. 115 | - These datasets are the one that are not present in the keras dataset package. 116 | 117 | - ### **Base** 118 | 119 | - The base package defines the modules which contain the abstract classes that are to be inherited by a particular ConvNet model. 120 | - It has the following modules: 121 | 122 | - #### **data_loader_base** 123 | - It defines an abstract class **DataLoader** that wraps the dataset loading process. 124 | - It's class diagram is illustrated in the following figure:
125 | ![DataLoader](./resources/architecture_diagrams/images/DataLoader_ClassDiagram.png) 126 | 127 | - It has the following data members: 128 | - *Train Dataset*: It holds the training dataset. 129 | - *train_data*: Its a numpy array that holds training data. 130 | - *train_labels*: Its a numpy array that holds training data's labels. 131 | - *Test Dataset*: It holds the test dataset. 132 | - *test_data*: Its a numpy array that holds test data. 133 | - *test_labels*: Its a numpy array that holds test data's labels. 134 | - *no_of_classes*: It holds the number of class-labels in the dataset. 135 | - *list_of_classes*: It holds the list of all the class-labels in the dataset. 136 | 137 | - It has following data methods: 138 | - *load_dataset()*: It loads the training and testing dataset in their respective numpy arrays. 139 | - *calculate_class_labelSize()*: It claculates the number of class-labels in the dataset. 140 | - *pirnt_dataset_details()*: It prints the dataset details, like shape of the numpy arrays. 141 | - *display_data_element()*: It displays a particular data element from training or testing dataset. 142 | 143 | - #### **model_base** 144 | - It defines an abstract class **BaseModel** that wraps the ConvNet model's construction process. 145 | - It also supports the serialization of the model to the disk at particular stages of the execution that can be loaded at later point. 146 | - Its class diagram is illustrated in the following figure:
147 | ![ModelBase](./resources/architecture_diagrams/images/ModelBase_ClassDiagram.png) 148 | - It has the following data members: 149 | - *config*: Holds the configuration parameters parsed from the JSON file. 150 | - *dataset*: It is an object of the class DataLoader. 151 | - *cnn_model*: It holds the type of ConvNet model of the experiment *i.e,* either Sequential or Functional. 152 | - *history*: It holds the ConvNet training phase's history. 153 | - *saved_model_path*: It holds the path of the saved ConvNet model. 154 | - *checkpoint*: It specifies the checkpoints for training phase of the ConvNet model. 155 | - *callbacks_list*: It holds the list of callback functions that are to be traced during the training phase. 156 | - *scores*: It holds loss and accuracy scores of the ConvNet testing phase. 157 | - *train_time*: It holds the training time of the ConvNet model. 158 | - *predictions*: It holds theb predicted class labels of the testing data. 159 | 160 | - It has the following abstract data methods which are to be implemented by the inheriting class: 161 | - *validateStride()* : For a given filter, it validates the given stride value. 162 | - *define_model()*: It defines the layers of the ConvNet model. 163 | - *compile_model()*: It configures the ConvNet model. 164 | - *fit_model()*: It trains the ConvNet model. 165 | - *evaluate_model()*: It evaluates the ConvNet model. 166 | - *predict()*: It predicts the class label of the testing dataset. 167 | - *save_model()*: It saves the ConvNet model to the disk. 168 | - *load_cnn_model()*: It loads the saved model from the disk. 169 | 170 | - ### **Data Loader** 171 | 172 | - The "data_loader" package loads the experiment specific dataset from the Keras library or from a specified path. 173 | - Each dataset should have a separate module implementation. 174 | 175 | - ### **Model** 176 | 177 | - It implements the ConvNet architecture as per the requirements of the experiment. 178 | - This package holds one specific module for each experiment that designs the model's architecture. 179 | 180 | - ### **Mains** 181 | - The main package wraps the execution flow of the experiment. 182 | - Depending on the requirement it calls the specific member methods from different modules to perform a specific operation. 183 | - It's class diagram is illustrated in the following figure:
184 | ![Mains](./resources/architecture_diagrams/images/Main_ClassDiagram.png) 185 | 186 | - The following sequence diagram depicts the execution flow:
187 | ![Sequence Diagram of ConvNet](./resources/architecture_diagrams/images/Sequence_Diagram.png) 188 | 189 | - A high level overview of the execution flow is listed below: 190 | 1. The interface script *run_experiments.sh*, accepts the command line arguments from the user that configures the ConvNet model. It then calls the *mains* python script and passes the arguments to it. 191 | 2. *mains* controls and coordinates the execution flow of the experiment. It first obtains the command line arguments and process them through the *get_args* and *process_configuration* scripts in the utils packages. These arguments are then passed to all other modules whenever necessary. 192 | 3. *data loader* script is called next to load and process the dataset. 193 | 4. Once the dataset has been loaded, *model* script is then called by mains that will construct, compile, train and evaluate the convNet model. It also serializes the trained model to the disk if asked to do so. Also, if a test data is given, the model predicts its class label. 194 | 5. Finally, *report* module is called by mains to generate the classification report. It generates loss and accuracy plot per epoch. Also, a confusion matrix is generated to depict the overall classification report of the dataset. These plots are saved in the respective *experiments* folder. 195 | 196 | - ### **Utils** 197 | - The utils package contains the modules that are implemented for reporting the experimental results and the add-ons required for the interactive design of the application. 198 | 199 | - *model_utils* 200 | - This module implements the *Report* class that displays the results in the required format *viz.,* Graphs, Tables, Matrix *etc*. 201 | - It has following data methods: 202 | - *plot_confusion_matrix()*: Displays the prediction results in the matrix form w.r.t True Positive (TP), True Negative (TN), False Positive (FP) and False Negative (FN). 203 | - *model_classification_report()*: Displays the classification results in the tabular form that includes precison, recall, f1-score and support. 204 | - *plot()*: Displays the validation results of loss and accuracy as a graph. 205 | 206 | - *process_argument* 207 | - This module parses the command line arguments that are passed to the experiment. 208 | 209 | - *process_configuration* 210 | - Reads the respective JSON file of the experiment and converts it to namespace. 211 | - It has following data methods: 212 | - *update_namespace()*: It updates the JSON parameters in the namespace which are passed as the command line arguments. 213 | - *process_config()*: Parses the configuration parameters that are present in the JSON file. 214 | - *create_dirs()*: It creates the new directories as per the experimental settings in order to store the results. 215 | 216 | # Implementation Example 217 | 218 | We provide a sample implementation of the template classes, scripts and modules using Fashion-MNIST dataset. Following are the implementation details. 219 | 220 | - *fashion_mnist_loader* 221 | - It is located under *data_loader* package. 222 | - It implements the class *FashionMnistLoader* by inheriting the DataLoader class from the base package. 223 | - It loads the Fashion-MNIST dataset from the keras library in respective NumPy arrays by overloading the *load_dataset()* function. 224 | - It also processes it through the overloaded function *preprocess_dataset()*. 225 | 226 | - *fashion_mnist_model* 227 | - It is located under *model* package. 228 | - It implements the class *FashionMnistModel* by inheriting the BaseModel class from the base package. 229 | - It implements the define_model(), compile_model(), fit_model(), evaluate_model() and predict() functions to construct, configure, train and evaluate the ConvNet model. 230 | - The ConvNet model has 13 layers that includes a combination of convolution, Leaky RELU, max-pooling, dropout, flatten and dense layers. 231 | - It also saves the trained model to disk per epoch only when there is an improvment in the performance. 232 | 233 | - *fashion_mnist_mains* 234 | - It is located under *mains* package. 235 | - This module contains execution flow of the Fashion-MNIST experiment. 236 | - It parses the command line arguments, JSON parameters and converts them to dictionary structure. 237 | 238 | # Implementation Guidelines 239 | 240 | With this template one can implement a Deep Learning project using ConvNet models. We provide the following list of guidelines in order to describe the development process: 241 | 242 | 1. Create a .json file in the **configuration_files** folder that holds the configuration parameters. We have provided a template file in the folder that defines all the possible parameters. 243 | 244 | 2. Define a project specific **Data Loader** class in a module in the *data_loader* package. This class should inherit the *DataLoader* base class from the *base* package. 245 | ```python 246 | class SpecificLoader(DataLoader): 247 | def __init__(self, config): 248 | super().__init__(config) 249 | return 250 | ``` 251 | - Override the **load_dataset()** and **preprocess_dataset()** function in this class to perform the data loading and processing operations respectively. 252 | ```python 253 | def load_dataset(): 254 | """ 255 | Implement this method in the inherited class to read the dataset from the keras dataset library/disk. 256 | Update respective data members of the DataLoader class. 257 | """ 258 | return 259 | 260 | def preprocess_dataset(): 261 | """ 262 | Implement this method in the inherited class to pre-process the dataset. 263 | Data values in the training and testing dataset should be in floating point values and 264 | the class labels are to be in one-hot encoded vector. 265 | """ 266 | return 267 | ``` 268 | 269 | 3. Define a project specific **Model** class in a module in the *model* package. This class should inherit the *BaseModel* class from the *base* package. 270 | ```python 271 | class SpecificModel(BaseModel): 272 | def __init__(self, config, dataset): 273 | super().__init__(config, dataset) 274 | return 275 | ``` 276 | - Override the following functions in this class to perform the model construction, configuration, training and evaluation. 277 | ```python 278 | def define_model(self): 279 | """ 280 | Construct the ConvNet model. 281 | """ 282 | return model 283 | 284 | def compile_model(self): 285 | """ 286 | Configure the ConvNet model. 287 | """ 288 | return 289 | 290 | def fit_model(self): 291 | """ 292 | Train the ConvNet model. 293 | """ 294 | return 295 | 296 | def evaluate_model(self): 297 | """ 298 | Evaluate the ConvNet model. 299 | """ 300 | return 301 | ``` 302 | 303 | 4. Create a class **Main** in a module in the *mains* package. This class is responsible for the execution flow of the experiment. Implement the following in the class: 304 | - Get the command line arguments and parse the JSON configuration file. 305 | - Instantiate the data loader class by passing the configured parameters. 306 | - Instantiate the model class by passing the configured parameters and data loader's object. The constructor will call the overridden functions to construct, configure, train and evaluate the ConvNet model. 307 | - Generate the classification report by creating an object of the class Report in the utils package and call the plot(), model_classification_report() and plot_confusion_matrix() functions. 308 | 309 | ```python 310 | try: 311 | # Capture the command line arguments from the interface script. 312 | args = get_args() 313 | # Parse the configuration parameters for the ConvNet Model. 314 | config = ConfigurationParameters( args ) 315 | except: 316 | print( 'Missing or invalid arguments !' ) 317 | exit(0) 318 | 319 | # Load the dataset from the library, process and print its details. 320 | dataset = SpecificLoader(config) 321 | 322 | # Construct, compile, train and evaluate the ConvNet Model. 323 | model = SpecificModel(config, dataset) 324 | 325 | # Generate graphs, classification report and confusion matrix. 326 | report = Report(config, model) 327 | report.plot() 328 | report.model_classification_report() 329 | report.plot_confusion_matrix() 330 | ``` 331 | 332 | # Further reading 333 | 334 | Work in progress. 335 | 336 | # Frequently Asked Questions 337 | 338 | Work in progress. 339 | 340 | # Future Works 341 | 342 | - To perform the experiments for ConvNet by : 343 | - Implementing it with different layer architecture. 344 | - Observing the effects of configuration parameters on the training phase. 345 | - Support for other standard machine learning datasets. 346 | - Implementation of ConvNet model for multimodal datasets. 347 | - Support for other deep learning techniques like RNN, Autoencoders, etc. 348 | 349 | # Acknowledgements 350 | 351 | - The project was inspired from [Tensorflow-Project-Template](https://github.com/MrGemy95/Tensorflow-Project-Template). 352 | 353 | # Contributors 354 | 355 | - Santosh Pattar, Research Scholar, Department of Computer Science and Engineering, University Visvesvaraya College of Engineering. email: 356 | 357 | - Veerabadrappa, Graduate Student, Department of Computer Science and Engineering, University Visvesvaraya College of Engineering. email: 358 | 359 | - Dr. Venugopal K R, Professor, Department of Computer Science and Engineering, University Visvesvaraya College of Engineering. email: 360 | 361 | - We appreciate and welcome any kind of comments and suggestions to improve the work. -------------------------------------------------------------------------------- /REQUIREMENTS.txt: -------------------------------------------------------------------------------- 1 | matplotlib==2.1.2 2 | numpy==1.14.0 3 | bunch==1.0.1 4 | tensorflow==1.5.0 5 | keras==2.1.6 6 | h5py==2.8.0rc1 -------------------------------------------------------------------------------- /base/__init__.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------------------- /base/data_loader_base.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Defines an abstract class DataLoader, that wraps the dataset loading process. 4 | Dataset can either be present in the library or on the disk. 5 | 6 | It also supports dataset printing options. 7 | 8 | Created on Sun Apr 22 20:17:31 2018 9 | 10 | @author: Santosh Pattar 11 | @author: Veerabadrappa 12 | @version: 1.0 13 | """ 14 | 15 | import numpy as np 16 | 17 | class DataLoader(object): 18 | 19 | def __init__(self, config): 20 | """ 21 | Constructor to initialize the training, testing datasets and their properties. 22 | 23 | :param config: the JSON configuration namespace. 24 | :return none 25 | :raises none 26 | """ 27 | 28 | # Configuration parameters. 29 | self.config = config 30 | 31 | # Training Dataset's Data and Lables. 32 | self.train_data = np.array([]) 33 | self.train_labels = np.array([]) 34 | 35 | # Testing Dataset's Data and Lables. 36 | self.test_data = np.array([]) 37 | self.test_labels = np.array([]) 38 | 39 | # Total number of Class-Labels. 40 | self.no_of_classes = 0 41 | 42 | # Class Label List. 43 | self.list_of_classes = [] 44 | 45 | # One-hot Encoded Label Vector. 46 | self.train_label_one_hot = np.array([]) 47 | self.test_label_one_hot = np.array([]) 48 | 49 | # Load the dataset from disk/library. 50 | self.load_dataset() 51 | 52 | # Calculate the number of class labels and list them. 53 | self.calculate_class_label_size() 54 | 55 | # Print the details of the dataset. 56 | self.print_dataset_details() 57 | 58 | # Preprocess the dataset (normalize, one-hot-shot encoding). 59 | self.preprocess_dataset() 60 | return 61 | 62 | def load_dataset(self): 63 | """ 64 | Loads the dataset. 65 | 66 | :param none 67 | :return none 68 | :raises NotImplementedError: Implement this method. 69 | """ 70 | 71 | # Implement this method in the inherited class to read the dataset from the disk. 72 | # Update respective data members of the DataLoader class. 73 | raise NotImplementedError 74 | 75 | def print_dataset_details(self): 76 | """ 77 | Prints the details of the dataset (training & testing size). 78 | 79 | :param none 80 | :return none 81 | :raises none 82 | """ 83 | 84 | # Number of samples in the dataset. 85 | print("Training dataset size (Data, Labels) is: ", self.train_data.shape, self.train_labels.shape) 86 | print("Testing dataset size (Data, Labels) is: ", self.test_data.shape, self.test_labels.shape) 87 | 88 | # Number of class labels and their list. 89 | print("Total number of Classes in the dataset: ", self.no_of_classes) 90 | print("The ", self.no_of_classes," Classes of the dataset are: ", self.list_of_classes) 91 | return 92 | 93 | def calculate_class_label_size(self): 94 | """ 95 | Calculates the total number of classes in the dataset. 96 | 97 | :param none 98 | :return none 99 | """ 100 | 101 | self.list_of_classes = np.unique(self.train_labels) 102 | self.no_of_classes = len(self.list_of_classes) 103 | print("Number of classes and its list from the loaded dataset calculated.") 104 | return 105 | 106 | def display_data_element(self, which_data, index): 107 | """ 108 | Displays a data element from a particular dataset (training/testing). 109 | 110 | :param which_data: Specifies the dataset to be used (i.e., training or testing). 111 | :param index: Specifies the index of the data element within a particular dataset. 112 | :returns none 113 | :raises NotImplementedError: Implement this method. 114 | """ 115 | 116 | # Implement this method in the inherited class to display a given data element. 117 | raise NotImplementedError 118 | 119 | def preprocess_dataset(self): 120 | """ 121 | Preprocess the dataset. 122 | 123 | :param none 124 | :returns none 125 | :raises NotImplementedError: Implement this method. 126 | """ 127 | 128 | # Implement this method in the inherited class to pre-process the dataset. 129 | # Data values in the training and testing dataset should be in floating point values, and 130 | # the class labels are to be in one-hot encoded vector. 131 | raise NotImplementedError -------------------------------------------------------------------------------- /base/grid_search_base.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Defines an abstract class GridSearchBase, that wraps the hyperparameter search process. 4 | 5 | It search for a optimal set of hyperparameters to train the ConvNet model. 6 | 7 | Created on Thu Apr 26 01:28:33 2018 8 | 9 | @author: Santosh Pattar 10 | @author: Veerabadrappa 11 | @version: 1.0 12 | """ 13 | 14 | from sklearn.model_selection import GridSearchCV 15 | from keras.wrappers.scikit_learn import KerasClassifier 16 | from base.model_base import BaseModel 17 | 18 | class GridSearchBase(BaseModel): 19 | 20 | def __init__(self, config, dataset): 21 | """ 22 | Initializes the grid search parameters. 23 | 24 | :param config: The configuration file. 25 | :return none 26 | :raises none 27 | """ 28 | 29 | # Configuration parameters. 30 | self.config = config 31 | 32 | # Dataset. 33 | self.dataset = dataset 34 | 35 | # Scikit-learn wrapper. 36 | self.model_wrapper = 0 37 | 38 | # Dictionary of hyperparameters. 39 | self.param_grid = {} 40 | 41 | # Parallel processing option, -1 for true and 1 for false. 42 | self.n_jobs = 1 43 | 44 | # Grid search model. 45 | self.grid = GridSearchCV(self.model_wrapper, self.param_grid) 46 | 47 | # Grid search results. 48 | self.grid_result = 0 49 | 50 | super().__init__(config) 51 | return 52 | 53 | def create_model(self): 54 | """ 55 | creates and compiles the ConvNet model. 56 | 57 | :param none 58 | :return none 59 | :raises NotImplementedError: Implement this method. 60 | """ 61 | 62 | # Implement this method in the inherited class to define, configure and compile the ConvNet model. 63 | raise NotImplementedError -------------------------------------------------------------------------------- /base/model_base.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Defines an abstract class BaseModel, that wraps the ConvNet model construction process. 4 | 5 | It defines, configures, trains and evaluates a ConvNet model. 6 | Also supports prediction of unknown class-labels on testing dataset. 7 | 8 | Saving and loading a predefined model are also supported. 9 | 10 | Created on Mon Apr 23 09:04:04 2018 11 | 12 | @author: Santosh Pattar 13 | @author: Veerabadrappa 14 | @version: 1.0 15 | """ 16 | 17 | import numpy as np 18 | import os 19 | from keras.models import Sequential 20 | from keras.callbacks import History, ModelCheckpoint 21 | 22 | class BaseModel(object): 23 | def __init__(self, config, dataset): 24 | 25 | """ 26 | Constructor to initialize the ConvNet's architecture parameters. 27 | 28 | :param config: the JSON configuration namespace. 29 | :param dataset: the training and testing dataset. 30 | :return none 31 | :raises none 32 | """ 33 | 34 | # Configuaration parameters. 35 | self.config = config 36 | 37 | # Training and testing datasets. 38 | self.dataset = dataset 39 | 40 | # ConvNet model. 41 | self.cnn_model = Sequential() 42 | 43 | # History object, holds training history. 44 | self.history = History() 45 | 46 | # Saved model path. 47 | self.saved_model_path = os.path.join( self.config.config_namespace.saved_model_dir, "my_model.h5" ) 48 | 49 | # Checkpoint for ConvNet model. 50 | self.checkpoint = ModelCheckpoint( self.saved_model_path, 51 | monitor = 'val_acc', 52 | verbose = self.config.config_namespace.checkpoint_verbose, 53 | save_best_only = True, 54 | mode = 'max' 55 | ) 56 | 57 | # Callbacks list. 58 | self.callbacks_list = [self.checkpoint] 59 | 60 | # Evaluation scores. 61 | self.scores = [] 62 | 63 | # Training time. 64 | self.train_time = 0 65 | 66 | # Predicted class labels. 67 | self.predictions = np.array([]) 68 | 69 | # Validte the stride size. 70 | self.validate_stride() 71 | 72 | # Construct the ConvNet model. 73 | self.define_model() 74 | 75 | # Configure the ConvNet model. 76 | self.compile_model() 77 | 78 | # Train the ConvNet model using testing dataset. 79 | self.fit_model() 80 | 81 | # Evaluate the ConvNet model using testing dataset. 82 | self.evaluate_model() 83 | 84 | # Predict the class labels of testing dataset. 85 | self.predict() 86 | return 87 | 88 | def calculate_number_of_filters(self): 89 | """ 90 | Calaculates the filter size for a given layer. 91 | 92 | :param none 93 | :return none 94 | :raises NotImplementedError: Implement this method. 95 | """ 96 | 97 | # Implement this method in the inherited class to calculate the filter size. 98 | raise NotImplementedError 99 | 100 | def validate_stride(self): 101 | """ 102 | Validate the stride size based on the input data's size, filter's size and padding volume specified. 103 | 104 | :param none 105 | :return none 106 | :raises Exception: Invalid stride size. 107 | """ 108 | 109 | valid_stride_width = ( 110 | self.config.config_namespace.image_width - self.config.config_namespace.kernel_row + 111 | 2 * self.config.config_namespace.padding_size 112 | ) / self.config.config_namespace.stride_size + 1 113 | 114 | valid_stride_height = ( 115 | self.config.config_namespace.image_height - self.config.config_namespace.kernel_column + 116 | 2 * self.config.config_namespace.padding_size 117 | ) / self.config.config_namespace.stride_size + 1 118 | 119 | if( not float(valid_stride_width).is_integer() 120 | and 121 | not float(valid_stride_height).is_integer() 122 | ): 123 | print("Invalid stride size specified, model does not fit to the specification. !") 124 | raise Exception 125 | else: 126 | return 127 | 128 | def define_model(self): 129 | """ 130 | Constructs the ConvNet model. 131 | 132 | :param none 133 | :return none 134 | :raises NotImplementedError: Implement this method. 135 | """ 136 | 137 | # Implement this method in the inherited class to add layers to the ConvNet. 138 | raise NotImplementedError 139 | 140 | def compile_model(self): 141 | """ 142 | Configures the ConvNet model. 143 | 144 | :param none 145 | :return none 146 | :raises NotImplementedError: Implement this method. 147 | """ 148 | 149 | # Implement this method in the inherited class to configure the ConvNet model. 150 | raise NotImplementedError 151 | 152 | def fit_model(self): 153 | """ 154 | Trains the ConvNet model. 155 | 156 | :param none 157 | :return none 158 | :raises NotImplementedError: Implement this method. 159 | """ 160 | 161 | # Implement this method in the inherited class to configure the ConvNet model. 162 | raise NotImplementedError 163 | 164 | def evaluate_model(self): 165 | """ 166 | Evaluates the ConvNet model. 167 | 168 | :param none 169 | :return none 170 | :raises NotImplementedError: Implement this method. 171 | """ 172 | 173 | # Implement this method in the inherited class to evaluate the constructed ConvNet model. 174 | raise NotImplementedError 175 | 176 | def predict(self): 177 | """ 178 | Predicts the class labels of unknown data. 179 | 180 | :param none 181 | :return none 182 | :raises NotImplementedError: Exception: Implement this method. 183 | """ 184 | 185 | # Implement this method in the inherited class to predict the class-labels of unknown data. 186 | raise NotImplementedError 187 | 188 | def save_model(self): 189 | """ 190 | Saves the ConvNet model to disk in h5 format. 191 | 192 | :param none 193 | :return none 194 | """ 195 | 196 | if( self.cnn_model is None ): 197 | raise Exception("ConvNet model not configured and trained !") 198 | 199 | self.cnn_model.save( self.saved_model_path ) 200 | print("ConvNet model saved at path: ", self.saved_model_path, "\n") 201 | 202 | return 203 | 204 | def load_cnn_model(self): 205 | """ 206 | Loads the saved model from the disk. 207 | 208 | :param none 209 | :return none 210 | :raises NotImplementedError: Implement this method. 211 | """ 212 | 213 | if( self.cnn_model is None ): 214 | raise Exception("ConvNet model not configured and trained !") 215 | 216 | self.cnn_model.load_weights( self.saved_model_path ) 217 | print("ConvNet model loaded from the path: ", self.saved_model_path, "\n") 218 | 219 | return 220 | -------------------------------------------------------------------------------- /configuration_files/fashion_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "exp_name": "fashion_mnist", 3 | "save_plots": "true", 4 | "save_model": "true", 5 | "image_width": 28, 6 | "image_height": 28, 7 | "image_channel": 1, 8 | "image_pixel_size": 255, 9 | "num_classes": 10, 10 | "cmap_val": "gray", 11 | "model_type": "Sequential", 12 | "no_of_layers": 13, 13 | "kernel_row": 3, 14 | "kernel_column": 3, 15 | "stride_size": 1, 16 | "padding": "same", 17 | "padding_size": 0, 18 | "no_of_filters_l1": 32, 19 | "conv_activation_l1": "linear", 20 | "no_of_filters_l2": 64, 21 | "conv_activation_l2": "linear", 22 | "no_of_filters_l3": 128, 23 | "conv_activation_l3": "linear", 24 | "no_of_filters_l4": 128, 25 | "dense_activation_l1": "linear", 26 | "dense_activation_l2": "softmax", 27 | "relu_alpha": 0.1, 28 | "pool_size_row": 2, 29 | "pool_size_column": 2, 30 | "dropout": "true", 31 | "dropout_probability_l1": 0.25, 32 | "dropout_probability_l2": 0.4, 33 | "dropout_probability_l3": 0.3, 34 | "compile_loss": "categorical_crossentropy", 35 | "compile_optimizer": "adam", 36 | "compile_metrics1": "accuracy", 37 | "test_size":"0.2", 38 | "num_epochs": 1, 39 | "batch_size": 500, 40 | "fit_verbose": 1, 41 | "checkpoint_verbose": 1, 42 | "evaluate_verbose": 1, 43 | "predict_verbose": 1 44 | } 45 | -------------------------------------------------------------------------------- /configuration_files/stl10_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "exp_name": "myStl10Main", 3 | "save_plots": "true", 4 | "image_width": 28, 5 | "image_height": 28, 6 | "image_channel": 1, 7 | "image_pixel_size": 255, 8 | "num_classes": 10, 9 | "cmap_val": "gray", 10 | "model_type": "Sequential", 11 | "no_of_layers": 13, 12 | "kernel_row": 3, 13 | "kernel_column": 3, 14 | "stride_size": 1, 15 | "padding": "same", 16 | "padding_size": 0, 17 | "no_of_filters_l1": 32, 18 | "conv_activation_l1": "linear", 19 | "no_of_filters_l2": 64, 20 | "conv_activation_l2": "linear", 21 | "no_of_filters_l3": 128, 22 | "conv_activation_l3": "linear", 23 | "no_of_filters_l4": 128, 24 | "dense_activation_l1": "linear", 25 | "dense_activation_l2": "softmax", 26 | "relu_alpha": 0.1, 27 | "pool_size_row": 2, 28 | "pool_size_column": 2, 29 | "dropout": "true", 30 | "dropout_probability_l1": 0.25, 31 | "dropout_probability_l2": 0.4, 32 | "dropout_probability_l3": 0.3, 33 | "compile_loss": "categorical_crossentropy", 34 | "compile_optimizer": "adam", 35 | "compile_metrics1": "accuracy", 36 | "test_size":"0.2", 37 | "num_epochs": 1, 38 | "batch_size": 500, 39 | "fit_verbose": 1, 40 | "evaluate_verbose": 1, 41 | "predict_verbose": 1, 42 | "learning_rate": "", 43 | "random_state": 13 44 | } 45 | -------------------------------------------------------------------------------- /configuration_files/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "exp_name": XXXXX, 3 | "save_plots": XXXXX, 4 | "image_width": XXXXX, 5 | "image_height": XXXXX, 6 | "image_channel": XXXXX, 7 | "image_pixel_size": XXXXX, 8 | "num_classes": XXXXX, 9 | "cmap_val": XXXXX, 10 | "model_type": XXXXX, 11 | "no_of_layers": XXXXX, 12 | "kernel_row": XXXXX, 13 | "kernel_column": XXXXX, 14 | "stride_size": XXXXX, 15 | "padding": XXXXX, 16 | "padding_size": XXXXX, 17 | "no_of_filters_l1": XXXXX, 18 | "conv_activation_l1": XXXXX, 19 | "no_of_filters_l2": XXXXX, 20 | "conv_activation_l2": XXXXX, 21 | "no_of_filters_l3": XXXXX, 22 | "conv_activation_l3": XXXXX, 23 | "no_of_filters_l4": XXXXX, 24 | "dense_activation_l1": XXXXX, 25 | "dense_activation_l2": XXXXX, 26 | "relu_alpha": XXXXX, 27 | "pool_size_row": XXXXX, 28 | "pool_size_column": XXXXX, 29 | "dropout": XXXXX, 30 | "dropout_probability_l1": XXXXX, 31 | "dropout_probability_l2": XXXXX, 32 | "dropout_probability_l3": XXXXX, 33 | "compile_loss": XXXXX, 34 | "compile_optimizer": XXXXX, 35 | "compile_metrics1": XXXXX, 36 | "test_size": XXXXX, 37 | "num_epochs": XXXXX, 38 | "batch_size": XXXXX, 39 | "fit_verbose": XXXXX, 40 | "evaluate_verbose": XXXXX, 41 | "predict_verbose": XXXXX, 42 | "learning_rate": XXXXX, 43 | "random_state": XXXXX, 44 | } 45 | 46 | -------------------------------------------------------------------------------- /data_loader/__init__.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------------------- /data_loader/fashion_mnist_loader.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Implements the FashionMnistLoader class by inheriting the DataLoader base class. 4 | 5 | Keras provides the FashionMNIST dataset in its datasets package. 6 | This class loads the dataset from the keras library and pre-process it. 7 | 8 | Created on Sun Apr 22 20:39:33 2018 9 | 10 | @author: Santosh Pattar 11 | @author: Veerabadrappa 12 | @version: 1.0 13 | """ 14 | 15 | from base.data_loader_base import DataLoader 16 | from keras.datasets import fashion_mnist 17 | import matplotlib.pyplot as plt 18 | from keras.utils import to_categorical 19 | import os 20 | 21 | class FashionMnistLoader(DataLoader): 22 | 23 | def __init__(self, config): 24 | """ 25 | Constructor to initialize the training and testing datasets for FashionMNIST. 26 | 27 | :param config: the json configuration namespace. 28 | :return none 29 | :raises none 30 | """ 31 | 32 | super().__init__(config) 33 | return 34 | 35 | def load_dataset(self): 36 | """ 37 | Loads the fashion_mnist image dataset, and 38 | Updates the respective class members. 39 | 40 | :param none 41 | :return none 42 | :raises none 43 | """ 44 | 45 | # Load the dataset from the Keras library. 46 | print("Loading the dataset from the Keras library ...") 47 | (self.train_data, self.train_labels), (self.test_data, self.test_labels) = fashion_mnist.load_data() 48 | 49 | print("Dataset loaded successfully from the Keras library for the experiment", self.config.config_namespace.exp_name, "\n") 50 | 51 | # Reshape the training and testing data arrays to include channel (since gray scale only 1 channel). 52 | self.train_data = self.train_data.reshape( -1, 53 | self.config.config_namespace.image_width, 54 | self.config.config_namespace.image_height, 55 | self.config.config_namespace.image_channel 56 | ) 57 | 58 | self.test_data = self.test_data.reshape( -1, 59 | self.config.config_namespace.image_width, 60 | self.config.config_namespace.image_height, 61 | self.config.config_namespace.image_channel 62 | ) 63 | 64 | print("Training data and testing data are reshaped to size: " , 65 | self.config.config_namespace.image_width, 66 | self.config.config_namespace.image_height, 67 | self.config.config_namespace.image_channel, 68 | "\n") 69 | 70 | def display_data_element(self, which_data, index): 71 | """ 72 | Displays a data element from the FashionMNIST dataset (training/testing). 73 | 74 | :param which_data: Specifies the dataset to be used (i.e., training or testing). 75 | :param index: Specifies the index of the data element within a particular dataset. 76 | :returns none 77 | :raises none 78 | """ 79 | 80 | # Create a new figure. 81 | plt.figure() 82 | 83 | # Display a training data element. 84 | if(which_data == "train_data"): 85 | plt.imshow( self.train_data[index, : , : ].reshape( self.config.config_namespace.image_width, 86 | self.config.config_namespace.image_height 87 | ), 88 | self.config.config_namespace.cmap_val 89 | ) 90 | 91 | plt.title("Class Label of the Training Image is: {}".format(self.train_labels[index])) 92 | train_image_path = os.path.join( self.config.config_namespace.image_dir, "sample_training_fashion_mnist_image.png") 93 | 94 | if(self.config.config_namespace.save_plots == 'true'): 95 | plt.savefig( train_image_path , bbox_inches='tight') 96 | print("The ", which_data, " data from the index ", index, " is saved at path: ", train_image_path) 97 | else: 98 | plt.show() 99 | print("The ", which_data, " data from the index ", index, " is displayed.") 100 | 101 | # Display a testing data element. 102 | elif(which_data == "test_data"): 103 | plt.imshow( self.test_data[index,:,:].reshape( self.config.config_namespace.image_width, 104 | self.config.config_namespace.image_height 105 | ), 106 | self.config.config_namespace.cmap_val 107 | ) 108 | 109 | plt.title("Class Label of the Testing Image is: {}".format(self.test_labels[index])) 110 | test_image_path = os.path.join( self.config.config_namespace.image_dir, "sample_testing_fashion_mnist_image.png") 111 | 112 | if(self.config.config_namespace.save_plots == 'true'): 113 | plt.savefig( test_image_path , bbox_inches='tight') 114 | print("The ", which_data, " data from the index ", index, " is saved at path: ", test_image_path) 115 | else: 116 | plt.show() 117 | print("The ", which_data, " data from the index ", index, " is displayed.") 118 | 119 | else: 120 | print("Error: display_data_element: whicData parameter is invalid !") 121 | 122 | # Close the figure. 123 | plt.close() 124 | return 125 | 126 | def preprocess_dataset(self): 127 | """ 128 | Preprocess the FashionMNIST dataset. 129 | 130 | Performs data type conversion and normalization on data values of training and testing dataset, and 131 | Converts the categorical class labels to boolean one-hot encoded vector for training and testing datasets. 132 | 133 | :param none 134 | :returns none 135 | :raises none 136 | """ 137 | 138 | # Convert the integer pixel data to floating data. 139 | self.train_data = self.train_data.astype('float32') 140 | self.test_data = self.test_data.astype('float32') 141 | 142 | # Rescale the pixel values from orignal values to the values in range 0 10 1. 143 | # Since, fashion_mnist has 256 possible pixel values we divide it by 255 to normalize in range 0 to 1. 144 | self.train_data = self.train_data / self.config.config_namespace.image_pixel_size 145 | self.test_data = self.test_data / self.config.config_namespace.image_pixel_size 146 | 147 | # Convert the class labels from categorical to boolean one hot encoded vector. 148 | self.train_label_one_hot = to_categorical( self.train_labels ) 149 | self.test_label_one_hot = to_categorical( self.test_labels ) 150 | 151 | print("Training and testing datasets are normalized and their respective class labels are converted to one-hot encoded vector. \n") 152 | return 153 | -------------------------------------------------------------------------------- /data_loader/stl10_loader.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Implements the Stl10Loader class by inheriting the DataLoader base class. 4 | 5 | STL-10 dataset is loaded from an external path (i.e., in dataset folder) and preprocessed. 6 | 7 | Created on Sun Apr 22 20:54:32 2018 8 | 9 | @author: Santosh Pattar 10 | @author: Veerabadrappa 11 | @version: 1.0 12 | """ 13 | 14 | from base.data_loader_base import DataLoader 15 | import os 16 | import numpy as np 17 | import matplotlib.pyplot as plt 18 | from keras.utils import to_categorical 19 | 20 | class Stl10Loader(DataLoader): 21 | 22 | def __init__(self, config): 23 | """ 24 | Constructor to initialize the training and testing datasets for STL-10 dataset. 25 | 26 | :param config: the JSON configuration namespace. 27 | :return none 28 | :raises none 29 | """ 30 | 31 | super().__init__(config) 32 | return 33 | 34 | def load_dataset(self): 35 | """ 36 | Loads the STL-10 image dataset from the disk location, and 37 | Updates the respective class members. 38 | 39 | :param none 40 | :return none 41 | :raises none 42 | """ 43 | 44 | # Paths to the training and testing data for STL-10 dataset. 45 | path = './dataset/stl-10' 46 | train_data_path = os.path.join(path, 'train_X.bin') 47 | train_label_path = os.path.join(path, 'train_y.bin') 48 | test_data_path = os.path.join(path, 'test_X.bin') 49 | test_label_path = os.path.join(path, 'test_y.bin') 50 | 51 | # Read the training data images and thier labels from the disk. 52 | self.train_data = self.read_images(train_data_path) 53 | self.train_labels = self.read_labels(train_label_path) 54 | 55 | # Read the test data images and thier labels from the disk. 56 | self.test_data = self.read_images(test_data_path) 57 | self.test_labels = self.read_labels(test_label_path) 58 | 59 | return 60 | 61 | def read_images(self, path_to_data): 62 | """ 63 | Reads a binary file from the disk that contains image data, and 64 | stores them in numpy array. 65 | 66 | :param none 67 | :return none 68 | :raises none 69 | """ 70 | 71 | # FIXME: change the reshape's arguments with the config namespace keys. 72 | with open(path_to_data, 'rb') as f: 73 | everything = np.fromfile(f, dtype=np.uint8) 74 | images = np.reshape(everything, (-1, 3, 96, 96)) 75 | images = np.transpose(images, (0, 3, 2, 1)) 76 | return images 77 | 78 | def read_labels(self, path_to_labels): 79 | """ 80 | Reads a binary file from the disk that contains image labels, and 81 | stores them in numpy array. 82 | 83 | :param none 84 | :return none 85 | :raises none 86 | """ 87 | 88 | # FIXME: change the reshape's arguments with the config namespace keys. 89 | with open(path_to_labels, 'rb') as f: 90 | labels = np.fromfile(f, dtype=np.uint8) 91 | return labels 92 | 93 | def display_data_element(self, which_data, index): 94 | """ 95 | Displays a data element from the STL-10 dataset (training/testing). 96 | 97 | :param which_data: Specifies the dataset to be used (i.e., training or testing). 98 | :param index: Specifies the index of the data element within a particular dataset. 99 | :returns none 100 | :raises none 101 | """ 102 | 103 | # Create a new figure. 104 | plt.figure() 105 | 106 | # FIXME: modify appropriately to include save to disk option. Refer FashionMNSIT's display function. 107 | if(which_data == "train_data"): 108 | plt.imshow( self.train_data[index, : , : ] ) 109 | #plt.imshow( self.trainData[index, : , : ] ) 110 | # plt.show() 111 | plt.savefig('./resources/images/sample_training.png', bbox_inches='tight') 112 | plt.close() 113 | 114 | elif(which_data == "test_data"): 115 | plt.imshow( self.test_data[index,:,:] ) 116 | #plt.imshow( self.testData[index,:,:]) 117 | # plt.show() 118 | plt.savefig('./resources/images/sample_testing.png', bbox_inches='tight') 119 | else: 120 | print("Error: display_data_element: whicData parameter is invalid !") 121 | 122 | # Close the figure. 123 | plt.close() 124 | return 125 | 126 | def preprocessDataset(self): 127 | """ 128 | Preprocess the STL-10 dataset. 129 | 130 | Performs normalization on data values of training and testing dataset, and 131 | Converts the categorical class labels to boolean one-hot encoded vector for training and testing datasets. 132 | 133 | :param none 134 | :returns none 135 | :raises none 136 | """ 137 | # Convert the integer pixel data to floating data to speed up keras execution. 138 | #self.trainData = self.trainData.astype('float32') 139 | #self.testData = self.testData.astype('float32') 140 | 141 | # Rescale the pixel values from orignal values to the values in range 0 10 1. 142 | #self.trainData = self.trainData / self.config.config_namespace.image_pixel_size 143 | #self.testData = self.testData / self.config.config_namespace.image_pixel_size 144 | 145 | # Convert from categorical to boolean one hot encoded vector. 146 | self.trainLabelsOneHot = to_categorical( self.train_labels ) 147 | self.testLabelsOneHot = to_categorical( self.test_labels ) 148 | return 149 | -------------------------------------------------------------------------------- /dataset/stl-10/stl-10: -------------------------------------------------------------------------------- 1 | The dataset will be made available soon. 2 | -------------------------------------------------------------------------------- /hyperparameter_optimization/__init__.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------------------- /hyperparameter_optimization/grid_search_fashion_mnist.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Implements grid search for a optimal set of hyperparameters to train the ConvNet model for fashion_mnist dataset. 4 | 5 | Created on Thu Apr 26 01:28:17 2018 6 | 7 | @author: Santosh Pattar 8 | @author: Veerabadrappa 9 | @version: 1.0 10 | """ 11 | 12 | from base.grid_search_base import GridSearchBase 13 | from model.fashion_mnist_model import FashionMnistModel 14 | from sklearn.model_selection import GridSearchCV 15 | from keras.wrappers.scikit_learn import KerasClassifier 16 | from model.fashion_mnist_model import FashionMnistModel 17 | from data_loader.fashion_mnist_loader import FashionMnistLoader 18 | from utils.process_argument import get_args 19 | from utils.process_configuration import ConfigurationParameters 20 | 21 | 22 | def create_model(self): 23 | """ 24 | creates and compiles the ConvNet model. 25 | 26 | :param none 27 | :return cnn_model: The configured ConvNet model. 28 | :raises none 29 | """ 30 | 31 | model = FashionMnistModel(self.config, self.dataset) 32 | cnn_model = model.define_model() 33 | return cnn_model 34 | 35 | def main(): 36 | 37 | try: 38 | args = get_args() 39 | 40 | # Parse the configuration parameters for the CNN Model. 41 | config = ConfigurationParameters( args ) 42 | 43 | except: 44 | print( 'Missing or invalid arguments !' ) 45 | exit(0) 46 | 47 | 48 | dataset = FashionMnistLoader(config) 49 | 50 | g_search = GridSearchBase(config, dataset) 51 | 52 | # create a Scikit-learn wrapper. 53 | g_search.model_wrapper = KerasClassifier(build_fn = g_search.create_model, verbose=0) 54 | 55 | # define the grid search parameters 56 | batch_size = [1, 2] 57 | epochs = [300, 500] 58 | g_search.param_grid = dict( 59 | batch_size=batch_size, 60 | epochs=epochs 61 | ) 62 | 63 | g_search.grid = GridSearchCV( estimator=g_search.model_wrapper, 64 | param_grid=g_search.param_grid, 65 | n_jobs=g_search.n_jobs 66 | ) 67 | g_search.grid_result = g_search.grid.fit( 68 | dataset.train_data, 69 | dataset.train_label_one_hot 70 | ) 71 | 72 | # summarize results 73 | print("Best: %f using %s" % (g_search.grid_result.best_score_, g_search.grid_result.best_params_)) 74 | means = g_search.grid_result.cv_results_['mean_test_score'] 75 | stds = g_search.grid_result.cv_results_['std_test_score'] 76 | params = g_search.grid_result.cv_results_['params'] 77 | 78 | for mean, stdev, param in zip(means, stds, params): 79 | print("%f (%f) with: %r" % (mean, stdev, param)) 80 | 81 | if __name__ == '__main__': 82 | main() -------------------------------------------------------------------------------- /mains/__init__.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------------------- /mains/fashion_mnist_mains.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Execution Flow for the FashionMNIST experiment. 4 | 5 | Created on Sun Apr 22 21:08:16 2018 6 | 7 | @author: Santosh Pattar 8 | @author: Veerabadrappa 9 | @version: 1.0 10 | """ 11 | 12 | # Reproduce results by seed-ing the random number generator. 13 | from numpy.random import seed 14 | seed(1) 15 | from tensorflow import set_random_seed 16 | set_random_seed(2) 17 | 18 | from utils.process_configuration import ConfigurationParameters 19 | from data_loader.fashion_mnist_loader import FashionMnistLoader 20 | from model.fashion_mnist_model import FashionMnistModel 21 | from utils.model_utils import Report 22 | from utils.process_argument import get_args 23 | 24 | def main(): 25 | 26 | try: 27 | 28 | # Capture the command line arguments from the interface script. 29 | args = get_args() 30 | 31 | # Parse the configuration parameters for the ConvNet Model. 32 | config = ConfigurationParameters( args ) 33 | 34 | except: 35 | print( 'Missing or invalid arguments !' ) 36 | exit(0) 37 | 38 | # Load the dataset from the library, process and print its details. 39 | dataset = FashionMnistLoader(config) 40 | 41 | # Test the loaded dataset by displaying the first image in both training and testing dataset. 42 | dataset.display_data_element( 'train_data', 1 ) 43 | dataset.display_data_element( 'test_data', 1 ) 44 | 45 | # Construct, compile, train and evaluate the ConvNet Model. 46 | model = FashionMnistModel(config, dataset) 47 | 48 | # Save the ConvNet model to the disk. 49 | # model.save_model() 50 | 51 | # Generate graphs, classification report, confusion matrix. 52 | report = Report(config, model) 53 | report.plot() 54 | report.model_classification_report() 55 | report.plot_confusion_matrix() 56 | 57 | if __name__ == '__main__': 58 | main() 59 | -------------------------------------------------------------------------------- /mains/stl10_mains.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Execution Flow for the STL-10 experiment. 4 | 5 | Created on Sun Apr 22 22:53:00 2018 6 | 7 | @author: pattar 8 | """ 9 | # Reproduce results by seed-ing the random number generator. 10 | from numpy.random import seed 11 | seed(1) 12 | from tensorflow import set_random_seed 13 | set_random_seed(2) 14 | 15 | from utils.process_configuration import ConfigurationParameters 16 | from data_loader.stl10_loader import Stl10Loader 17 | #import base.model_base import BaseModel 18 | 19 | def main(): 20 | 21 | # Parse the configuration parameters for the CNN Model. 22 | config = ConfigurationParameters("./configuration_files/fashion_config.json") 23 | 24 | # Load the dataset from the library and print its details. 25 | dataset = Stl10Loader(config) 26 | 27 | # Test the loaded dataset, 28 | # i.e., display the first images in both training and testing dataset. 29 | dataset.displayDataElement( "train", 1 ) 30 | dataset.displayDataElement( "test", 1 ) 31 | 32 | # Construct the CNN Model. 33 | # model = mb.ModelBase(config) 34 | 35 | if __name__ == '__main__': 36 | main() -------------------------------------------------------------------------------- /model/__init__.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------------------- /model/fashion_mnist_model.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | ConvNet model for fashion_mnist dataset. 4 | 5 | Created on Mon Apr 23 09:44:25 2018 6 | 7 | @author: Santosh Pattar 8 | @author: Veerabadrappa 9 | @version: 1.0 10 | """ 11 | 12 | from base.model_base import BaseModel 13 | from keras.models import Sequential, Model 14 | from keras.layers import Dense, Dropout, Flatten 15 | from keras.layers import Conv2D, MaxPooling2D 16 | from keras.layers.advanced_activations import LeakyReLU 17 | from keras.models import load_model 18 | import time 19 | 20 | class FashionMnistModel(BaseModel): 21 | 22 | def __init__(self, config, dataset): 23 | """ 24 | Constructor to initialize the ConvNet for FashionMNIST dataset. 25 | 26 | :param config: the JSON configuration namespace. 27 | :param dataset: Training and testing datasets. 28 | :return none 29 | :raises none 30 | """ 31 | 32 | super().__init__(config, dataset) 33 | return 34 | 35 | def define_model(self): 36 | """ 37 | Construct the ConvNet model. 38 | 39 | :param none 40 | :return none 41 | :raises none 42 | """ 43 | 44 | # TODO: two ways of defining 45 | # 1) intialize an array with all layers(remember there is layer size parameter in JSON) and pass it to Sequential constructor. 46 | # 2) add the layers to the model through "add" method of Sequential class. 47 | 48 | if( self.config.config_namespace.model_type == 'Sequential' ): 49 | print("The Keras ConvNet model type used for this experiment is: ", self.config.config_namespace.model_type) 50 | self.cnn_model = self.define_sequential_model() 51 | 52 | else: 53 | # TODO: handle functional model here. 54 | # self.cnn_model = Model() 55 | self.define_functional_model() 56 | 57 | # Summary of the ConvNet model. 58 | self.cnn_model.summary() 59 | return 60 | 61 | def define_sequential_model(self): 62 | """ 63 | Design a sequential ConvNet model. 64 | 65 | :param none 66 | :return cnn_model: The ConvNet sequential model. 67 | :raises none 68 | """ 69 | 70 | self.cnn_model = Sequential() 71 | 72 | # 1st Layer. 73 | self.cnn_model.add( Conv2D( filters = self.config.config_namespace.no_of_filters_l1, 74 | kernel_size = ( self.config.config_namespace.kernel_row, self.config.config_namespace.kernel_column ), 75 | activation = self.config.config_namespace.conv_activation_l1, 76 | input_shape = ( self.config.config_namespace.image_width, self.config.config_namespace.image_height, self.config.config_namespace.image_channel ), 77 | padding = self.config.config_namespace.padding, 78 | strides = self.config.config_namespace.stride_size 79 | ) 80 | ) 81 | 82 | # 2nd Layer. 83 | self.cnn_model.add( LeakyReLU(alpha = self.config.config_namespace.relu_alpha) ) 84 | 85 | # 3rd Layer. 86 | self.cnn_model.add( MaxPooling2D( pool_size = (self.config.config_namespace.pool_size_row, self.config.config_namespace.pool_size_column), 87 | padding = self.config.config_namespace.padding 88 | ) 89 | ) 90 | 91 | # Add dropout layer, if necessary. 92 | if( self.config.config_namespace.dropout == 'true' ): 93 | self.cnn_model.add( Dropout( self.config.config_namespace.dropout_probability_l1 ) ) 94 | 95 | # 4th Layer. 96 | self.cnn_model.add( Conv2D( filters = self.config.config_namespace.no_of_filters_l2, 97 | kernel_size = ( self.config.config_namespace.kernel_row, self.config.config_namespace.kernel_column ), 98 | activation = self.config.config_namespace.conv_activation_l2, 99 | padding = self.config.config_namespace.padding, 100 | strides = self.config.config_namespace.stride_size 101 | ) 102 | ) 103 | 104 | # 5th Layer. 105 | self.cnn_model.add( LeakyReLU(alpha = self.config.config_namespace.relu_alpha) ) 106 | 107 | # 6th Layer. 108 | self.cnn_model.add( MaxPooling2D( pool_size = (self.config.config_namespace.pool_size_row, self.config.config_namespace.pool_size_column), 109 | padding = self.config.config_namespace.padding 110 | ) 111 | ) 112 | 113 | # Add dropout layer, if necessary. 114 | if( self.config.config_namespace.dropout == 'true' ): 115 | self.cnn_model.add( Dropout( self.config.config_namespace.dropout_probability_l1 ) ) 116 | 117 | # 7th Layer. 118 | self.cnn_model.add( Conv2D( filters = self.config.config_namespace.no_of_filters_l3, 119 | kernel_size = ( self.config.config_namespace.kernel_row, 120 | self.config.config_namespace.kernel_column ), 121 | activation = self.config.config_namespace.conv_activation_l3, 122 | padding = self.config.config_namespace.padding, 123 | strides = self.config.config_namespace.stride_size 124 | ) 125 | ) 126 | 127 | # 8th Layer. 128 | self.cnn_model.add( LeakyReLU(alpha = self.config.config_namespace.relu_alpha) ) 129 | 130 | # 9th Layer. 131 | self.cnn_model.add( MaxPooling2D( pool_size = (self.config.config_namespace.pool_size_row, self.config.config_namespace.pool_size_column), 132 | padding = self.config.config_namespace.padding 133 | ) 134 | ) 135 | 136 | # Add dropout layer, if necessary. 137 | if( self.config.config_namespace.dropout == 'true' ): 138 | self.cnn_model.add( Dropout( self.config.config_namespace.dropout_probability_l2 ) ) 139 | 140 | # 10th Layer. 141 | self.cnn_model.add( Flatten() ) 142 | 143 | # 11th Layer. 144 | self.cnn_model.add( Dense( units = self.config.config_namespace.no_of_filters_l4, 145 | activation = self.config.config_namespace.dense_activation_l1 146 | ) 147 | ) 148 | 149 | # 12th Layer. 150 | self.cnn_model.add( LeakyReLU(alpha = self.config.config_namespace.relu_alpha) ) 151 | 152 | # Add dropout layer, if necessary. 153 | if( self.config.config_namespace.dropout == 'true' ): 154 | self.cnn_model.add( Dropout( self.config.config_namespace.dropout_probability_l3 ) ) 155 | 156 | # 13th Layer. 157 | self.cnn_model.add( Dense( self.dataset.no_of_classes, 158 | activation = self.config.config_namespace.dense_activation_l2 159 | ) 160 | ) 161 | 162 | return self.cnn_model 163 | 164 | def define_functional_model(self): 165 | """ 166 | Define (construct) a functional ConvNet model. 167 | 168 | :param none 169 | :return cnn_model: The ConvNet sequential model. 170 | :raises none 171 | """ 172 | 173 | print("yet to be implemente\n") 174 | return 175 | 176 | def compile_model(self): 177 | """ 178 | Configure the ConvNet model. 179 | 180 | :param none 181 | :return none 182 | :raises none 183 | """ 184 | 185 | self.cnn_model.compile( loss = self.config.config_namespace.compile_loss, 186 | optimizer = self.config.config_namespace.compile_optimizer, 187 | metrics = [self.config.config_namespace.compile_metrics1] 188 | ) 189 | 190 | 191 | # FIXME; check if dataset is need in the whole class, if not needed just pass it to required functions. (see grid search) 192 | def fit_model(self): 193 | """ 194 | Train the ConvNet model. 195 | 196 | :param none 197 | :return none 198 | :raises none 199 | """ 200 | 201 | start_time = time.time() 202 | 203 | if( self.config.config_namespace.save_model == "true"): 204 | print("Training phase under progress, trained ConvNet model will be saved at path", self.saved_model_path, " ...\n") 205 | self.history = self.cnn_model.fit( x = self.dataset.train_data, 206 | y = self.dataset.train_label_one_hot , 207 | batch_size = self.config.config_namespace.batch_size, 208 | epochs = self.config.config_namespace.num_epochs, 209 | callbacks = self.callbacks_list, 210 | verbose = self.config.config_namespace.fit_verbose, 211 | validation_data = ( self.dataset.test_data, self.dataset.test_label_one_hot ) 212 | ) 213 | else: 214 | print("Training phase under progress ...\n") 215 | self.history = self.cnn_model.fit( x = self.dataset.train_data, 216 | y = self.dataset.train_label_one_hot , 217 | batch_size = self.config.config_namespace.batch_size, 218 | epochs = self.config.config_namespace.num_epochs, 219 | verbose = self.config.config_namespace.fit_verbose, 220 | validation_data = ( self.dataset.test_data, self.dataset.test_label_one_hot ) 221 | ) 222 | 223 | end_time = time.time() 224 | 225 | self.train_time = end_time - start_time 226 | print( "The model took %0.3f seconds to train.\n"%self.train_time ) 227 | 228 | return 229 | 230 | def evaluate_model(self): 231 | """ 232 | Evaluate the ConvNet model. 233 | 234 | :param none 235 | :return none 236 | :raises none 237 | """ 238 | 239 | self.scores = self.cnn_model.evaluate( x = self.dataset.test_data, 240 | y = self.dataset.test_label_one_hot , 241 | verbose = self.config.config_namespace.evaluate_verbose 242 | ) 243 | 244 | print("Test loss: ", self.scores[0]) 245 | print("Test accuracy: ", self.scores[1]) 246 | 247 | return 248 | 249 | def predict(self): 250 | """ 251 | Predict the class labels of testing dataset. 252 | 253 | :param none 254 | :return none 255 | :raises none 256 | """ 257 | 258 | self.predictions = self.cnn_model.predict( x = self.dataset.test_data, 259 | verbose = self.config.config_namespace.predict_verbose 260 | ) 261 | 262 | return 263 | -------------------------------------------------------------------------------- /resources/architecture_diagrams/images-src/CNN_Main_ClassDiagram.mdj: -------------------------------------------------------------------------------- 1 | { 2 | "_type": "Project", 3 | "_id": "AAAAAAFF+h6SjaM2Hec=", 4 | "name": "Untitled", 5 | "ownedElements": [ 6 | { 7 | "_type": "UMLModel", 8 | "_id": "AAAAAAFF+qBWK6M3Z8Y=", 9 | "_parent": { 10 | "$ref": "AAAAAAFF+h6SjaM2Hec=" 11 | }, 12 | "name": "Model", 13 | "ownedElements": [ 14 | { 15 | "_type": "UMLClassDiagram", 16 | "_id": "AAAAAAFF+qBtyKM79qY=", 17 | "_parent": { 18 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 19 | }, 20 | "name": "Main", 21 | "visible": true, 22 | "defaultDiagram": true, 23 | "ownedViews": [ 24 | { 25 | "_type": "UMLClassView", 26 | "_id": "AAAAAAFi9wQOGEDbQu0=", 27 | "_parent": { 28 | "$ref": "AAAAAAFF+qBtyKM79qY=" 29 | }, 30 | "model": { 31 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 32 | }, 33 | "subViews": [ 34 | { 35 | "_type": "UMLNameCompartmentView", 36 | "_id": "AAAAAAFi9wQOGUDcMGE=", 37 | "_parent": { 38 | "$ref": "AAAAAAFi9wQOGEDbQu0=" 39 | }, 40 | "model": { 41 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 42 | }, 43 | "subViews": [ 44 | { 45 | "_type": "LabelView", 46 | "_id": "AAAAAAFi9wQOGUDdm/g=", 47 | "_parent": { 48 | "$ref": "AAAAAAFi9wQOGUDcMGE=" 49 | }, 50 | "visible": false, 51 | "enabled": true, 52 | "lineColor": "#000000", 53 | "fillColor": "#ffffff", 54 | "fontColor": "#000000", 55 | "font": "Arial;13;0", 56 | "showShadow": true, 57 | "containerChangeable": false, 58 | "containerExtending": false, 59 | "left": 64, 60 | "top": 0, 61 | "width": 0, 62 | "height": 13, 63 | "autoResize": false, 64 | "underline": false, 65 | "horizontalAlignment": 2, 66 | "verticalAlignment": 5, 67 | "wordWrap": false 68 | }, 69 | { 70 | "_type": "LabelView", 71 | "_id": "AAAAAAFi9wQOGUDeFTw=", 72 | "_parent": { 73 | "$ref": "AAAAAAFi9wQOGUDcMGE=" 74 | }, 75 | "visible": true, 76 | "enabled": true, 77 | "lineColor": "#000000", 78 | "fillColor": "#ffffff", 79 | "fontColor": "#000000", 80 | "font": "Arial;13;1", 81 | "showShadow": true, 82 | "containerChangeable": false, 83 | "containerExtending": false, 84 | "left": 117, 85 | "top": 87, 86 | "width": 214, 87 | "height": 13, 88 | "autoResize": false, 89 | "underline": false, 90 | "text": "Main", 91 | "horizontalAlignment": 2, 92 | "verticalAlignment": 5, 93 | "wordWrap": false 94 | }, 95 | { 96 | "_type": "LabelView", 97 | "_id": "AAAAAAFi9wQOGUDfggI=", 98 | "_parent": { 99 | "$ref": "AAAAAAFi9wQOGUDcMGE=" 100 | }, 101 | "visible": false, 102 | "enabled": true, 103 | "lineColor": "#000000", 104 | "fillColor": "#ffffff", 105 | "fontColor": "#000000", 106 | "font": "Arial;13;0", 107 | "showShadow": true, 108 | "containerChangeable": false, 109 | "containerExtending": false, 110 | "left": -99, 111 | "top": -34, 112 | "width": 214, 113 | "height": 13, 114 | "autoResize": false, 115 | "underline": false, 116 | "text": "(from Model)", 117 | "horizontalAlignment": 2, 118 | "verticalAlignment": 5, 119 | "wordWrap": false 120 | }, 121 | { 122 | "_type": "LabelView", 123 | "_id": "AAAAAAFi9wQOGUDgkmM=", 124 | "_parent": { 125 | "$ref": "AAAAAAFi9wQOGUDcMGE=" 126 | }, 127 | "visible": false, 128 | "enabled": true, 129 | "lineColor": "#000000", 130 | "fillColor": "#ffffff", 131 | "fontColor": "#000000", 132 | "font": "Arial;13;0", 133 | "showShadow": true, 134 | "containerChangeable": false, 135 | "containerExtending": false, 136 | "left": 64, 137 | "top": 0, 138 | "width": 0, 139 | "height": 13, 140 | "autoResize": false, 141 | "underline": false, 142 | "horizontalAlignment": 1, 143 | "verticalAlignment": 5, 144 | "wordWrap": false 145 | } 146 | ], 147 | "visible": true, 148 | "enabled": true, 149 | "lineColor": "#000000", 150 | "fillColor": "#ffffff", 151 | "fontColor": "#000000", 152 | "font": "Arial;13;0", 153 | "showShadow": true, 154 | "containerChangeable": false, 155 | "containerExtending": false, 156 | "left": 112, 157 | "top": 80, 158 | "width": 224, 159 | "height": 25, 160 | "autoResize": false, 161 | "stereotypeLabel": { 162 | "$ref": "AAAAAAFi9wQOGUDdm/g=" 163 | }, 164 | "nameLabel": { 165 | "$ref": "AAAAAAFi9wQOGUDeFTw=" 166 | }, 167 | "namespaceLabel": { 168 | "$ref": "AAAAAAFi9wQOGUDfggI=" 169 | }, 170 | "propertyLabel": { 171 | "$ref": "AAAAAAFi9wQOGUDgkmM=" 172 | } 173 | }, 174 | { 175 | "_type": "UMLAttributeCompartmentView", 176 | "_id": "AAAAAAFi9wQOGkDhWzs=", 177 | "_parent": { 178 | "$ref": "AAAAAAFi9wQOGEDbQu0=" 179 | }, 180 | "model": { 181 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 182 | }, 183 | "subViews": [ 184 | { 185 | "_type": "UMLAttributeView", 186 | "_id": "AAAAAAFi9wTmWUEOTXg=", 187 | "_parent": { 188 | "$ref": "AAAAAAFi9wQOGkDhWzs=" 189 | }, 190 | "model": { 191 | "$ref": "AAAAAAFi9wTmBEELT88=" 192 | }, 193 | "visible": true, 194 | "enabled": true, 195 | "lineColor": "#000000", 196 | "fillColor": "#ffffff", 197 | "fontColor": "#000000", 198 | "font": "Arial;13;0", 199 | "showShadow": true, 200 | "containerChangeable": false, 201 | "containerExtending": false, 202 | "left": 117, 203 | "top": 110, 204 | "width": 214, 205 | "height": 13, 206 | "autoResize": false, 207 | "underline": false, 208 | "text": "+args", 209 | "horizontalAlignment": 0, 210 | "verticalAlignment": 5, 211 | "wordWrap": false 212 | }, 213 | { 214 | "_type": "UMLAttributeView", 215 | "_id": "AAAAAAFi9whRNkEVvzQ=", 216 | "_parent": { 217 | "$ref": "AAAAAAFi9wQOGkDhWzs=" 218 | }, 219 | "model": { 220 | "$ref": "AAAAAAFi9whQt0ES1dE=" 221 | }, 222 | "visible": true, 223 | "enabled": true, 224 | "lineColor": "#000000", 225 | "fillColor": "#ffffff", 226 | "fontColor": "#000000", 227 | "font": "Arial;13;0", 228 | "showShadow": true, 229 | "containerChangeable": false, 230 | "containerExtending": false, 231 | "left": 117, 232 | "top": 125, 233 | "width": 214, 234 | "height": 13, 235 | "autoResize": false, 236 | "underline": false, 237 | "text": "+config", 238 | "horizontalAlignment": 0, 239 | "verticalAlignment": 5, 240 | "wordWrap": false 241 | }, 242 | { 243 | "_type": "UMLAttributeView", 244 | "_id": "AAAAAAFi9wiDK0Ec4HU=", 245 | "_parent": { 246 | "$ref": "AAAAAAFi9wQOGkDhWzs=" 247 | }, 248 | "model": { 249 | "$ref": "AAAAAAFi9wiC1EEZYAg=" 250 | }, 251 | "visible": true, 252 | "enabled": true, 253 | "lineColor": "#000000", 254 | "fillColor": "#ffffff", 255 | "fontColor": "#000000", 256 | "font": "Arial;13;0", 257 | "showShadow": true, 258 | "containerChangeable": false, 259 | "containerExtending": false, 260 | "left": 117, 261 | "top": 140, 262 | "width": 214, 263 | "height": 13, 264 | "autoResize": false, 265 | "underline": false, 266 | "text": "+dataset", 267 | "horizontalAlignment": 0, 268 | "verticalAlignment": 5, 269 | "wordWrap": false 270 | }, 271 | { 272 | "_type": "UMLAttributeView", 273 | "_id": "AAAAAAFjPVny3dDcVyo=", 274 | "_parent": { 275 | "$ref": "AAAAAAFi9wQOGkDhWzs=" 276 | }, 277 | "model": { 278 | "$ref": "AAAAAAFjPVnyjtDZM0k=" 279 | }, 280 | "visible": true, 281 | "enabled": true, 282 | "lineColor": "#000000", 283 | "fillColor": "#ffffff", 284 | "fontColor": "#000000", 285 | "font": "Arial;13;0", 286 | "showShadow": true, 287 | "containerChangeable": false, 288 | "containerExtending": false, 289 | "left": 117, 290 | "top": 155, 291 | "width": 214, 292 | "height": 13, 293 | "autoResize": false, 294 | "underline": false, 295 | "text": "+model", 296 | "horizontalAlignment": 0, 297 | "verticalAlignment": 5, 298 | "wordWrap": false 299 | }, 300 | { 301 | "_type": "UMLAttributeView", 302 | "_id": "AAAAAAFjPVpHtdDjhJU=", 303 | "_parent": { 304 | "$ref": "AAAAAAFi9wQOGkDhWzs=" 305 | }, 306 | "model": { 307 | "$ref": "AAAAAAFjPVpHbNDgL5s=" 308 | }, 309 | "visible": true, 310 | "enabled": true, 311 | "lineColor": "#000000", 312 | "fillColor": "#ffffff", 313 | "fontColor": "#000000", 314 | "font": "Arial;13;0", 315 | "showShadow": true, 316 | "containerChangeable": false, 317 | "containerExtending": false, 318 | "left": 117, 319 | "top": 170, 320 | "width": 214, 321 | "height": 13, 322 | "autoResize": false, 323 | "underline": false, 324 | "text": "+report", 325 | "horizontalAlignment": 0, 326 | "verticalAlignment": 5, 327 | "wordWrap": false 328 | } 329 | ], 330 | "visible": true, 331 | "enabled": true, 332 | "lineColor": "#000000", 333 | "fillColor": "#ffffff", 334 | "fontColor": "#000000", 335 | "font": "Arial;13;0", 336 | "showShadow": true, 337 | "containerChangeable": false, 338 | "containerExtending": false, 339 | "left": 112, 340 | "top": 105, 341 | "width": 224, 342 | "height": 83, 343 | "autoResize": false 344 | }, 345 | { 346 | "_type": "UMLOperationCompartmentView", 347 | "_id": "AAAAAAFi9wQOGkDiNpI=", 348 | "_parent": { 349 | "$ref": "AAAAAAFi9wQOGEDbQu0=" 350 | }, 351 | "model": { 352 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 353 | }, 354 | "subViews": [ 355 | { 356 | "_type": "UMLOperationView", 357 | "_id": "AAAAAAFi9wjHpkEkos0=", 358 | "_parent": { 359 | "$ref": "AAAAAAFi9wQOGkDiNpI=" 360 | }, 361 | "model": { 362 | "$ref": "AAAAAAFi9wjHQ0EhLm0=" 363 | }, 364 | "visible": true, 365 | "enabled": true, 366 | "lineColor": "#000000", 367 | "fillColor": "#ffffff", 368 | "fontColor": "#000000", 369 | "font": "Arial;13;0", 370 | "showShadow": true, 371 | "containerChangeable": false, 372 | "containerExtending": false, 373 | "left": 117, 374 | "top": 193, 375 | "width": 214, 376 | "height": 13, 377 | "autoResize": false, 378 | "underline": false, 379 | "text": "+load_dataset()", 380 | "horizontalAlignment": 0, 381 | "verticalAlignment": 5, 382 | "wordWrap": false 383 | }, 384 | { 385 | "_type": "UMLOperationView", 386 | "_id": "AAAAAAFi9w90EUEttXo=", 387 | "_parent": { 388 | "$ref": "AAAAAAFi9wQOGkDiNpI=" 389 | }, 390 | "model": { 391 | "$ref": "AAAAAAFi9w9zk0EqCwU=" 392 | }, 393 | "visible": true, 394 | "enabled": true, 395 | "lineColor": "#000000", 396 | "fillColor": "#ffffff", 397 | "fontColor": "#000000", 398 | "font": "Arial;13;0", 399 | "showShadow": true, 400 | "containerChangeable": false, 401 | "containerExtending": false, 402 | "left": 117, 403 | "top": 208, 404 | "width": 214, 405 | "height": 13, 406 | "autoResize": false, 407 | "underline": false, 408 | "text": "+build_model()", 409 | "horizontalAlignment": 0, 410 | "verticalAlignment": 5, 411 | "wordWrap": false 412 | }, 413 | { 414 | "_type": "UMLOperationView", 415 | "_id": "AAAAAAFi9w/eHEE2pD8=", 416 | "_parent": { 417 | "$ref": "AAAAAAFi9wQOGkDiNpI=" 418 | }, 419 | "model": { 420 | "$ref": "AAAAAAFi9w/dw0Eze58=" 421 | }, 422 | "visible": true, 423 | "enabled": true, 424 | "lineColor": "#000000", 425 | "fillColor": "#ffffff", 426 | "fontColor": "#000000", 427 | "font": "Arial;13;0", 428 | "showShadow": true, 429 | "containerChangeable": false, 430 | "containerExtending": false, 431 | "left": 117, 432 | "top": 223, 433 | "width": 214, 434 | "height": 13, 435 | "autoResize": false, 436 | "underline": false, 437 | "text": "+Report_experimental_results()", 438 | "horizontalAlignment": 0, 439 | "verticalAlignment": 5, 440 | "wordWrap": false 441 | } 442 | ], 443 | "visible": true, 444 | "enabled": true, 445 | "lineColor": "#000000", 446 | "fillColor": "#ffffff", 447 | "fontColor": "#000000", 448 | "font": "Arial;13;0", 449 | "showShadow": true, 450 | "containerChangeable": false, 451 | "containerExtending": false, 452 | "left": 112, 453 | "top": 188, 454 | "width": 224, 455 | "height": 53, 456 | "autoResize": false 457 | }, 458 | { 459 | "_type": "UMLReceptionCompartmentView", 460 | "_id": "AAAAAAFi9wQOG0DjDzw=", 461 | "_parent": { 462 | "$ref": "AAAAAAFi9wQOGEDbQu0=" 463 | }, 464 | "model": { 465 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 466 | }, 467 | "visible": false, 468 | "enabled": true, 469 | "lineColor": "#000000", 470 | "fillColor": "#ffffff", 471 | "fontColor": "#000000", 472 | "font": "Arial;13;0", 473 | "showShadow": true, 474 | "containerChangeable": false, 475 | "containerExtending": false, 476 | "left": 112, 477 | "top": 226, 478 | "width": 224, 479 | "height": 10, 480 | "autoResize": false 481 | }, 482 | { 483 | "_type": "UMLTemplateParameterCompartmentView", 484 | "_id": "AAAAAAFi9wQOG0DkfyM=", 485 | "_parent": { 486 | "$ref": "AAAAAAFi9wQOGEDbQu0=" 487 | }, 488 | "model": { 489 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 490 | }, 491 | "visible": false, 492 | "enabled": true, 493 | "lineColor": "#000000", 494 | "fillColor": "#ffffff", 495 | "fontColor": "#000000", 496 | "font": "Arial;13;0", 497 | "showShadow": true, 498 | "containerChangeable": false, 499 | "containerExtending": false, 500 | "left": 32, 501 | "top": 0, 502 | "width": 10, 503 | "height": 10, 504 | "autoResize": false 505 | } 506 | ], 507 | "visible": true, 508 | "enabled": true, 509 | "lineColor": "#000000", 510 | "fillColor": "#ffffff", 511 | "fontColor": "#000000", 512 | "font": "Arial;13;0", 513 | "showShadow": true, 514 | "containerChangeable": true, 515 | "containerExtending": false, 516 | "left": 112, 517 | "top": 80, 518 | "width": 224, 519 | "height": 176, 520 | "autoResize": false, 521 | "stereotypeDisplay": "label", 522 | "showVisibility": true, 523 | "showNamespace": false, 524 | "showProperty": true, 525 | "showType": true, 526 | "nameCompartment": { 527 | "$ref": "AAAAAAFi9wQOGUDcMGE=" 528 | }, 529 | "wordWrap": false, 530 | "suppressAttributes": false, 531 | "suppressOperations": false, 532 | "suppressReceptions": true, 533 | "showMultiplicity": true, 534 | "showOperationSignature": true, 535 | "attributeCompartment": { 536 | "$ref": "AAAAAAFi9wQOGkDhWzs=" 537 | }, 538 | "operationCompartment": { 539 | "$ref": "AAAAAAFi9wQOGkDiNpI=" 540 | }, 541 | "receptionCompartment": { 542 | "$ref": "AAAAAAFi9wQOG0DjDzw=" 543 | }, 544 | "templateParameterCompartment": { 545 | "$ref": "AAAAAAFi9wQOG0DkfyM=" 546 | } 547 | } 548 | ] 549 | }, 550 | { 551 | "_type": "UMLClass", 552 | "_id": "AAAAAAFi9wQOF0DZfgQ=", 553 | "_parent": { 554 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 555 | }, 556 | "name": "Main", 557 | "ownedElements": [ 558 | { 559 | "_type": "UMLAssociation", 560 | "_id": "AAAAAAFi9zfgG0YTtnQ=", 561 | "_parent": { 562 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 563 | }, 564 | "end1": { 565 | "_type": "UMLAssociationEnd", 566 | "_id": "AAAAAAFi9zfgG0YUSE8=", 567 | "_parent": { 568 | "$ref": "AAAAAAFi9zfgG0YTtnQ=" 569 | }, 570 | "reference": { 571 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 572 | }, 573 | "visibility": "public", 574 | "navigable": false, 575 | "aggregation": "none", 576 | "isReadOnly": false, 577 | "isOrdered": false, 578 | "isUnique": false, 579 | "isDerived": false, 580 | "isID": false 581 | }, 582 | "end2": { 583 | "_type": "UMLAssociationEnd", 584 | "_id": "AAAAAAFi9zfgG0YVJEs=", 585 | "_parent": { 586 | "$ref": "AAAAAAFi9zfgG0YTtnQ=" 587 | }, 588 | "reference": { 589 | "$ref": "AAAAAAFi9yBjG0IejZg=" 590 | }, 591 | "visibility": "public", 592 | "navigable": true, 593 | "aggregation": "none", 594 | "isReadOnly": false, 595 | "isOrdered": false, 596 | "isUnique": false, 597 | "isDerived": false, 598 | "isID": false 599 | }, 600 | "visibility": "public", 601 | "isDerived": false 602 | }, 603 | { 604 | "_type": "UMLAssociation", 605 | "_id": "AAAAAAFi9zjGQkbgM3A=", 606 | "_parent": { 607 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 608 | }, 609 | "end1": { 610 | "_type": "UMLAssociationEnd", 611 | "_id": "AAAAAAFi9zjGQkbhngo=", 612 | "_parent": { 613 | "$ref": "AAAAAAFi9zjGQkbgM3A=" 614 | }, 615 | "reference": { 616 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 617 | }, 618 | "visibility": "public", 619 | "navigable": false, 620 | "aggregation": "none", 621 | "isReadOnly": false, 622 | "isOrdered": false, 623 | "isUnique": false, 624 | "isDerived": false, 625 | "isID": false 626 | }, 627 | "end2": { 628 | "_type": "UMLAssociationEnd", 629 | "_id": "AAAAAAFi9zjGQkbiYAA=", 630 | "_parent": { 631 | "$ref": "AAAAAAFi9zjGQkbgM3A=" 632 | }, 633 | "reference": { 634 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 635 | }, 636 | "visibility": "public", 637 | "navigable": true, 638 | "aggregation": "none", 639 | "isReadOnly": false, 640 | "isOrdered": false, 641 | "isUnique": false, 642 | "isDerived": false, 643 | "isID": false 644 | }, 645 | "visibility": "public", 646 | "isDerived": false 647 | }, 648 | { 649 | "_type": "UMLAssociation", 650 | "_id": "AAAAAAFi9zkJykcyxzU=", 651 | "_parent": { 652 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 653 | }, 654 | "end1": { 655 | "_type": "UMLAssociationEnd", 656 | "_id": "AAAAAAFi9zkJykcz2Pk=", 657 | "_parent": { 658 | "$ref": "AAAAAAFi9zkJykcyxzU=" 659 | }, 660 | "reference": { 661 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 662 | }, 663 | "visibility": "public", 664 | "navigable": false, 665 | "aggregation": "none", 666 | "isReadOnly": false, 667 | "isOrdered": false, 668 | "isUnique": false, 669 | "isDerived": false, 670 | "isID": false 671 | }, 672 | "end2": { 673 | "_type": "UMLAssociationEnd", 674 | "_id": "AAAAAAFi9zkJykc0Y6w=", 675 | "_parent": { 676 | "$ref": "AAAAAAFi9zkJykcyxzU=" 677 | }, 678 | "reference": { 679 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 680 | }, 681 | "visibility": "public", 682 | "navigable": true, 683 | "aggregation": "none", 684 | "isReadOnly": false, 685 | "isOrdered": false, 686 | "isUnique": false, 687 | "isDerived": false, 688 | "isID": false 689 | }, 690 | "visibility": "public", 691 | "isDerived": false 692 | } 693 | ], 694 | "visibility": "public", 695 | "attributes": [ 696 | { 697 | "_type": "UMLAttribute", 698 | "_id": "AAAAAAFi9wTmBEELT88=", 699 | "_parent": { 700 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 701 | }, 702 | "name": "args", 703 | "visibility": "public", 704 | "isStatic": false, 705 | "isLeaf": false, 706 | "type": "", 707 | "isReadOnly": false, 708 | "isOrdered": false, 709 | "isUnique": false, 710 | "isDerived": false, 711 | "aggregation": "none", 712 | "isID": false 713 | }, 714 | { 715 | "_type": "UMLAttribute", 716 | "_id": "AAAAAAFi9whQt0ES1dE=", 717 | "_parent": { 718 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 719 | }, 720 | "name": "config", 721 | "visibility": "public", 722 | "isStatic": false, 723 | "isLeaf": false, 724 | "type": "", 725 | "isReadOnly": false, 726 | "isOrdered": false, 727 | "isUnique": false, 728 | "isDerived": false, 729 | "aggregation": "none", 730 | "isID": false 731 | }, 732 | { 733 | "_type": "UMLAttribute", 734 | "_id": "AAAAAAFi9wiC1EEZYAg=", 735 | "_parent": { 736 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 737 | }, 738 | "name": "dataset", 739 | "visibility": "public", 740 | "isStatic": false, 741 | "isLeaf": false, 742 | "type": "", 743 | "isReadOnly": false, 744 | "isOrdered": false, 745 | "isUnique": false, 746 | "isDerived": false, 747 | "aggregation": "none", 748 | "isID": false 749 | }, 750 | { 751 | "_type": "UMLAttribute", 752 | "_id": "AAAAAAFjPVnyjtDZM0k=", 753 | "_parent": { 754 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 755 | }, 756 | "name": "model", 757 | "visibility": "public", 758 | "isStatic": false, 759 | "isLeaf": false, 760 | "type": "", 761 | "isReadOnly": false, 762 | "isOrdered": false, 763 | "isUnique": false, 764 | "isDerived": false, 765 | "aggregation": "none", 766 | "isID": false 767 | }, 768 | { 769 | "_type": "UMLAttribute", 770 | "_id": "AAAAAAFjPVpHbNDgL5s=", 771 | "_parent": { 772 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 773 | }, 774 | "name": "report", 775 | "visibility": "public", 776 | "isStatic": false, 777 | "isLeaf": false, 778 | "type": "", 779 | "isReadOnly": false, 780 | "isOrdered": false, 781 | "isUnique": false, 782 | "isDerived": false, 783 | "aggregation": "none", 784 | "isID": false 785 | } 786 | ], 787 | "operations": [ 788 | { 789 | "_type": "UMLOperation", 790 | "_id": "AAAAAAFi9wjHQ0EhLm0=", 791 | "_parent": { 792 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 793 | }, 794 | "name": "load_dataset", 795 | "visibility": "public", 796 | "isStatic": false, 797 | "isLeaf": false, 798 | "concurrency": "sequential", 799 | "isQuery": false, 800 | "isAbstract": false 801 | }, 802 | { 803 | "_type": "UMLOperation", 804 | "_id": "AAAAAAFi9w9zk0EqCwU=", 805 | "_parent": { 806 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 807 | }, 808 | "name": "build_model", 809 | "visibility": "public", 810 | "isStatic": false, 811 | "isLeaf": false, 812 | "concurrency": "sequential", 813 | "isQuery": false, 814 | "isAbstract": false 815 | }, 816 | { 817 | "_type": "UMLOperation", 818 | "_id": "AAAAAAFi9w/dw0Eze58=", 819 | "_parent": { 820 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 821 | }, 822 | "name": "Report_experimental_results", 823 | "visibility": "public", 824 | "isStatic": false, 825 | "isLeaf": false, 826 | "concurrency": "sequential", 827 | "isQuery": false, 828 | "isAbstract": false 829 | } 830 | ], 831 | "isAbstract": false, 832 | "isFinalSpecialization": false, 833 | "isLeaf": false, 834 | "isActive": false 835 | }, 836 | { 837 | "_type": "UMLClass", 838 | "_id": "AAAAAAFi9xUuKEFFXH4=", 839 | "_parent": { 840 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 841 | }, 842 | "name": "ConfigurationParameters", 843 | "visibility": "public", 844 | "attributes": [ 845 | { 846 | "_type": "UMLAttribute", 847 | "_id": "AAAAAAFi9xWzf0FvGdo=", 848 | "_parent": { 849 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 850 | }, 851 | "name": "config_file", 852 | "visibility": "public", 853 | "isStatic": false, 854 | "isLeaf": false, 855 | "type": "", 856 | "isReadOnly": false, 857 | "isOrdered": false, 858 | "isUnique": false, 859 | "isDerived": false, 860 | "aggregation": "none", 861 | "isID": false 862 | }, 863 | { 864 | "_type": "UMLAttribute", 865 | "_id": "AAAAAAFi9xXXhkF2Qu8=", 866 | "_parent": { 867 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 868 | }, 869 | "name": "config_dictionary", 870 | "visibility": "public", 871 | "isStatic": false, 872 | "isLeaf": false, 873 | "type": "", 874 | "isReadOnly": false, 875 | "isOrdered": false, 876 | "isUnique": false, 877 | "isDerived": false, 878 | "aggregation": "none", 879 | "isID": false 880 | }, 881 | { 882 | "_type": "UMLAttribute", 883 | "_id": "AAAAAAFi9xYcIUF9WdI=", 884 | "_parent": { 885 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 886 | }, 887 | "name": "config_namespace", 888 | "visibility": "public", 889 | "isStatic": false, 890 | "isLeaf": false, 891 | "type": "", 892 | "isReadOnly": false, 893 | "isOrdered": false, 894 | "isUnique": false, 895 | "isDerived": false, 896 | "aggregation": "none", 897 | "isID": false 898 | } 899 | ], 900 | "operations": [ 901 | { 902 | "_type": "UMLOperation", 903 | "_id": "AAAAAAFi9xZTDEGEx/0=", 904 | "_parent": { 905 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 906 | }, 907 | "name": "load", 908 | "visibility": "public", 909 | "isStatic": false, 910 | "isLeaf": false, 911 | "parameters": [ 912 | { 913 | "_type": "UMLParameter", 914 | "_id": "AAAAAAFi9xbrOUGL5uI=", 915 | "_parent": { 916 | "$ref": "AAAAAAFi9xZTDEGEx/0=" 917 | }, 918 | "name": "config_file", 919 | "visibility": "public", 920 | "isStatic": false, 921 | "isLeaf": false, 922 | "type": "", 923 | "isReadOnly": false, 924 | "isOrdered": false, 925 | "isUnique": false, 926 | "direction": "in" 927 | } 928 | ], 929 | "concurrency": "sequential", 930 | "isQuery": false, 931 | "isAbstract": false 932 | }, 933 | { 934 | "_type": "UMLOperation", 935 | "_id": "AAAAAAFi9xbsq0GNwqg=", 936 | "_parent": { 937 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 938 | }, 939 | "name": "Bunch", 940 | "visibility": "public", 941 | "isStatic": false, 942 | "isLeaf": false, 943 | "parameters": [ 944 | { 945 | "_type": "UMLParameter", 946 | "_id": "AAAAAAFi9xjKBEGUJWU=", 947 | "_parent": { 948 | "$ref": "AAAAAAFi9xbsq0GNwqg=" 949 | }, 950 | "name": "self.config_dictionary", 951 | "visibility": "public", 952 | "isStatic": false, 953 | "isLeaf": false, 954 | "type": "", 955 | "isReadOnly": false, 956 | "isOrdered": false, 957 | "isUnique": false, 958 | "direction": "in" 959 | } 960 | ], 961 | "concurrency": "sequential", 962 | "isQuery": false, 963 | "isAbstract": false 964 | } 965 | ], 966 | "isAbstract": false, 967 | "isFinalSpecialization": false, 968 | "isLeaf": false, 969 | "isActive": false 970 | }, 971 | { 972 | "_type": "UMLClass", 973 | "_id": "AAAAAAFi9xjWs0GW8JM=", 974 | "_parent": { 975 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 976 | }, 977 | "name": "DataLoader", 978 | "ownedElements": [ 979 | { 980 | "_type": "UMLGeneralization", 981 | "_id": "AAAAAAFi9zWCjEVi/3A=", 982 | "_parent": { 983 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 984 | }, 985 | "source": { 986 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 987 | }, 988 | "target": { 989 | "$ref": "AAAAAAFi9yBjG0IejZg=" 990 | }, 991 | "visibility": "public" 992 | }, 993 | { 994 | "_type": "UMLAssociation", 995 | "_id": "AAAAAAFi9zeig0W4V7g=", 996 | "_parent": { 997 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 998 | }, 999 | "end1": { 1000 | "_type": "UMLAssociationEnd", 1001 | "_id": "AAAAAAFi9zeihEW50E0=", 1002 | "_parent": { 1003 | "$ref": "AAAAAAFi9zeig0W4V7g=" 1004 | }, 1005 | "reference": { 1006 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1007 | }, 1008 | "visibility": "public", 1009 | "navigable": false, 1010 | "aggregation": "none", 1011 | "isReadOnly": false, 1012 | "isOrdered": false, 1013 | "isUnique": false, 1014 | "isDerived": false, 1015 | "isID": false 1016 | }, 1017 | "end2": { 1018 | "_type": "UMLAssociationEnd", 1019 | "_id": "AAAAAAFi9zeihEW6I7o=", 1020 | "_parent": { 1021 | "$ref": "AAAAAAFi9zeig0W4V7g=" 1022 | }, 1023 | "reference": { 1024 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1025 | }, 1026 | "visibility": "public", 1027 | "navigable": true, 1028 | "aggregation": "none", 1029 | "isReadOnly": false, 1030 | "isOrdered": false, 1031 | "isUnique": false, 1032 | "isDerived": false, 1033 | "isID": false 1034 | }, 1035 | "visibility": "public", 1036 | "isDerived": false 1037 | } 1038 | ], 1039 | "visibility": "public", 1040 | "attributes": [ 1041 | { 1042 | "_type": "UMLAttribute", 1043 | "_id": "AAAAAAFi9xp9qkHAEng=", 1044 | "_parent": { 1045 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1046 | }, 1047 | "name": "config", 1048 | "visibility": "public", 1049 | "isStatic": false, 1050 | "isLeaf": false, 1051 | "type": "", 1052 | "isReadOnly": false, 1053 | "isOrdered": false, 1054 | "isUnique": false, 1055 | "isDerived": false, 1056 | "aggregation": "none", 1057 | "isID": false 1058 | }, 1059 | { 1060 | "_type": "UMLAttribute", 1061 | "_id": "AAAAAAFi9xuGckHHDWc=", 1062 | "_parent": { 1063 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1064 | }, 1065 | "name": "train_data", 1066 | "visibility": "public", 1067 | "isStatic": false, 1068 | "isLeaf": false, 1069 | "type": "", 1070 | "isReadOnly": false, 1071 | "isOrdered": false, 1072 | "isUnique": false, 1073 | "isDerived": false, 1074 | "aggregation": "none", 1075 | "isID": false 1076 | }, 1077 | { 1078 | "_type": "UMLAttribute", 1079 | "_id": "AAAAAAFi9xuMQUHN5bw=", 1080 | "_parent": { 1081 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1082 | }, 1083 | "name": "train_labels", 1084 | "visibility": "public", 1085 | "isStatic": false, 1086 | "isLeaf": false, 1087 | "type": "", 1088 | "isReadOnly": false, 1089 | "isOrdered": false, 1090 | "isUnique": false, 1091 | "isDerived": false, 1092 | "aggregation": "none", 1093 | "isID": false 1094 | }, 1095 | { 1096 | "_type": "UMLAttribute", 1097 | "_id": "AAAAAAFi9xuRKEHTR3k=", 1098 | "_parent": { 1099 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1100 | }, 1101 | "name": "test_data", 1102 | "visibility": "public", 1103 | "isStatic": false, 1104 | "isLeaf": false, 1105 | "type": "", 1106 | "isReadOnly": false, 1107 | "isOrdered": false, 1108 | "isUnique": false, 1109 | "isDerived": false, 1110 | "aggregation": "none", 1111 | "isID": false 1112 | }, 1113 | { 1114 | "_type": "UMLAttribute", 1115 | "_id": "AAAAAAFi9xuWkUHZCmQ=", 1116 | "_parent": { 1117 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1118 | }, 1119 | "name": "test_labels", 1120 | "visibility": "public", 1121 | "isStatic": false, 1122 | "isLeaf": false, 1123 | "type": "", 1124 | "isReadOnly": false, 1125 | "isOrdered": false, 1126 | "isUnique": false, 1127 | "isDerived": false, 1128 | "aggregation": "none", 1129 | "isID": false 1130 | }, 1131 | { 1132 | "_type": "UMLAttribute", 1133 | "_id": "AAAAAAFi9xubkUHfEwU=", 1134 | "_parent": { 1135 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1136 | }, 1137 | "name": "no_of_classes", 1138 | "visibility": "public", 1139 | "isStatic": false, 1140 | "isLeaf": false, 1141 | "type": "", 1142 | "isReadOnly": false, 1143 | "isOrdered": false, 1144 | "isUnique": false, 1145 | "isDerived": false, 1146 | "aggregation": "none", 1147 | "isID": false 1148 | }, 1149 | { 1150 | "_type": "UMLAttribute", 1151 | "_id": "AAAAAAFi9x1aTkHuL1Q=", 1152 | "_parent": { 1153 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1154 | }, 1155 | "name": "list_of_classes", 1156 | "visibility": "public", 1157 | "isStatic": false, 1158 | "isLeaf": false, 1159 | "type": "", 1160 | "isReadOnly": false, 1161 | "isOrdered": false, 1162 | "isUnique": false, 1163 | "isDerived": false, 1164 | "aggregation": "none", 1165 | "isID": false 1166 | } 1167 | ], 1168 | "operations": [ 1169 | { 1170 | "_type": "UMLOperation", 1171 | "_id": "AAAAAAFi9x2HmUH1q10=", 1172 | "_parent": { 1173 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1174 | }, 1175 | "name": "load_dataset", 1176 | "visibility": "public", 1177 | "isStatic": false, 1178 | "isLeaf": false, 1179 | "concurrency": "sequential", 1180 | "isQuery": false, 1181 | "isAbstract": false 1182 | }, 1183 | { 1184 | "_type": "UMLOperation", 1185 | "_id": "AAAAAAFi9x3y7UH8VGY=", 1186 | "_parent": { 1187 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1188 | }, 1189 | "name": "calculate_class_label_size", 1190 | "visibility": "public", 1191 | "isStatic": false, 1192 | "isLeaf": false, 1193 | "concurrency": "sequential", 1194 | "isQuery": false, 1195 | "isAbstract": false 1196 | }, 1197 | { 1198 | "_type": "UMLOperation", 1199 | "_id": "AAAAAAFi9x33n0ICtmI=", 1200 | "_parent": { 1201 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1202 | }, 1203 | "name": "pirnt_dataset_details", 1204 | "visibility": "public", 1205 | "isStatic": false, 1206 | "isLeaf": false, 1207 | "concurrency": "sequential", 1208 | "isQuery": false, 1209 | "isAbstract": false 1210 | }, 1211 | { 1212 | "_type": "UMLOperation", 1213 | "_id": "AAAAAAFi9x4A8UIIrkQ=", 1214 | "_parent": { 1215 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1216 | }, 1217 | "name": "preprocess_dataset", 1218 | "visibility": "public", 1219 | "isStatic": false, 1220 | "isLeaf": false, 1221 | "concurrency": "sequential", 1222 | "isQuery": false, 1223 | "isAbstract": false 1224 | }, 1225 | { 1226 | "_type": "UMLOperation", 1227 | "_id": "AAAAAAFi9x6DUUIRUag=", 1228 | "_parent": { 1229 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1230 | }, 1231 | "name": "display_data_element", 1232 | "visibility": "public", 1233 | "isStatic": false, 1234 | "isLeaf": false, 1235 | "parameters": [ 1236 | { 1237 | "_type": "UMLParameter", 1238 | "_id": "AAAAAAFi9x7jhEIYOzo=", 1239 | "_parent": { 1240 | "$ref": "AAAAAAFi9x6DUUIRUag=" 1241 | }, 1242 | "name": "self", 1243 | "visibility": "public", 1244 | "isStatic": false, 1245 | "isLeaf": false, 1246 | "type": "", 1247 | "isReadOnly": false, 1248 | "isOrdered": false, 1249 | "isUnique": false, 1250 | "direction": "in" 1251 | }, 1252 | { 1253 | "_type": "UMLParameter", 1254 | "_id": "AAAAAAFi9x7jhEIZsIY=", 1255 | "_parent": { 1256 | "$ref": "AAAAAAFi9x6DUUIRUag=" 1257 | }, 1258 | "name": "whichData", 1259 | "visibility": "public", 1260 | "isStatic": false, 1261 | "isLeaf": false, 1262 | "type": "", 1263 | "isReadOnly": false, 1264 | "isOrdered": false, 1265 | "isUnique": false, 1266 | "direction": "in" 1267 | }, 1268 | { 1269 | "_type": "UMLParameter", 1270 | "_id": "AAAAAAFi9x7jhEIai3E=", 1271 | "_parent": { 1272 | "$ref": "AAAAAAFi9x6DUUIRUag=" 1273 | }, 1274 | "name": "index", 1275 | "visibility": "public", 1276 | "isStatic": false, 1277 | "isLeaf": false, 1278 | "type": "", 1279 | "isReadOnly": false, 1280 | "isOrdered": false, 1281 | "isUnique": false, 1282 | "direction": "in" 1283 | } 1284 | ], 1285 | "concurrency": "sequential", 1286 | "isQuery": false, 1287 | "isAbstract": false 1288 | } 1289 | ], 1290 | "isAbstract": false, 1291 | "isFinalSpecialization": false, 1292 | "isLeaf": false, 1293 | "isActive": false 1294 | }, 1295 | { 1296 | "_type": "UMLClass", 1297 | "_id": "AAAAAAFi9yBjG0IejZg=", 1298 | "_parent": { 1299 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 1300 | }, 1301 | "name": "FashionMnistLoader", 1302 | "ownedElements": [ 1303 | { 1304 | "_type": "UMLGeneralization", 1305 | "_id": "AAAAAAFi9zXxG0V7jXI=", 1306 | "_parent": { 1307 | "$ref": "AAAAAAFi9yBjG0IejZg=" 1308 | }, 1309 | "name": "Inherit DataLoader", 1310 | "source": { 1311 | "$ref": "AAAAAAFi9yBjG0IejZg=" 1312 | }, 1313 | "target": { 1314 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1315 | }, 1316 | "visibility": "public" 1317 | } 1318 | ], 1319 | "visibility": "public", 1320 | "operations": [ 1321 | { 1322 | "_type": "UMLOperation", 1323 | "_id": "AAAAAAFi9yGBfkJJvzk=", 1324 | "_parent": { 1325 | "$ref": "AAAAAAFi9yBjG0IejZg=" 1326 | }, 1327 | "name": "load_dataset", 1328 | "visibility": "public", 1329 | "isStatic": false, 1330 | "isLeaf": false, 1331 | "concurrency": "sequential", 1332 | "isQuery": false, 1333 | "isAbstract": false 1334 | }, 1335 | { 1336 | "_type": "UMLOperation", 1337 | "_id": "AAAAAAFi9yHJ0EJQJ4s=", 1338 | "_parent": { 1339 | "$ref": "AAAAAAFi9yBjG0IejZg=" 1340 | }, 1341 | "name": "display_data_element", 1342 | "visibility": "public", 1343 | "isStatic": false, 1344 | "isLeaf": false, 1345 | "parameters": [ 1346 | { 1347 | "_type": "UMLParameter", 1348 | "_id": "AAAAAAFi9yIRFEJYdfI=", 1349 | "_parent": { 1350 | "$ref": "AAAAAAFi9yHJ0EJQJ4s=" 1351 | }, 1352 | "name": "self", 1353 | "visibility": "public", 1354 | "isStatic": false, 1355 | "isLeaf": false, 1356 | "type": "", 1357 | "isReadOnly": false, 1358 | "isOrdered": false, 1359 | "isUnique": false, 1360 | "direction": "in" 1361 | }, 1362 | { 1363 | "_type": "UMLParameter", 1364 | "_id": "AAAAAAFi9yIRFEJZsFs=", 1365 | "_parent": { 1366 | "$ref": "AAAAAAFi9yHJ0EJQJ4s=" 1367 | }, 1368 | "name": "whichData", 1369 | "visibility": "public", 1370 | "isStatic": false, 1371 | "isLeaf": false, 1372 | "type": "", 1373 | "isReadOnly": false, 1374 | "isOrdered": false, 1375 | "isUnique": false, 1376 | "direction": "in" 1377 | }, 1378 | { 1379 | "_type": "UMLParameter", 1380 | "_id": "AAAAAAFi9yIRFEJaM3Q=", 1381 | "_parent": { 1382 | "$ref": "AAAAAAFi9yHJ0EJQJ4s=" 1383 | }, 1384 | "name": "index", 1385 | "visibility": "public", 1386 | "isStatic": false, 1387 | "isLeaf": false, 1388 | "type": "", 1389 | "isReadOnly": false, 1390 | "isOrdered": false, 1391 | "isUnique": false, 1392 | "direction": "in" 1393 | } 1394 | ], 1395 | "concurrency": "sequential", 1396 | "isQuery": false, 1397 | "isAbstract": false 1398 | }, 1399 | { 1400 | "_type": "UMLOperation", 1401 | "_id": "AAAAAAFi9yJNdkJeMsU=", 1402 | "_parent": { 1403 | "$ref": "AAAAAAFi9yBjG0IejZg=" 1404 | }, 1405 | "name": "preprocess_dataset", 1406 | "visibility": "public", 1407 | "isStatic": false, 1408 | "isLeaf": false, 1409 | "concurrency": "sequential", 1410 | "isQuery": false, 1411 | "isAbstract": false 1412 | } 1413 | ], 1414 | "isAbstract": false, 1415 | "isFinalSpecialization": false, 1416 | "isLeaf": false, 1417 | "isActive": false 1418 | }, 1419 | { 1420 | "_type": "UMLClass", 1421 | "_id": "AAAAAAFi9yL3DkJqKA4=", 1422 | "_parent": { 1423 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 1424 | }, 1425 | "name": "BaseModel", 1426 | "visibility": "public", 1427 | "attributes": [ 1428 | { 1429 | "_type": "UMLAttribute", 1430 | "_id": "AAAAAAFi9yPgBkMNrss=", 1431 | "_parent": { 1432 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1433 | }, 1434 | "name": "config", 1435 | "visibility": "public", 1436 | "isStatic": false, 1437 | "isLeaf": false, 1438 | "type": "", 1439 | "isReadOnly": false, 1440 | "isOrdered": false, 1441 | "isUnique": false, 1442 | "isDerived": false, 1443 | "aggregation": "none", 1444 | "isID": false 1445 | }, 1446 | { 1447 | "_type": "UMLAttribute", 1448 | "_id": "AAAAAAFi9yQ1b0MXxPg=", 1449 | "_parent": { 1450 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1451 | }, 1452 | "name": "dataset", 1453 | "visibility": "public", 1454 | "isStatic": false, 1455 | "isLeaf": false, 1456 | "type": "", 1457 | "isReadOnly": false, 1458 | "isOrdered": false, 1459 | "isUnique": false, 1460 | "isDerived": false, 1461 | "aggregation": "none", 1462 | "isID": false 1463 | }, 1464 | { 1465 | "_type": "UMLAttribute", 1466 | "_id": "AAAAAAFi9yRsJ0MhB9w=", 1467 | "_parent": { 1468 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1469 | }, 1470 | "name": "history", 1471 | "visibility": "public", 1472 | "isStatic": false, 1473 | "isLeaf": false, 1474 | "type": "", 1475 | "isReadOnly": false, 1476 | "isOrdered": false, 1477 | "isUnique": false, 1478 | "isDerived": false, 1479 | "aggregation": "none", 1480 | "isID": false 1481 | }, 1482 | { 1483 | "_type": "UMLAttribute", 1484 | "_id": "AAAAAAFi9ySJuUMrUBY=", 1485 | "_parent": { 1486 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1487 | }, 1488 | "name": "scores", 1489 | "visibility": "public", 1490 | "isStatic": false, 1491 | "isLeaf": false, 1492 | "type": "", 1493 | "isReadOnly": false, 1494 | "isOrdered": false, 1495 | "isUnique": false, 1496 | "isDerived": false, 1497 | "aggregation": "none", 1498 | "isID": false 1499 | }, 1500 | { 1501 | "_type": "UMLAttribute", 1502 | "_id": "AAAAAAFi9ySlhUM1pyg=", 1503 | "_parent": { 1504 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1505 | }, 1506 | "name": "predictions", 1507 | "visibility": "public", 1508 | "isStatic": false, 1509 | "isLeaf": false, 1510 | "type": "", 1511 | "isReadOnly": false, 1512 | "isOrdered": false, 1513 | "isUnique": false, 1514 | "isDerived": false, 1515 | "aggregation": "none", 1516 | "isID": false 1517 | } 1518 | ], 1519 | "operations": [ 1520 | { 1521 | "_type": "UMLOperation", 1522 | "_id": "AAAAAAFi9yTmtEM/tBw=", 1523 | "_parent": { 1524 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1525 | }, 1526 | "name": "validateStride", 1527 | "visibility": "public", 1528 | "isStatic": false, 1529 | "isLeaf": false, 1530 | "concurrency": "sequential", 1531 | "isQuery": false, 1532 | "isAbstract": false 1533 | }, 1534 | { 1535 | "_type": "UMLOperation", 1536 | "_id": "AAAAAAFi9yUen0NJyDg=", 1537 | "_parent": { 1538 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1539 | }, 1540 | "name": "define_model", 1541 | "visibility": "public", 1542 | "isStatic": false, 1543 | "isLeaf": false, 1544 | "concurrency": "sequential", 1545 | "isQuery": false, 1546 | "isAbstract": false 1547 | }, 1548 | { 1549 | "_type": "UMLOperation", 1550 | "_id": "AAAAAAFi9yVK0kNTrDA=", 1551 | "_parent": { 1552 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1553 | }, 1554 | "name": "compile_model", 1555 | "visibility": "public", 1556 | "isStatic": false, 1557 | "isLeaf": false, 1558 | "concurrency": "sequential", 1559 | "isQuery": false, 1560 | "isAbstract": false 1561 | }, 1562 | { 1563 | "_type": "UMLOperation", 1564 | "_id": "AAAAAAFi9yVnFkNd1Ug=", 1565 | "_parent": { 1566 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1567 | }, 1568 | "name": "fit_model", 1569 | "visibility": "public", 1570 | "isStatic": false, 1571 | "isLeaf": false, 1572 | "concurrency": "sequential", 1573 | "isQuery": false, 1574 | "isAbstract": false 1575 | }, 1576 | { 1577 | "_type": "UMLOperation", 1578 | "_id": "AAAAAAFi9yWK3UNn1rU=", 1579 | "_parent": { 1580 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1581 | }, 1582 | "name": "evaluate_model", 1583 | "visibility": "public", 1584 | "isStatic": false, 1585 | "isLeaf": false, 1586 | "concurrency": "sequential", 1587 | "isQuery": false, 1588 | "isAbstract": false 1589 | }, 1590 | { 1591 | "_type": "UMLOperation", 1592 | "_id": "AAAAAAFi9yWpCkNx0u0=", 1593 | "_parent": { 1594 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1595 | }, 1596 | "name": "predict", 1597 | "visibility": "public", 1598 | "isStatic": false, 1599 | "isLeaf": false, 1600 | "concurrency": "sequential", 1601 | "isQuery": false, 1602 | "isAbstract": false 1603 | }, 1604 | { 1605 | "_type": "UMLOperation", 1606 | "_id": "AAAAAAFi9yZtTEN7A7E=", 1607 | "_parent": { 1608 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1609 | }, 1610 | "name": "save_model", 1611 | "visibility": "public", 1612 | "isStatic": false, 1613 | "isLeaf": false, 1614 | "concurrency": "sequential", 1615 | "isQuery": false, 1616 | "isAbstract": false 1617 | }, 1618 | { 1619 | "_type": "UMLOperation", 1620 | "_id": "AAAAAAFi9ya4oEOFMTI=", 1621 | "_parent": { 1622 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1623 | }, 1624 | "name": "load_model", 1625 | "visibility": "public", 1626 | "isStatic": false, 1627 | "isLeaf": false, 1628 | "concurrency": "sequential", 1629 | "isQuery": false, 1630 | "isAbstract": false 1631 | } 1632 | ], 1633 | "isAbstract": false, 1634 | "isFinalSpecialization": false, 1635 | "isLeaf": false, 1636 | "isActive": false 1637 | }, 1638 | { 1639 | "_type": "UMLClass", 1640 | "_id": "AAAAAAFi9ycm2kO+Rpo=", 1641 | "_parent": { 1642 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 1643 | }, 1644 | "name": "FashionMnistModel", 1645 | "ownedElements": [ 1646 | { 1647 | "_type": "UMLGeneralization", 1648 | "_id": "AAAAAAFi9zbL20WmMSY=", 1649 | "_parent": { 1650 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1651 | }, 1652 | "name": "Inherit BaseModel", 1653 | "source": { 1654 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1655 | }, 1656 | "target": { 1657 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1658 | }, 1659 | "visibility": "public" 1660 | } 1661 | ], 1662 | "visibility": "public", 1663 | "operations": [ 1664 | { 1665 | "_type": "UMLOperation", 1666 | "_id": "AAAAAAFi9yuQykSkkGo=", 1667 | "_parent": { 1668 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1669 | }, 1670 | "name": "define_model", 1671 | "visibility": "public", 1672 | "isStatic": false, 1673 | "isLeaf": false, 1674 | "concurrency": "sequential", 1675 | "isQuery": false, 1676 | "isAbstract": false 1677 | }, 1678 | { 1679 | "_type": "UMLOperation", 1680 | "_id": "AAAAAAFi9yxiuUUY+7U=", 1681 | "_parent": { 1682 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1683 | }, 1684 | "name": "compile_model", 1685 | "visibility": "public", 1686 | "isStatic": false, 1687 | "isLeaf": false, 1688 | "concurrency": "sequential", 1689 | "isQuery": false, 1690 | "isAbstract": false 1691 | }, 1692 | { 1693 | "_type": "UMLOperation", 1694 | "_id": "AAAAAAFi9y22RkUggtc=", 1695 | "_parent": { 1696 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1697 | }, 1698 | "name": "fit_model", 1699 | "visibility": "public", 1700 | "isStatic": false, 1701 | "isLeaf": false, 1702 | "concurrency": "sequential", 1703 | "isQuery": false, 1704 | "isAbstract": false 1705 | }, 1706 | { 1707 | "_type": "UMLOperation", 1708 | "_id": "AAAAAAFi9y4TxkUoyko=", 1709 | "_parent": { 1710 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1711 | }, 1712 | "name": "evaluate_model", 1713 | "visibility": "public", 1714 | "isStatic": false, 1715 | "isLeaf": false, 1716 | "concurrency": "sequential", 1717 | "isQuery": false, 1718 | "isAbstract": false 1719 | }, 1720 | { 1721 | "_type": "UMLOperation", 1722 | "_id": "AAAAAAFi9y4+A0Uve1Q=", 1723 | "_parent": { 1724 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1725 | }, 1726 | "name": "predict", 1727 | "visibility": "public", 1728 | "isStatic": false, 1729 | "isLeaf": false, 1730 | "concurrency": "sequential", 1731 | "isQuery": false, 1732 | "isAbstract": false 1733 | }, 1734 | { 1735 | "_type": "UMLOperation", 1736 | "_id": "AAAAAAFi9y5gqUU2Hx8=", 1737 | "_parent": { 1738 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1739 | }, 1740 | "name": "save_model", 1741 | "visibility": "public", 1742 | "isStatic": false, 1743 | "isLeaf": false, 1744 | "concurrency": "sequential", 1745 | "isQuery": false, 1746 | "isAbstract": false 1747 | }, 1748 | { 1749 | "_type": "UMLOperation", 1750 | "_id": "AAAAAAFi9y6EmkU9bw4=", 1751 | "_parent": { 1752 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1753 | }, 1754 | "name": "load_model", 1755 | "visibility": "public", 1756 | "isStatic": false, 1757 | "isLeaf": false, 1758 | "concurrency": "sequential", 1759 | "isQuery": false, 1760 | "isAbstract": false 1761 | } 1762 | ], 1763 | "isAbstract": false, 1764 | "isFinalSpecialization": false, 1765 | "isLeaf": false, 1766 | "isActive": false 1767 | } 1768 | ], 1769 | "visibility": "public" 1770 | } 1771 | ] 1772 | } -------------------------------------------------------------------------------- /resources/architecture_diagrams/images-src/DataLoader_classDiagram.mdj: -------------------------------------------------------------------------------- 1 | { 2 | "_type": "Project", 3 | "_id": "AAAAAAFF+h6SjaM2Hec=", 4 | "name": "Untitled", 5 | "ownedElements": [ 6 | { 7 | "_type": "UMLModel", 8 | "_id": "AAAAAAFF+qBWK6M3Z8Y=", 9 | "_parent": { 10 | "$ref": "AAAAAAFF+h6SjaM2Hec=" 11 | }, 12 | "name": "Model", 13 | "ownedElements": [ 14 | { 15 | "_type": "UMLClassDiagram", 16 | "_id": "AAAAAAFF+qBtyKM79qY=", 17 | "_parent": { 18 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 19 | }, 20 | "name": "Main", 21 | "visible": true, 22 | "defaultDiagram": true, 23 | "ownedViews": [ 24 | { 25 | "_type": "UMLClassView", 26 | "_id": "AAAAAAFi9xjWtUGYj70=", 27 | "_parent": { 28 | "$ref": "AAAAAAFF+qBtyKM79qY=" 29 | }, 30 | "model": { 31 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 32 | }, 33 | "subViews": [ 34 | { 35 | "_type": "UMLNameCompartmentView", 36 | "_id": "AAAAAAFi9xjWtUGZS/U=", 37 | "_parent": { 38 | "$ref": "AAAAAAFi9xjWtUGYj70=" 39 | }, 40 | "model": { 41 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 42 | }, 43 | "subViews": [ 44 | { 45 | "_type": "LabelView", 46 | "_id": "AAAAAAFi9xjWtkGaqRc=", 47 | "_parent": { 48 | "$ref": "AAAAAAFi9xjWtUGZS/U=" 49 | }, 50 | "visible": false, 51 | "enabled": true, 52 | "lineColor": "#000000", 53 | "fillColor": "#ffffff", 54 | "fontColor": "#000000", 55 | "font": "Arial;13;0", 56 | "showShadow": true, 57 | "containerChangeable": false, 58 | "containerExtending": false, 59 | "left": 256, 60 | "top": -336, 61 | "width": 0, 62 | "height": 13, 63 | "autoResize": false, 64 | "underline": false, 65 | "horizontalAlignment": 2, 66 | "verticalAlignment": 5, 67 | "wordWrap": false 68 | }, 69 | { 70 | "_type": "LabelView", 71 | "_id": "AAAAAAFi9xjWtkGbeSM=", 72 | "_parent": { 73 | "$ref": "AAAAAAFi9xjWtUGZS/U=" 74 | }, 75 | "visible": true, 76 | "enabled": true, 77 | "lineColor": "#000000", 78 | "fillColor": "#ffffff", 79 | "fontColor": "#000000", 80 | "font": "Arial;13;1", 81 | "showShadow": true, 82 | "containerChangeable": false, 83 | "containerExtending": false, 84 | "left": 293, 85 | "top": 135, 86 | "width": 274, 87 | "height": 13, 88 | "autoResize": false, 89 | "underline": false, 90 | "text": "DataLoader", 91 | "horizontalAlignment": 2, 92 | "verticalAlignment": 5, 93 | "wordWrap": false 94 | }, 95 | { 96 | "_type": "LabelView", 97 | "_id": "AAAAAAFi9xjWtkGcDYE=", 98 | "_parent": { 99 | "$ref": "AAAAAAFi9xjWtUGZS/U=" 100 | }, 101 | "visible": false, 102 | "enabled": true, 103 | "lineColor": "#000000", 104 | "fillColor": "#ffffff", 105 | "fontColor": "#000000", 106 | "font": "Arial;13;0", 107 | "showShadow": true, 108 | "containerChangeable": false, 109 | "containerExtending": false, 110 | "left": 573, 111 | "top": 94, 112 | "width": 259, 113 | "height": 13, 114 | "autoResize": false, 115 | "underline": false, 116 | "text": "(from Model)", 117 | "horizontalAlignment": 2, 118 | "verticalAlignment": 5, 119 | "wordWrap": false 120 | }, 121 | { 122 | "_type": "LabelView", 123 | "_id": "AAAAAAFi9xjWtkGdHqw=", 124 | "_parent": { 125 | "$ref": "AAAAAAFi9xjWtUGZS/U=" 126 | }, 127 | "visible": false, 128 | "enabled": true, 129 | "lineColor": "#000000", 130 | "fillColor": "#ffffff", 131 | "fontColor": "#000000", 132 | "font": "Arial;13;0", 133 | "showShadow": true, 134 | "containerChangeable": false, 135 | "containerExtending": false, 136 | "left": 256, 137 | "top": -336, 138 | "width": 0, 139 | "height": 13, 140 | "autoResize": false, 141 | "underline": false, 142 | "horizontalAlignment": 1, 143 | "verticalAlignment": 5, 144 | "wordWrap": false 145 | } 146 | ], 147 | "visible": true, 148 | "enabled": true, 149 | "lineColor": "#000000", 150 | "fillColor": "#ffffff", 151 | "fontColor": "#000000", 152 | "font": "Arial;13;0", 153 | "showShadow": true, 154 | "containerChangeable": false, 155 | "containerExtending": false, 156 | "left": 288, 157 | "top": 128, 158 | "width": 284, 159 | "height": 25, 160 | "autoResize": false, 161 | "stereotypeLabel": { 162 | "$ref": "AAAAAAFi9xjWtkGaqRc=" 163 | }, 164 | "nameLabel": { 165 | "$ref": "AAAAAAFi9xjWtkGbeSM=" 166 | }, 167 | "namespaceLabel": { 168 | "$ref": "AAAAAAFi9xjWtkGcDYE=" 169 | }, 170 | "propertyLabel": { 171 | "$ref": "AAAAAAFi9xjWtkGdHqw=" 172 | } 173 | }, 174 | { 175 | "_type": "UMLAttributeCompartmentView", 176 | "_id": "AAAAAAFi9xjWtkGeVvE=", 177 | "_parent": { 178 | "$ref": "AAAAAAFi9xjWtUGYj70=" 179 | }, 180 | "model": { 181 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 182 | }, 183 | "subViews": [ 184 | { 185 | "_type": "UMLAttributeView", 186 | "_id": "AAAAAAFi9xp+E0HDnaI=", 187 | "_parent": { 188 | "$ref": "AAAAAAFi9xjWtkGeVvE=" 189 | }, 190 | "model": { 191 | "$ref": "AAAAAAFi9xp9qkHAEng=" 192 | }, 193 | "visible": true, 194 | "enabled": true, 195 | "lineColor": "#000000", 196 | "fillColor": "#ffffff", 197 | "fontColor": "#000000", 198 | "font": "Arial;13;0", 199 | "showShadow": true, 200 | "containerChangeable": false, 201 | "containerExtending": false, 202 | "left": 293, 203 | "top": 158, 204 | "width": 274, 205 | "height": 13, 206 | "autoResize": false, 207 | "underline": false, 208 | "text": "+config", 209 | "horizontalAlignment": 0, 210 | "verticalAlignment": 5, 211 | "wordWrap": false 212 | }, 213 | { 214 | "_type": "UMLAttributeView", 215 | "_id": "AAAAAAFi9xuG0kHKTMA=", 216 | "_parent": { 217 | "$ref": "AAAAAAFi9xjWtkGeVvE=" 218 | }, 219 | "model": { 220 | "$ref": "AAAAAAFi9xuGckHHDWc=" 221 | }, 222 | "visible": true, 223 | "enabled": true, 224 | "lineColor": "#000000", 225 | "fillColor": "#ffffff", 226 | "fontColor": "#000000", 227 | "font": "Arial;13;0", 228 | "showShadow": true, 229 | "containerChangeable": false, 230 | "containerExtending": false, 231 | "left": 293, 232 | "top": 173, 233 | "width": 274, 234 | "height": 13, 235 | "autoResize": false, 236 | "underline": false, 237 | "text": "+train_data", 238 | "horizontalAlignment": 0, 239 | "verticalAlignment": 5, 240 | "wordWrap": false 241 | }, 242 | { 243 | "_type": "UMLAttributeView", 244 | "_id": "AAAAAAFi9xuMmUHQ3ww=", 245 | "_parent": { 246 | "$ref": "AAAAAAFi9xjWtkGeVvE=" 247 | }, 248 | "model": { 249 | "$ref": "AAAAAAFi9xuMQUHN5bw=" 250 | }, 251 | "visible": true, 252 | "enabled": true, 253 | "lineColor": "#000000", 254 | "fillColor": "#ffffff", 255 | "fontColor": "#000000", 256 | "font": "Arial;13;0", 257 | "showShadow": true, 258 | "containerChangeable": false, 259 | "containerExtending": false, 260 | "left": 293, 261 | "top": 188, 262 | "width": 274, 263 | "height": 13, 264 | "autoResize": false, 265 | "underline": false, 266 | "text": "+train_labels", 267 | "horizontalAlignment": 0, 268 | "verticalAlignment": 5, 269 | "wordWrap": false 270 | }, 271 | { 272 | "_type": "UMLAttributeView", 273 | "_id": "AAAAAAFi9xuRgEHWH5Y=", 274 | "_parent": { 275 | "$ref": "AAAAAAFi9xjWtkGeVvE=" 276 | }, 277 | "model": { 278 | "$ref": "AAAAAAFi9xuRKEHTR3k=" 279 | }, 280 | "visible": true, 281 | "enabled": true, 282 | "lineColor": "#000000", 283 | "fillColor": "#ffffff", 284 | "fontColor": "#000000", 285 | "font": "Arial;13;0", 286 | "showShadow": true, 287 | "containerChangeable": false, 288 | "containerExtending": false, 289 | "left": 293, 290 | "top": 203, 291 | "width": 274, 292 | "height": 13, 293 | "autoResize": false, 294 | "underline": false, 295 | "text": "+test_data", 296 | "horizontalAlignment": 0, 297 | "verticalAlignment": 5, 298 | "wordWrap": false 299 | }, 300 | { 301 | "_type": "UMLAttributeView", 302 | "_id": "AAAAAAFi9xuW6kHcaKo=", 303 | "_parent": { 304 | "$ref": "AAAAAAFi9xjWtkGeVvE=" 305 | }, 306 | "model": { 307 | "$ref": "AAAAAAFi9xuWkUHZCmQ=" 308 | }, 309 | "visible": true, 310 | "enabled": true, 311 | "lineColor": "#000000", 312 | "fillColor": "#ffffff", 313 | "fontColor": "#000000", 314 | "font": "Arial;13;0", 315 | "showShadow": true, 316 | "containerChangeable": false, 317 | "containerExtending": false, 318 | "left": 293, 319 | "top": 218, 320 | "width": 274, 321 | "height": 13, 322 | "autoResize": false, 323 | "underline": false, 324 | "text": "+test_labels", 325 | "horizontalAlignment": 0, 326 | "verticalAlignment": 5, 327 | "wordWrap": false 328 | }, 329 | { 330 | "_type": "UMLAttributeView", 331 | "_id": "AAAAAAFi9xub70Hi+ms=", 332 | "_parent": { 333 | "$ref": "AAAAAAFi9xjWtkGeVvE=" 334 | }, 335 | "model": { 336 | "$ref": "AAAAAAFi9xubkUHfEwU=" 337 | }, 338 | "visible": true, 339 | "enabled": true, 340 | "lineColor": "#000000", 341 | "fillColor": "#ffffff", 342 | "fontColor": "#000000", 343 | "font": "Arial;13;0", 344 | "showShadow": true, 345 | "containerChangeable": false, 346 | "containerExtending": false, 347 | "left": 293, 348 | "top": 233, 349 | "width": 274, 350 | "height": 13, 351 | "autoResize": false, 352 | "underline": false, 353 | "text": "+no_of_classes", 354 | "horizontalAlignment": 0, 355 | "verticalAlignment": 5, 356 | "wordWrap": false 357 | }, 358 | { 359 | "_type": "UMLAttributeView", 360 | "_id": "AAAAAAFi9x1auUHxQFI=", 361 | "_parent": { 362 | "$ref": "AAAAAAFi9xjWtkGeVvE=" 363 | }, 364 | "model": { 365 | "$ref": "AAAAAAFi9x1aTkHuL1Q=" 366 | }, 367 | "visible": true, 368 | "enabled": true, 369 | "lineColor": "#000000", 370 | "fillColor": "#ffffff", 371 | "fontColor": "#000000", 372 | "font": "Arial;13;0", 373 | "showShadow": true, 374 | "containerChangeable": false, 375 | "containerExtending": false, 376 | "left": 293, 377 | "top": 248, 378 | "width": 274, 379 | "height": 13, 380 | "autoResize": false, 381 | "underline": false, 382 | "text": "+list_of_classes", 383 | "horizontalAlignment": 0, 384 | "verticalAlignment": 5, 385 | "wordWrap": false 386 | }, 387 | { 388 | "_type": "UMLAttributeView", 389 | "_id": "AAAAAAFjPCmiecoNg/U=", 390 | "_parent": { 391 | "$ref": "AAAAAAFi9xjWtkGeVvE=" 392 | }, 393 | "model": { 394 | "$ref": "AAAAAAFjPCmiCsoKxKQ=" 395 | }, 396 | "visible": true, 397 | "enabled": true, 398 | "lineColor": "#000000", 399 | "fillColor": "#ffffff", 400 | "fontColor": "#000000", 401 | "font": "Arial;13;0", 402 | "showShadow": true, 403 | "containerChangeable": false, 404 | "containerExtending": false, 405 | "left": 293, 406 | "top": 263, 407 | "width": 274, 408 | "height": 13, 409 | "autoResize": false, 410 | "underline": false, 411 | "text": "+train_label_one_hot", 412 | "horizontalAlignment": 0, 413 | "verticalAlignment": 5, 414 | "wordWrap": false 415 | }, 416 | { 417 | "_type": "UMLAttributeView", 418 | "_id": "AAAAAAFjPCmrgsoT/4o=", 419 | "_parent": { 420 | "$ref": "AAAAAAFi9xjWtkGeVvE=" 421 | }, 422 | "model": { 423 | "$ref": "AAAAAAFjPCmrMcoQmwg=" 424 | }, 425 | "visible": true, 426 | "enabled": true, 427 | "lineColor": "#000000", 428 | "fillColor": "#ffffff", 429 | "fontColor": "#000000", 430 | "font": "Arial;13;0", 431 | "showShadow": true, 432 | "containerChangeable": false, 433 | "containerExtending": false, 434 | "left": 293, 435 | "top": 278, 436 | "width": 274, 437 | "height": 13, 438 | "autoResize": false, 439 | "underline": false, 440 | "text": "+test_label_one_hot", 441 | "horizontalAlignment": 0, 442 | "verticalAlignment": 5, 443 | "wordWrap": false 444 | } 445 | ], 446 | "visible": true, 447 | "enabled": true, 448 | "lineColor": "#000000", 449 | "fillColor": "#ffffff", 450 | "fontColor": "#000000", 451 | "font": "Arial;13;0", 452 | "showShadow": true, 453 | "containerChangeable": false, 454 | "containerExtending": false, 455 | "left": 288, 456 | "top": 153, 457 | "width": 284, 458 | "height": 143, 459 | "autoResize": false 460 | }, 461 | { 462 | "_type": "UMLOperationCompartmentView", 463 | "_id": "AAAAAAFi9xjWt0GfAh8=", 464 | "_parent": { 465 | "$ref": "AAAAAAFi9xjWtUGYj70=" 466 | }, 467 | "model": { 468 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 469 | }, 470 | "subViews": [ 471 | { 472 | "_type": "UMLOperationView", 473 | "_id": "AAAAAAFi9x2IAUH4rJU=", 474 | "_parent": { 475 | "$ref": "AAAAAAFi9xjWt0GfAh8=" 476 | }, 477 | "model": { 478 | "$ref": "AAAAAAFi9x2HmUH1q10=" 479 | }, 480 | "visible": true, 481 | "enabled": true, 482 | "lineColor": "#000000", 483 | "fillColor": "#ffffff", 484 | "fontColor": "#000000", 485 | "font": "Arial;13;0", 486 | "showShadow": true, 487 | "containerChangeable": false, 488 | "containerExtending": false, 489 | "left": 293, 490 | "top": 301, 491 | "width": 274, 492 | "height": 13, 493 | "autoResize": false, 494 | "underline": false, 495 | "text": "+load_dataset()", 496 | "horizontalAlignment": 0, 497 | "verticalAlignment": 5, 498 | "wordWrap": false 499 | }, 500 | { 501 | "_type": "UMLOperationView", 502 | "_id": "AAAAAAFi9x3zRkH/ABs=", 503 | "_parent": { 504 | "$ref": "AAAAAAFi9xjWt0GfAh8=" 505 | }, 506 | "model": { 507 | "$ref": "AAAAAAFi9x3y7UH8VGY=" 508 | }, 509 | "visible": true, 510 | "enabled": true, 511 | "lineColor": "#000000", 512 | "fillColor": "#ffffff", 513 | "fontColor": "#000000", 514 | "font": "Arial;13;0", 515 | "showShadow": true, 516 | "containerChangeable": false, 517 | "containerExtending": false, 518 | "left": 293, 519 | "top": 316, 520 | "width": 274, 521 | "height": 13, 522 | "autoResize": false, 523 | "underline": false, 524 | "text": "+calculate_class_label_size()", 525 | "horizontalAlignment": 0, 526 | "verticalAlignment": 5, 527 | "wordWrap": false 528 | }, 529 | { 530 | "_type": "UMLOperationView", 531 | "_id": "AAAAAAFi9x3390IFVEA=", 532 | "_parent": { 533 | "$ref": "AAAAAAFi9xjWt0GfAh8=" 534 | }, 535 | "model": { 536 | "$ref": "AAAAAAFi9x33n0ICtmI=" 537 | }, 538 | "visible": true, 539 | "enabled": true, 540 | "lineColor": "#000000", 541 | "fillColor": "#ffffff", 542 | "fontColor": "#000000", 543 | "font": "Arial;13;0", 544 | "showShadow": true, 545 | "containerChangeable": false, 546 | "containerExtending": false, 547 | "left": 293, 548 | "top": 331, 549 | "width": 274, 550 | "height": 13, 551 | "autoResize": false, 552 | "underline": false, 553 | "text": "+pirnt_dataset_details()", 554 | "horizontalAlignment": 0, 555 | "verticalAlignment": 5, 556 | "wordWrap": false 557 | }, 558 | { 559 | "_type": "UMLOperationView", 560 | "_id": "AAAAAAFi9x4BQ0ILxOk=", 561 | "_parent": { 562 | "$ref": "AAAAAAFi9xjWt0GfAh8=" 563 | }, 564 | "model": { 565 | "$ref": "AAAAAAFi9x4A8UIIrkQ=" 566 | }, 567 | "visible": true, 568 | "enabled": true, 569 | "lineColor": "#000000", 570 | "fillColor": "#ffffff", 571 | "fontColor": "#000000", 572 | "font": "Arial;13;0", 573 | "showShadow": true, 574 | "containerChangeable": false, 575 | "containerExtending": false, 576 | "left": 293, 577 | "top": 346, 578 | "width": 274, 579 | "height": 13, 580 | "autoResize": false, 581 | "underline": false, 582 | "text": "+preprocess_dataset()", 583 | "horizontalAlignment": 0, 584 | "verticalAlignment": 5, 585 | "wordWrap": false 586 | }, 587 | { 588 | "_type": "UMLOperationView", 589 | "_id": "AAAAAAFi9x6DskIU+TI=", 590 | "_parent": { 591 | "$ref": "AAAAAAFi9xjWt0GfAh8=" 592 | }, 593 | "model": { 594 | "$ref": "AAAAAAFi9x6DUUIRUag=" 595 | }, 596 | "visible": true, 597 | "enabled": true, 598 | "lineColor": "#000000", 599 | "fillColor": "#ffffff", 600 | "fontColor": "#000000", 601 | "font": "Arial;13;0", 602 | "showShadow": true, 603 | "containerChangeable": false, 604 | "containerExtending": false, 605 | "left": 293, 606 | "top": 361, 607 | "width": 274, 608 | "height": 13, 609 | "autoResize": false, 610 | "underline": false, 611 | "text": "+display_data_element(which_data, index)", 612 | "horizontalAlignment": 0, 613 | "verticalAlignment": 5, 614 | "wordWrap": false 615 | } 616 | ], 617 | "visible": true, 618 | "enabled": true, 619 | "lineColor": "#000000", 620 | "fillColor": "#ffffff", 621 | "fontColor": "#000000", 622 | "font": "Arial;13;0", 623 | "showShadow": true, 624 | "containerChangeable": false, 625 | "containerExtending": false, 626 | "left": 288, 627 | "top": 296, 628 | "width": 284, 629 | "height": 83, 630 | "autoResize": false 631 | }, 632 | { 633 | "_type": "UMLReceptionCompartmentView", 634 | "_id": "AAAAAAFi9xjWt0GgqNs=", 635 | "_parent": { 636 | "$ref": "AAAAAAFi9xjWtUGYj70=" 637 | }, 638 | "model": { 639 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 640 | }, 641 | "visible": false, 642 | "enabled": true, 643 | "lineColor": "#000000", 644 | "fillColor": "#ffffff", 645 | "fontColor": "#000000", 646 | "font": "Arial;13;0", 647 | "showShadow": true, 648 | "containerChangeable": false, 649 | "containerExtending": false, 650 | "left": 288, 651 | "top": 349, 652 | "width": 269, 653 | "height": 10, 654 | "autoResize": false 655 | }, 656 | { 657 | "_type": "UMLTemplateParameterCompartmentView", 658 | "_id": "AAAAAAFi9xjWt0Ghu6s=", 659 | "_parent": { 660 | "$ref": "AAAAAAFi9xjWtUGYj70=" 661 | }, 662 | "model": { 663 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 664 | }, 665 | "visible": false, 666 | "enabled": true, 667 | "lineColor": "#000000", 668 | "fillColor": "#ffffff", 669 | "fontColor": "#000000", 670 | "font": "Arial;13;0", 671 | "showShadow": true, 672 | "containerChangeable": false, 673 | "containerExtending": false, 674 | "left": 128, 675 | "top": -168, 676 | "width": 10, 677 | "height": 10, 678 | "autoResize": false 679 | } 680 | ], 681 | "visible": true, 682 | "enabled": true, 683 | "lineColor": "#000000", 684 | "fillColor": "#ffffff", 685 | "fontColor": "#000000", 686 | "font": "Arial;13;0", 687 | "showShadow": true, 688 | "containerChangeable": true, 689 | "containerExtending": false, 690 | "left": 288, 691 | "top": 128, 692 | "width": 284, 693 | "height": 251, 694 | "autoResize": false, 695 | "stereotypeDisplay": "label", 696 | "showVisibility": true, 697 | "showNamespace": false, 698 | "showProperty": true, 699 | "showType": true, 700 | "nameCompartment": { 701 | "$ref": "AAAAAAFi9xjWtUGZS/U=" 702 | }, 703 | "wordWrap": false, 704 | "suppressAttributes": false, 705 | "suppressOperations": false, 706 | "suppressReceptions": true, 707 | "showMultiplicity": true, 708 | "showOperationSignature": true, 709 | "attributeCompartment": { 710 | "$ref": "AAAAAAFi9xjWtkGeVvE=" 711 | }, 712 | "operationCompartment": { 713 | "$ref": "AAAAAAFi9xjWt0GfAh8=" 714 | }, 715 | "receptionCompartment": { 716 | "$ref": "AAAAAAFi9xjWt0GgqNs=" 717 | }, 718 | "templateParameterCompartment": { 719 | "$ref": "AAAAAAFi9xjWt0Ghu6s=" 720 | } 721 | } 722 | ] 723 | }, 724 | { 725 | "_type": "UMLClass", 726 | "_id": "AAAAAAFi9wQOF0DZfgQ=", 727 | "_parent": { 728 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 729 | }, 730 | "name": "FashionmnistMain", 731 | "ownedElements": [ 732 | { 733 | "_type": "UMLAssociation", 734 | "_id": "AAAAAAFi9zfgG0YTtnQ=", 735 | "_parent": { 736 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 737 | }, 738 | "end1": { 739 | "_type": "UMLAssociationEnd", 740 | "_id": "AAAAAAFi9zfgG0YUSE8=", 741 | "_parent": { 742 | "$ref": "AAAAAAFi9zfgG0YTtnQ=" 743 | }, 744 | "reference": { 745 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 746 | }, 747 | "visibility": "public", 748 | "navigable": false, 749 | "aggregation": "none", 750 | "isReadOnly": false, 751 | "isOrdered": false, 752 | "isUnique": false, 753 | "isDerived": false, 754 | "isID": false 755 | }, 756 | "end2": { 757 | "_type": "UMLAssociationEnd", 758 | "_id": "AAAAAAFi9zfgG0YVJEs=", 759 | "_parent": { 760 | "$ref": "AAAAAAFi9zfgG0YTtnQ=" 761 | }, 762 | "reference": { 763 | "$ref": "AAAAAAFi9yBjG0IejZg=" 764 | }, 765 | "visibility": "public", 766 | "navigable": true, 767 | "aggregation": "none", 768 | "isReadOnly": false, 769 | "isOrdered": false, 770 | "isUnique": false, 771 | "isDerived": false, 772 | "isID": false 773 | }, 774 | "visibility": "public", 775 | "isDerived": false 776 | }, 777 | { 778 | "_type": "UMLAssociation", 779 | "_id": "AAAAAAFi9zjGQkbgM3A=", 780 | "_parent": { 781 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 782 | }, 783 | "end1": { 784 | "_type": "UMLAssociationEnd", 785 | "_id": "AAAAAAFi9zjGQkbhngo=", 786 | "_parent": { 787 | "$ref": "AAAAAAFi9zjGQkbgM3A=" 788 | }, 789 | "reference": { 790 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 791 | }, 792 | "visibility": "public", 793 | "navigable": false, 794 | "aggregation": "none", 795 | "isReadOnly": false, 796 | "isOrdered": false, 797 | "isUnique": false, 798 | "isDerived": false, 799 | "isID": false 800 | }, 801 | "end2": { 802 | "_type": "UMLAssociationEnd", 803 | "_id": "AAAAAAFi9zjGQkbiYAA=", 804 | "_parent": { 805 | "$ref": "AAAAAAFi9zjGQkbgM3A=" 806 | }, 807 | "reference": { 808 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 809 | }, 810 | "visibility": "public", 811 | "navigable": true, 812 | "aggregation": "none", 813 | "isReadOnly": false, 814 | "isOrdered": false, 815 | "isUnique": false, 816 | "isDerived": false, 817 | "isID": false 818 | }, 819 | "visibility": "public", 820 | "isDerived": false 821 | }, 822 | { 823 | "_type": "UMLAssociation", 824 | "_id": "AAAAAAFi9zkJykcyxzU=", 825 | "_parent": { 826 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 827 | }, 828 | "end1": { 829 | "_type": "UMLAssociationEnd", 830 | "_id": "AAAAAAFi9zkJykcz2Pk=", 831 | "_parent": { 832 | "$ref": "AAAAAAFi9zkJykcyxzU=" 833 | }, 834 | "reference": { 835 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 836 | }, 837 | "visibility": "public", 838 | "navigable": false, 839 | "aggregation": "none", 840 | "isReadOnly": false, 841 | "isOrdered": false, 842 | "isUnique": false, 843 | "isDerived": false, 844 | "isID": false 845 | }, 846 | "end2": { 847 | "_type": "UMLAssociationEnd", 848 | "_id": "AAAAAAFi9zkJykc0Y6w=", 849 | "_parent": { 850 | "$ref": "AAAAAAFi9zkJykcyxzU=" 851 | }, 852 | "reference": { 853 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 854 | }, 855 | "visibility": "public", 856 | "navigable": true, 857 | "aggregation": "none", 858 | "isReadOnly": false, 859 | "isOrdered": false, 860 | "isUnique": false, 861 | "isDerived": false, 862 | "isID": false 863 | }, 864 | "visibility": "public", 865 | "isDerived": false 866 | } 867 | ], 868 | "visibility": "public", 869 | "attributes": [ 870 | { 871 | "_type": "UMLAttribute", 872 | "_id": "AAAAAAFi9wTmBEELT88=", 873 | "_parent": { 874 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 875 | }, 876 | "name": "config", 877 | "visibility": "public", 878 | "isStatic": false, 879 | "isLeaf": false, 880 | "type": "", 881 | "isReadOnly": false, 882 | "isOrdered": false, 883 | "isUnique": false, 884 | "isDerived": false, 885 | "aggregation": "none", 886 | "isID": false 887 | }, 888 | { 889 | "_type": "UMLAttribute", 890 | "_id": "AAAAAAFi9whQt0ES1dE=", 891 | "_parent": { 892 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 893 | }, 894 | "name": "dataset", 895 | "visibility": "public", 896 | "isStatic": false, 897 | "isLeaf": false, 898 | "type": "", 899 | "isReadOnly": false, 900 | "isOrdered": false, 901 | "isUnique": false, 902 | "isDerived": false, 903 | "aggregation": "none", 904 | "isID": false 905 | }, 906 | { 907 | "_type": "UMLAttribute", 908 | "_id": "AAAAAAFi9wiC1EEZYAg=", 909 | "_parent": { 910 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 911 | }, 912 | "name": "model", 913 | "visibility": "public", 914 | "isStatic": false, 915 | "isLeaf": false, 916 | "type": "", 917 | "isReadOnly": false, 918 | "isOrdered": false, 919 | "isUnique": false, 920 | "isDerived": false, 921 | "aggregation": "none", 922 | "isID": false 923 | } 924 | ], 925 | "operations": [ 926 | { 927 | "_type": "UMLOperation", 928 | "_id": "AAAAAAFi9wjHQ0EhLm0=", 929 | "_parent": { 930 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 931 | }, 932 | "name": "configurationParameters", 933 | "visibility": "public", 934 | "isStatic": false, 935 | "isLeaf": false, 936 | "parameters": [ 937 | { 938 | "_type": "UMLParameter", 939 | "_id": "AAAAAAFi9wlJ50EoBnM=", 940 | "_parent": { 941 | "$ref": "AAAAAAFi9wjHQ0EhLm0=" 942 | }, 943 | "name": "json_file", 944 | "visibility": "public", 945 | "isStatic": false, 946 | "isLeaf": false, 947 | "type": "", 948 | "isReadOnly": false, 949 | "isOrdered": false, 950 | "isUnique": false, 951 | "direction": "in" 952 | } 953 | ], 954 | "concurrency": "sequential", 955 | "isQuery": false, 956 | "isAbstract": false 957 | }, 958 | { 959 | "_type": "UMLOperation", 960 | "_id": "AAAAAAFi9w9zk0EqCwU=", 961 | "_parent": { 962 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 963 | }, 964 | "name": "FashionMnistLoader", 965 | "visibility": "public", 966 | "isStatic": false, 967 | "isLeaf": false, 968 | "parameters": [ 969 | { 970 | "_type": "UMLParameter", 971 | "_id": "AAAAAAFi9w/cskExook=", 972 | "_parent": { 973 | "$ref": "AAAAAAFi9w9zk0EqCwU=" 974 | }, 975 | "name": "config", 976 | "visibility": "public", 977 | "isStatic": false, 978 | "isLeaf": false, 979 | "type": "", 980 | "isReadOnly": false, 981 | "isOrdered": false, 982 | "isUnique": false, 983 | "direction": "in" 984 | } 985 | ], 986 | "concurrency": "sequential", 987 | "isQuery": false, 988 | "isAbstract": false 989 | }, 990 | { 991 | "_type": "UMLOperation", 992 | "_id": "AAAAAAFi9w/dw0Eze58=", 993 | "_parent": { 994 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 995 | }, 996 | "name": "FashionMnistModel", 997 | "visibility": "public", 998 | "isStatic": false, 999 | "isLeaf": false, 1000 | "parameters": [ 1001 | { 1002 | "_type": "UMLParameter", 1003 | "_id": "AAAAAAFi9w/o20E6oro=", 1004 | "_parent": { 1005 | "$ref": "AAAAAAFi9w/dw0Eze58=" 1006 | }, 1007 | "name": "config", 1008 | "visibility": "public", 1009 | "isStatic": false, 1010 | "isLeaf": false, 1011 | "type": "", 1012 | "isReadOnly": false, 1013 | "isOrdered": false, 1014 | "isUnique": false, 1015 | "direction": "in" 1016 | }, 1017 | { 1018 | "_type": "UMLParameter", 1019 | "_id": "AAAAAAFi9w/o20E73Vg=", 1020 | "_parent": { 1021 | "$ref": "AAAAAAFi9w/dw0Eze58=" 1022 | }, 1023 | "name": "dataset", 1024 | "visibility": "public", 1025 | "isStatic": false, 1026 | "isLeaf": false, 1027 | "type": "", 1028 | "isReadOnly": false, 1029 | "isOrdered": false, 1030 | "isUnique": false, 1031 | "direction": "in" 1032 | } 1033 | ], 1034 | "concurrency": "sequential", 1035 | "isQuery": false, 1036 | "isAbstract": false 1037 | }, 1038 | { 1039 | "_type": "UMLOperation", 1040 | "_id": "AAAAAAFi9w/qmUE+Mcc=", 1041 | "_parent": { 1042 | "$ref": "AAAAAAFi9wQOF0DZfgQ=" 1043 | }, 1044 | "name": "save_model", 1045 | "visibility": "public", 1046 | "isStatic": false, 1047 | "isLeaf": false, 1048 | "concurrency": "sequential", 1049 | "isQuery": false, 1050 | "isAbstract": false 1051 | } 1052 | ], 1053 | "isAbstract": false, 1054 | "isFinalSpecialization": false, 1055 | "isLeaf": false, 1056 | "isActive": false 1057 | }, 1058 | { 1059 | "_type": "UMLClass", 1060 | "_id": "AAAAAAFi9xUuKEFFXH4=", 1061 | "_parent": { 1062 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 1063 | }, 1064 | "name": "ConfigurationParameters", 1065 | "visibility": "public", 1066 | "attributes": [ 1067 | { 1068 | "_type": "UMLAttribute", 1069 | "_id": "AAAAAAFi9xWzf0FvGdo=", 1070 | "_parent": { 1071 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 1072 | }, 1073 | "name": "config_file", 1074 | "visibility": "public", 1075 | "isStatic": false, 1076 | "isLeaf": false, 1077 | "type": "", 1078 | "isReadOnly": false, 1079 | "isOrdered": false, 1080 | "isUnique": false, 1081 | "isDerived": false, 1082 | "aggregation": "none", 1083 | "isID": false 1084 | }, 1085 | { 1086 | "_type": "UMLAttribute", 1087 | "_id": "AAAAAAFi9xXXhkF2Qu8=", 1088 | "_parent": { 1089 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 1090 | }, 1091 | "name": "config_dictionary", 1092 | "visibility": "public", 1093 | "isStatic": false, 1094 | "isLeaf": false, 1095 | "type": "", 1096 | "isReadOnly": false, 1097 | "isOrdered": false, 1098 | "isUnique": false, 1099 | "isDerived": false, 1100 | "aggregation": "none", 1101 | "isID": false 1102 | }, 1103 | { 1104 | "_type": "UMLAttribute", 1105 | "_id": "AAAAAAFi9xYcIUF9WdI=", 1106 | "_parent": { 1107 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 1108 | }, 1109 | "name": "config_namespace", 1110 | "visibility": "public", 1111 | "isStatic": false, 1112 | "isLeaf": false, 1113 | "type": "", 1114 | "isReadOnly": false, 1115 | "isOrdered": false, 1116 | "isUnique": false, 1117 | "isDerived": false, 1118 | "aggregation": "none", 1119 | "isID": false 1120 | } 1121 | ], 1122 | "operations": [ 1123 | { 1124 | "_type": "UMLOperation", 1125 | "_id": "AAAAAAFi9xZTDEGEx/0=", 1126 | "_parent": { 1127 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 1128 | }, 1129 | "name": "load", 1130 | "visibility": "public", 1131 | "isStatic": false, 1132 | "isLeaf": false, 1133 | "parameters": [ 1134 | { 1135 | "_type": "UMLParameter", 1136 | "_id": "AAAAAAFi9xbrOUGL5uI=", 1137 | "_parent": { 1138 | "$ref": "AAAAAAFi9xZTDEGEx/0=" 1139 | }, 1140 | "name": "config_file", 1141 | "visibility": "public", 1142 | "isStatic": false, 1143 | "isLeaf": false, 1144 | "type": "", 1145 | "isReadOnly": false, 1146 | "isOrdered": false, 1147 | "isUnique": false, 1148 | "direction": "in" 1149 | } 1150 | ], 1151 | "concurrency": "sequential", 1152 | "isQuery": false, 1153 | "isAbstract": false 1154 | }, 1155 | { 1156 | "_type": "UMLOperation", 1157 | "_id": "AAAAAAFi9xbsq0GNwqg=", 1158 | "_parent": { 1159 | "$ref": "AAAAAAFi9xUuKEFFXH4=" 1160 | }, 1161 | "name": "Bunch", 1162 | "visibility": "public", 1163 | "isStatic": false, 1164 | "isLeaf": false, 1165 | "parameters": [ 1166 | { 1167 | "_type": "UMLParameter", 1168 | "_id": "AAAAAAFi9xjKBEGUJWU=", 1169 | "_parent": { 1170 | "$ref": "AAAAAAFi9xbsq0GNwqg=" 1171 | }, 1172 | "name": "self.config_dictionary", 1173 | "visibility": "public", 1174 | "isStatic": false, 1175 | "isLeaf": false, 1176 | "type": "", 1177 | "isReadOnly": false, 1178 | "isOrdered": false, 1179 | "isUnique": false, 1180 | "direction": "in" 1181 | } 1182 | ], 1183 | "concurrency": "sequential", 1184 | "isQuery": false, 1185 | "isAbstract": false 1186 | } 1187 | ], 1188 | "isAbstract": false, 1189 | "isFinalSpecialization": false, 1190 | "isLeaf": false, 1191 | "isActive": false 1192 | }, 1193 | { 1194 | "_type": "UMLClass", 1195 | "_id": "AAAAAAFi9xjWs0GW8JM=", 1196 | "_parent": { 1197 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 1198 | }, 1199 | "name": "DataLoader", 1200 | "ownedElements": [ 1201 | { 1202 | "_type": "UMLGeneralization", 1203 | "_id": "AAAAAAFi9zWCjEVi/3A=", 1204 | "_parent": { 1205 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1206 | }, 1207 | "source": { 1208 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1209 | }, 1210 | "target": { 1211 | "$ref": "AAAAAAFi9yBjG0IejZg=" 1212 | }, 1213 | "visibility": "public" 1214 | }, 1215 | { 1216 | "_type": "UMLAssociation", 1217 | "_id": "AAAAAAFi9zeig0W4V7g=", 1218 | "_parent": { 1219 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1220 | }, 1221 | "end1": { 1222 | "_type": "UMLAssociationEnd", 1223 | "_id": "AAAAAAFi9zeihEW50E0=", 1224 | "_parent": { 1225 | "$ref": "AAAAAAFi9zeig0W4V7g=" 1226 | }, 1227 | "reference": { 1228 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1229 | }, 1230 | "visibility": "public", 1231 | "navigable": false, 1232 | "aggregation": "none", 1233 | "isReadOnly": false, 1234 | "isOrdered": false, 1235 | "isUnique": false, 1236 | "isDerived": false, 1237 | "isID": false 1238 | }, 1239 | "end2": { 1240 | "_type": "UMLAssociationEnd", 1241 | "_id": "AAAAAAFi9zeihEW6I7o=", 1242 | "_parent": { 1243 | "$ref": "AAAAAAFi9zeig0W4V7g=" 1244 | }, 1245 | "reference": { 1246 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1247 | }, 1248 | "visibility": "public", 1249 | "navigable": true, 1250 | "aggregation": "none", 1251 | "isReadOnly": false, 1252 | "isOrdered": false, 1253 | "isUnique": false, 1254 | "isDerived": false, 1255 | "isID": false 1256 | }, 1257 | "visibility": "public", 1258 | "isDerived": false 1259 | } 1260 | ], 1261 | "visibility": "public", 1262 | "attributes": [ 1263 | { 1264 | "_type": "UMLAttribute", 1265 | "_id": "AAAAAAFi9xp9qkHAEng=", 1266 | "_parent": { 1267 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1268 | }, 1269 | "name": "config", 1270 | "visibility": "public", 1271 | "isStatic": false, 1272 | "isLeaf": false, 1273 | "type": "", 1274 | "isReadOnly": false, 1275 | "isOrdered": false, 1276 | "isUnique": false, 1277 | "isDerived": false, 1278 | "aggregation": "none", 1279 | "isID": false 1280 | }, 1281 | { 1282 | "_type": "UMLAttribute", 1283 | "_id": "AAAAAAFi9xuGckHHDWc=", 1284 | "_parent": { 1285 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1286 | }, 1287 | "name": "train_data", 1288 | "visibility": "public", 1289 | "isStatic": false, 1290 | "isLeaf": false, 1291 | "type": "", 1292 | "isReadOnly": false, 1293 | "isOrdered": false, 1294 | "isUnique": false, 1295 | "isDerived": false, 1296 | "aggregation": "none", 1297 | "isID": false 1298 | }, 1299 | { 1300 | "_type": "UMLAttribute", 1301 | "_id": "AAAAAAFi9xuMQUHN5bw=", 1302 | "_parent": { 1303 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1304 | }, 1305 | "name": "train_labels", 1306 | "visibility": "public", 1307 | "isStatic": false, 1308 | "isLeaf": false, 1309 | "type": "", 1310 | "isReadOnly": false, 1311 | "isOrdered": false, 1312 | "isUnique": false, 1313 | "isDerived": false, 1314 | "aggregation": "none", 1315 | "isID": false 1316 | }, 1317 | { 1318 | "_type": "UMLAttribute", 1319 | "_id": "AAAAAAFi9xuRKEHTR3k=", 1320 | "_parent": { 1321 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1322 | }, 1323 | "name": "test_data", 1324 | "visibility": "public", 1325 | "isStatic": false, 1326 | "isLeaf": false, 1327 | "type": "", 1328 | "isReadOnly": false, 1329 | "isOrdered": false, 1330 | "isUnique": false, 1331 | "isDerived": false, 1332 | "aggregation": "none", 1333 | "isID": false 1334 | }, 1335 | { 1336 | "_type": "UMLAttribute", 1337 | "_id": "AAAAAAFi9xuWkUHZCmQ=", 1338 | "_parent": { 1339 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1340 | }, 1341 | "name": "test_labels", 1342 | "visibility": "public", 1343 | "isStatic": false, 1344 | "isLeaf": false, 1345 | "type": "", 1346 | "isReadOnly": false, 1347 | "isOrdered": false, 1348 | "isUnique": false, 1349 | "isDerived": false, 1350 | "aggregation": "none", 1351 | "isID": false 1352 | }, 1353 | { 1354 | "_type": "UMLAttribute", 1355 | "_id": "AAAAAAFi9xubkUHfEwU=", 1356 | "_parent": { 1357 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1358 | }, 1359 | "name": "no_of_classes", 1360 | "visibility": "public", 1361 | "isStatic": false, 1362 | "isLeaf": false, 1363 | "type": "", 1364 | "isReadOnly": false, 1365 | "isOrdered": false, 1366 | "isUnique": false, 1367 | "isDerived": false, 1368 | "aggregation": "none", 1369 | "isID": false 1370 | }, 1371 | { 1372 | "_type": "UMLAttribute", 1373 | "_id": "AAAAAAFi9x1aTkHuL1Q=", 1374 | "_parent": { 1375 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1376 | }, 1377 | "name": "list_of_classes", 1378 | "visibility": "public", 1379 | "isStatic": false, 1380 | "isLeaf": false, 1381 | "type": "", 1382 | "isReadOnly": false, 1383 | "isOrdered": false, 1384 | "isUnique": false, 1385 | "isDerived": false, 1386 | "aggregation": "none", 1387 | "isID": false 1388 | }, 1389 | { 1390 | "_type": "UMLAttribute", 1391 | "_id": "AAAAAAFjPCmiCsoKxKQ=", 1392 | "_parent": { 1393 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1394 | }, 1395 | "name": "train_label_one_hot", 1396 | "visibility": "public", 1397 | "isStatic": false, 1398 | "isLeaf": false, 1399 | "type": "", 1400 | "isReadOnly": false, 1401 | "isOrdered": false, 1402 | "isUnique": false, 1403 | "isDerived": false, 1404 | "aggregation": "none", 1405 | "isID": false 1406 | }, 1407 | { 1408 | "_type": "UMLAttribute", 1409 | "_id": "AAAAAAFjPCmrMcoQmwg=", 1410 | "_parent": { 1411 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1412 | }, 1413 | "name": "test_label_one_hot", 1414 | "visibility": "public", 1415 | "isStatic": false, 1416 | "isLeaf": false, 1417 | "type": "", 1418 | "isReadOnly": false, 1419 | "isOrdered": false, 1420 | "isUnique": false, 1421 | "isDerived": false, 1422 | "aggregation": "none", 1423 | "isID": false 1424 | } 1425 | ], 1426 | "operations": [ 1427 | { 1428 | "_type": "UMLOperation", 1429 | "_id": "AAAAAAFi9x2HmUH1q10=", 1430 | "_parent": { 1431 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1432 | }, 1433 | "name": "load_dataset", 1434 | "visibility": "public", 1435 | "isStatic": false, 1436 | "isLeaf": false, 1437 | "concurrency": "sequential", 1438 | "isQuery": false, 1439 | "isAbstract": false 1440 | }, 1441 | { 1442 | "_type": "UMLOperation", 1443 | "_id": "AAAAAAFi9x3y7UH8VGY=", 1444 | "_parent": { 1445 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1446 | }, 1447 | "name": "calculate_class_label_size", 1448 | "visibility": "public", 1449 | "isStatic": false, 1450 | "isLeaf": false, 1451 | "concurrency": "sequential", 1452 | "isQuery": false, 1453 | "isAbstract": false 1454 | }, 1455 | { 1456 | "_type": "UMLOperation", 1457 | "_id": "AAAAAAFi9x33n0ICtmI=", 1458 | "_parent": { 1459 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1460 | }, 1461 | "name": "pirnt_dataset_details", 1462 | "visibility": "public", 1463 | "isStatic": false, 1464 | "isLeaf": false, 1465 | "concurrency": "sequential", 1466 | "isQuery": false, 1467 | "isAbstract": false 1468 | }, 1469 | { 1470 | "_type": "UMLOperation", 1471 | "_id": "AAAAAAFi9x4A8UIIrkQ=", 1472 | "_parent": { 1473 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1474 | }, 1475 | "name": "preprocess_dataset", 1476 | "visibility": "public", 1477 | "isStatic": false, 1478 | "isLeaf": false, 1479 | "concurrency": "sequential", 1480 | "isQuery": false, 1481 | "isAbstract": false 1482 | }, 1483 | { 1484 | "_type": "UMLOperation", 1485 | "_id": "AAAAAAFi9x6DUUIRUag=", 1486 | "_parent": { 1487 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1488 | }, 1489 | "name": "display_data_element", 1490 | "visibility": "public", 1491 | "isStatic": false, 1492 | "isLeaf": false, 1493 | "parameters": [ 1494 | { 1495 | "_type": "UMLParameter", 1496 | "_id": "AAAAAAFi9x7jhEIYOzo=", 1497 | "_parent": { 1498 | "$ref": "AAAAAAFi9x6DUUIRUag=" 1499 | }, 1500 | "name": "which_data", 1501 | "visibility": "public", 1502 | "isStatic": false, 1503 | "isLeaf": false, 1504 | "isReadOnly": false, 1505 | "isOrdered": false, 1506 | "isUnique": false, 1507 | "direction": "in" 1508 | }, 1509 | { 1510 | "_type": "UMLParameter", 1511 | "_id": "AAAAAAFi9x7jhEIZsIY=", 1512 | "_parent": { 1513 | "$ref": "AAAAAAFi9x6DUUIRUag=" 1514 | }, 1515 | "name": "index", 1516 | "visibility": "public", 1517 | "isStatic": false, 1518 | "isLeaf": false, 1519 | "isReadOnly": false, 1520 | "isOrdered": false, 1521 | "isUnique": false, 1522 | "direction": "in" 1523 | } 1524 | ], 1525 | "concurrency": "sequential", 1526 | "isQuery": false, 1527 | "isAbstract": false 1528 | } 1529 | ], 1530 | "isAbstract": false, 1531 | "isFinalSpecialization": false, 1532 | "isLeaf": false, 1533 | "isActive": false 1534 | }, 1535 | { 1536 | "_type": "UMLClass", 1537 | "_id": "AAAAAAFi9yBjG0IejZg=", 1538 | "_parent": { 1539 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 1540 | }, 1541 | "name": "FashionMnistLoader", 1542 | "ownedElements": [ 1543 | { 1544 | "_type": "UMLGeneralization", 1545 | "_id": "AAAAAAFi9zXxG0V7jXI=", 1546 | "_parent": { 1547 | "$ref": "AAAAAAFi9yBjG0IejZg=" 1548 | }, 1549 | "name": "Inherit DataLoader", 1550 | "source": { 1551 | "$ref": "AAAAAAFi9yBjG0IejZg=" 1552 | }, 1553 | "target": { 1554 | "$ref": "AAAAAAFi9xjWs0GW8JM=" 1555 | }, 1556 | "visibility": "public" 1557 | } 1558 | ], 1559 | "visibility": "public", 1560 | "operations": [ 1561 | { 1562 | "_type": "UMLOperation", 1563 | "_id": "AAAAAAFi9yGBfkJJvzk=", 1564 | "_parent": { 1565 | "$ref": "AAAAAAFi9yBjG0IejZg=" 1566 | }, 1567 | "name": "load_dataset", 1568 | "visibility": "public", 1569 | "isStatic": false, 1570 | "isLeaf": false, 1571 | "concurrency": "sequential", 1572 | "isQuery": false, 1573 | "isAbstract": false 1574 | }, 1575 | { 1576 | "_type": "UMLOperation", 1577 | "_id": "AAAAAAFi9yHJ0EJQJ4s=", 1578 | "_parent": { 1579 | "$ref": "AAAAAAFi9yBjG0IejZg=" 1580 | }, 1581 | "name": "display_data_element", 1582 | "visibility": "public", 1583 | "isStatic": false, 1584 | "isLeaf": false, 1585 | "parameters": [ 1586 | { 1587 | "_type": "UMLParameter", 1588 | "_id": "AAAAAAFi9yIRFEJYdfI=", 1589 | "_parent": { 1590 | "$ref": "AAAAAAFi9yHJ0EJQJ4s=" 1591 | }, 1592 | "name": "self", 1593 | "visibility": "public", 1594 | "isStatic": false, 1595 | "isLeaf": false, 1596 | "type": "", 1597 | "isReadOnly": false, 1598 | "isOrdered": false, 1599 | "isUnique": false, 1600 | "direction": "in" 1601 | }, 1602 | { 1603 | "_type": "UMLParameter", 1604 | "_id": "AAAAAAFi9yIRFEJZsFs=", 1605 | "_parent": { 1606 | "$ref": "AAAAAAFi9yHJ0EJQJ4s=" 1607 | }, 1608 | "name": "whichData", 1609 | "visibility": "public", 1610 | "isStatic": false, 1611 | "isLeaf": false, 1612 | "type": "", 1613 | "isReadOnly": false, 1614 | "isOrdered": false, 1615 | "isUnique": false, 1616 | "direction": "in" 1617 | }, 1618 | { 1619 | "_type": "UMLParameter", 1620 | "_id": "AAAAAAFi9yIRFEJaM3Q=", 1621 | "_parent": { 1622 | "$ref": "AAAAAAFi9yHJ0EJQJ4s=" 1623 | }, 1624 | "name": "index", 1625 | "visibility": "public", 1626 | "isStatic": false, 1627 | "isLeaf": false, 1628 | "type": "", 1629 | "isReadOnly": false, 1630 | "isOrdered": false, 1631 | "isUnique": false, 1632 | "direction": "in" 1633 | } 1634 | ], 1635 | "concurrency": "sequential", 1636 | "isQuery": false, 1637 | "isAbstract": false 1638 | }, 1639 | { 1640 | "_type": "UMLOperation", 1641 | "_id": "AAAAAAFi9yJNdkJeMsU=", 1642 | "_parent": { 1643 | "$ref": "AAAAAAFi9yBjG0IejZg=" 1644 | }, 1645 | "name": "preprocess_dataset", 1646 | "visibility": "public", 1647 | "isStatic": false, 1648 | "isLeaf": false, 1649 | "concurrency": "sequential", 1650 | "isQuery": false, 1651 | "isAbstract": false 1652 | } 1653 | ], 1654 | "isAbstract": false, 1655 | "isFinalSpecialization": false, 1656 | "isLeaf": false, 1657 | "isActive": false 1658 | }, 1659 | { 1660 | "_type": "UMLClass", 1661 | "_id": "AAAAAAFi9yL3DkJqKA4=", 1662 | "_parent": { 1663 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 1664 | }, 1665 | "name": "BaseModel", 1666 | "visibility": "public", 1667 | "attributes": [ 1668 | { 1669 | "_type": "UMLAttribute", 1670 | "_id": "AAAAAAFi9yPgBkMNrss=", 1671 | "_parent": { 1672 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1673 | }, 1674 | "name": "config", 1675 | "visibility": "public", 1676 | "isStatic": false, 1677 | "isLeaf": false, 1678 | "type": "", 1679 | "isReadOnly": false, 1680 | "isOrdered": false, 1681 | "isUnique": false, 1682 | "isDerived": false, 1683 | "aggregation": "none", 1684 | "isID": false 1685 | }, 1686 | { 1687 | "_type": "UMLAttribute", 1688 | "_id": "AAAAAAFi9yQ1b0MXxPg=", 1689 | "_parent": { 1690 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1691 | }, 1692 | "name": "dataset", 1693 | "visibility": "public", 1694 | "isStatic": false, 1695 | "isLeaf": false, 1696 | "type": "", 1697 | "isReadOnly": false, 1698 | "isOrdered": false, 1699 | "isUnique": false, 1700 | "isDerived": false, 1701 | "aggregation": "none", 1702 | "isID": false 1703 | }, 1704 | { 1705 | "_type": "UMLAttribute", 1706 | "_id": "AAAAAAFi9yRsJ0MhB9w=", 1707 | "_parent": { 1708 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1709 | }, 1710 | "name": "history", 1711 | "visibility": "public", 1712 | "isStatic": false, 1713 | "isLeaf": false, 1714 | "type": "", 1715 | "isReadOnly": false, 1716 | "isOrdered": false, 1717 | "isUnique": false, 1718 | "isDerived": false, 1719 | "aggregation": "none", 1720 | "isID": false 1721 | }, 1722 | { 1723 | "_type": "UMLAttribute", 1724 | "_id": "AAAAAAFi9ySJuUMrUBY=", 1725 | "_parent": { 1726 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1727 | }, 1728 | "name": "scores", 1729 | "visibility": "public", 1730 | "isStatic": false, 1731 | "isLeaf": false, 1732 | "type": "", 1733 | "isReadOnly": false, 1734 | "isOrdered": false, 1735 | "isUnique": false, 1736 | "isDerived": false, 1737 | "aggregation": "none", 1738 | "isID": false 1739 | }, 1740 | { 1741 | "_type": "UMLAttribute", 1742 | "_id": "AAAAAAFi9ySlhUM1pyg=", 1743 | "_parent": { 1744 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1745 | }, 1746 | "name": "predictions", 1747 | "visibility": "public", 1748 | "isStatic": false, 1749 | "isLeaf": false, 1750 | "type": "", 1751 | "isReadOnly": false, 1752 | "isOrdered": false, 1753 | "isUnique": false, 1754 | "isDerived": false, 1755 | "aggregation": "none", 1756 | "isID": false 1757 | } 1758 | ], 1759 | "operations": [ 1760 | { 1761 | "_type": "UMLOperation", 1762 | "_id": "AAAAAAFi9yTmtEM/tBw=", 1763 | "_parent": { 1764 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1765 | }, 1766 | "name": "validateStride", 1767 | "visibility": "public", 1768 | "isStatic": false, 1769 | "isLeaf": false, 1770 | "concurrency": "sequential", 1771 | "isQuery": false, 1772 | "isAbstract": false 1773 | }, 1774 | { 1775 | "_type": "UMLOperation", 1776 | "_id": "AAAAAAFi9yUen0NJyDg=", 1777 | "_parent": { 1778 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1779 | }, 1780 | "name": "define_model", 1781 | "visibility": "public", 1782 | "isStatic": false, 1783 | "isLeaf": false, 1784 | "concurrency": "sequential", 1785 | "isQuery": false, 1786 | "isAbstract": false 1787 | }, 1788 | { 1789 | "_type": "UMLOperation", 1790 | "_id": "AAAAAAFi9yVK0kNTrDA=", 1791 | "_parent": { 1792 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1793 | }, 1794 | "name": "compile_model", 1795 | "visibility": "public", 1796 | "isStatic": false, 1797 | "isLeaf": false, 1798 | "concurrency": "sequential", 1799 | "isQuery": false, 1800 | "isAbstract": false 1801 | }, 1802 | { 1803 | "_type": "UMLOperation", 1804 | "_id": "AAAAAAFi9yVnFkNd1Ug=", 1805 | "_parent": { 1806 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1807 | }, 1808 | "name": "fit_model", 1809 | "visibility": "public", 1810 | "isStatic": false, 1811 | "isLeaf": false, 1812 | "concurrency": "sequential", 1813 | "isQuery": false, 1814 | "isAbstract": false 1815 | }, 1816 | { 1817 | "_type": "UMLOperation", 1818 | "_id": "AAAAAAFi9yWK3UNn1rU=", 1819 | "_parent": { 1820 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1821 | }, 1822 | "name": "evaluate_model", 1823 | "visibility": "public", 1824 | "isStatic": false, 1825 | "isLeaf": false, 1826 | "concurrency": "sequential", 1827 | "isQuery": false, 1828 | "isAbstract": false 1829 | }, 1830 | { 1831 | "_type": "UMLOperation", 1832 | "_id": "AAAAAAFi9yWpCkNx0u0=", 1833 | "_parent": { 1834 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1835 | }, 1836 | "name": "predict", 1837 | "visibility": "public", 1838 | "isStatic": false, 1839 | "isLeaf": false, 1840 | "concurrency": "sequential", 1841 | "isQuery": false, 1842 | "isAbstract": false 1843 | }, 1844 | { 1845 | "_type": "UMLOperation", 1846 | "_id": "AAAAAAFi9yZtTEN7A7E=", 1847 | "_parent": { 1848 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1849 | }, 1850 | "name": "save_model", 1851 | "visibility": "public", 1852 | "isStatic": false, 1853 | "isLeaf": false, 1854 | "concurrency": "sequential", 1855 | "isQuery": false, 1856 | "isAbstract": false 1857 | }, 1858 | { 1859 | "_type": "UMLOperation", 1860 | "_id": "AAAAAAFi9ya4oEOFMTI=", 1861 | "_parent": { 1862 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1863 | }, 1864 | "name": "load_model", 1865 | "visibility": "public", 1866 | "isStatic": false, 1867 | "isLeaf": false, 1868 | "concurrency": "sequential", 1869 | "isQuery": false, 1870 | "isAbstract": false 1871 | } 1872 | ], 1873 | "isAbstract": false, 1874 | "isFinalSpecialization": false, 1875 | "isLeaf": false, 1876 | "isActive": false 1877 | }, 1878 | { 1879 | "_type": "UMLClass", 1880 | "_id": "AAAAAAFi9ycm2kO+Rpo=", 1881 | "_parent": { 1882 | "$ref": "AAAAAAFF+qBWK6M3Z8Y=" 1883 | }, 1884 | "name": "FashionMnistModel", 1885 | "ownedElements": [ 1886 | { 1887 | "_type": "UMLGeneralization", 1888 | "_id": "AAAAAAFi9zbL20WmMSY=", 1889 | "_parent": { 1890 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1891 | }, 1892 | "name": "Inherit BaseModel", 1893 | "source": { 1894 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1895 | }, 1896 | "target": { 1897 | "$ref": "AAAAAAFi9yL3DkJqKA4=" 1898 | }, 1899 | "visibility": "public" 1900 | } 1901 | ], 1902 | "visibility": "public", 1903 | "operations": [ 1904 | { 1905 | "_type": "UMLOperation", 1906 | "_id": "AAAAAAFi9yuQykSkkGo=", 1907 | "_parent": { 1908 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1909 | }, 1910 | "name": "define_model", 1911 | "visibility": "public", 1912 | "isStatic": false, 1913 | "isLeaf": false, 1914 | "concurrency": "sequential", 1915 | "isQuery": false, 1916 | "isAbstract": false 1917 | }, 1918 | { 1919 | "_type": "UMLOperation", 1920 | "_id": "AAAAAAFi9yxiuUUY+7U=", 1921 | "_parent": { 1922 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1923 | }, 1924 | "name": "compile_model", 1925 | "visibility": "public", 1926 | "isStatic": false, 1927 | "isLeaf": false, 1928 | "concurrency": "sequential", 1929 | "isQuery": false, 1930 | "isAbstract": false 1931 | }, 1932 | { 1933 | "_type": "UMLOperation", 1934 | "_id": "AAAAAAFi9y22RkUggtc=", 1935 | "_parent": { 1936 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1937 | }, 1938 | "name": "fit_model", 1939 | "visibility": "public", 1940 | "isStatic": false, 1941 | "isLeaf": false, 1942 | "concurrency": "sequential", 1943 | "isQuery": false, 1944 | "isAbstract": false 1945 | }, 1946 | { 1947 | "_type": "UMLOperation", 1948 | "_id": "AAAAAAFi9y4TxkUoyko=", 1949 | "_parent": { 1950 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1951 | }, 1952 | "name": "evaluate_model", 1953 | "visibility": "public", 1954 | "isStatic": false, 1955 | "isLeaf": false, 1956 | "concurrency": "sequential", 1957 | "isQuery": false, 1958 | "isAbstract": false 1959 | }, 1960 | { 1961 | "_type": "UMLOperation", 1962 | "_id": "AAAAAAFi9y4+A0Uve1Q=", 1963 | "_parent": { 1964 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1965 | }, 1966 | "name": "predict", 1967 | "visibility": "public", 1968 | "isStatic": false, 1969 | "isLeaf": false, 1970 | "concurrency": "sequential", 1971 | "isQuery": false, 1972 | "isAbstract": false 1973 | }, 1974 | { 1975 | "_type": "UMLOperation", 1976 | "_id": "AAAAAAFi9y5gqUU2Hx8=", 1977 | "_parent": { 1978 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1979 | }, 1980 | "name": "save_model", 1981 | "visibility": "public", 1982 | "isStatic": false, 1983 | "isLeaf": false, 1984 | "concurrency": "sequential", 1985 | "isQuery": false, 1986 | "isAbstract": false 1987 | }, 1988 | { 1989 | "_type": "UMLOperation", 1990 | "_id": "AAAAAAFi9y6EmkU9bw4=", 1991 | "_parent": { 1992 | "$ref": "AAAAAAFi9ycm2kO+Rpo=" 1993 | }, 1994 | "name": "load_model", 1995 | "visibility": "public", 1996 | "isStatic": false, 1997 | "isLeaf": false, 1998 | "concurrency": "sequential", 1999 | "isQuery": false, 2000 | "isAbstract": false 2001 | } 2002 | ], 2003 | "isAbstract": false, 2004 | "isFinalSpecialization": false, 2005 | "isLeaf": false, 2006 | "isActive": false 2007 | } 2008 | ], 2009 | "visibility": "public" 2010 | } 2011 | ] 2012 | } -------------------------------------------------------------------------------- /resources/architecture_diagrams/images-src/project_architecture.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SantoshPattar/ConvNet-OOP/79bc464a7a62d52563dba0a355e63031fa2c5257/resources/architecture_diagrams/images-src/project_architecture.odg -------------------------------------------------------------------------------- /resources/architecture_diagrams/images/DataLoader_ClassDiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SantoshPattar/ConvNet-OOP/79bc464a7a62d52563dba0a355e63031fa2c5257/resources/architecture_diagrams/images/DataLoader_ClassDiagram.png -------------------------------------------------------------------------------- /resources/architecture_diagrams/images/Main_ClassDiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SantoshPattar/ConvNet-OOP/79bc464a7a62d52563dba0a355e63031fa2c5257/resources/architecture_diagrams/images/Main_ClassDiagram.png -------------------------------------------------------------------------------- /resources/architecture_diagrams/images/ModelBase_ClassDiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SantoshPattar/ConvNet-OOP/79bc464a7a62d52563dba0a355e63031fa2c5257/resources/architecture_diagrams/images/ModelBase_ClassDiagram.png -------------------------------------------------------------------------------- /resources/architecture_diagrams/images/Sequence_Diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SantoshPattar/ConvNet-OOP/79bc464a7a62d52563dba0a355e63031fa2c5257/resources/architecture_diagrams/images/Sequence_Diagram.png -------------------------------------------------------------------------------- /resources/architecture_diagrams/images/project_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SantoshPattar/ConvNet-OOP/79bc464a7a62d52563dba0a355e63031fa2c5257/resources/architecture_diagrams/images/project_architecture.png -------------------------------------------------------------------------------- /resources/parameter_descriptions.md: -------------------------------------------------------------------------------- 1 | # Configuration Parameters Description 2 | 3 | This file describes the JSON configuration parameters in Key:Value pair, along with their possible values for a given experiment. 4 | Each parameter is described in the following syntax: 5 | 6 | ``` 7 | **Parameter_Name:** 8 | - Parameter_Description. 9 | - Possible_Values. 10 | ``` 11 | --- 12 | 13 | - **exp_name:** 14 | - Name of the experiment. 15 | - Each experiment will have only one value, *i.e* the name of the experiment to be carried out. 16 | 17 | - **image_width:** 18 | - Specifies the input image's width. 19 | - Value depends on the input dataset. 20 | 21 | - **image_height:** 22 | - Specifies the input image's height. 23 | - Value depends on the input dataset. 24 | 25 | - **image_channel:** 26 | - Specifies the channel/depth size of the input image. 27 | - Value depends on the type of the input image. 28 | 29 | - **image_width:** 30 | - Specifies the size of the pixel for a given input image. 31 | - It's vaue depends on the type of the input dataset. 32 | 33 | - ***save_plots:** 34 | - Indicates whether to save or not the validation graphs for a given experiment. 35 | - true or false. 36 | 37 | - **num_classes:** 38 | - Indicates the number of classes in the given dataset. 39 | - Value depends on the dataset of the experiment. 40 | 41 | - **model_type:** 42 | - Shows the type of ConvNet model to be implemented. 43 | - Can be either Sequential or Functional. 44 | 45 | - **no_of_layers:** 46 | - Represents the number of layers used in the ConvNet model. 47 | - An integer indicating the number of layers. 48 | 49 | - **kernel_row:** 50 | - Mentions the size of a row for a given filter that will stride on the input data. 51 | - Value depends on the selected filter size. 52 | 53 | - **kernel_column:** 54 | - Mentions the column size of the filter image that will stride on the input data. 55 | - Value depends on the selected filter size. 56 | 57 | - **cmap_val:** 58 | - Enumerates the color of each channel in the input image. 59 | - Value depends on the type of images present in the dataset of the experiment. Commonly used values are RGB or Gray. 60 | 61 | - **stride_size:** 62 | - Denotes the size of the stride for the feature learning. 63 | - stride_size must be an integer i.e., It should be in the range [greater than zero but less than input image_size] and also it must satisfy the stride validation formula. 64 | 65 | - **padding:** 66 | - Establishes the type of padding performed on the border of the input data. 67 | - Same or Valid. 68 | 69 | - **padding_size:** 70 | - Indicates the number of row and column to be padded on the border of the input data. 71 | - must be >= 0. 72 | 73 | - **no_of_filters_l1:** 74 | - Indicates the number of filters to be included in the Conv layer 1 of the ConvNet model. 75 | - no_of_filters > 0 and < image_width. 76 | 77 | - **conv_activation_l1:** 78 | - Represents the type of actiavtion function used in Conv layer 1. 79 | - linear, softmax, binary, sigmoid. 80 | 81 | - **no_of_filters_l2:** 82 | - Indicates the number of filters to be included in the Conv layer 2 of the ConvNet model. 83 | - no_of_filters > 0 and < image_width. 84 | 85 | - **conv_activation_l2:** 86 | - Represents the type of activation function used in Conv layer 2. 87 | - linear, softmax, binary, sigmoid. 88 | 89 | - **no_of_filters_l3:** 90 | - Indicates the number of filters to be included in the Conv layer 3 of the ConvNet model. 91 | - no_of_filters > 0 and < -image_width. 92 | 93 | - **conv_activation_l3:** 94 | - Represents the type of activation function used in Conv layer 3. 95 | - linear, softmax, binary, sigmoid. 96 | 97 | - **no_of_filters_l4:** 98 | - Indicates the number of filters to be included in the Conv layer 4 of the ConvNet model. 99 | - no_of_filters > 0 and < image_width. 100 | 101 | - **dense_activation_l1:** 102 | - Represents the type of activation function used in dense layer 1. 103 | - Example: linear, softmax, binary, sigmoid. 104 | 105 | - **dense_activation_l2:** 106 | - Represents the type of activation function used in dense layer 2. 107 | - linear, softmax, binary, sigmoid. 108 | 109 | - **relu_alpha:** 110 | - Specifies the alpha value of relu layer. 111 | - relu_alpha > 0 and <= 1 112 | 113 | - **pool_size_row:** 114 | - Indicates the row size of the pooling window. 115 | - pool_size_row > 0 and < input_image_width 116 | 117 | - **pool_size_column:** 118 | - Specifies the colmn size of the pooling window. 119 | - pool_size_row > 0 and < input_image_width 120 | 121 | - **dropout:** 122 | - Specifies whether the dropout layers need to be included or not in the ConvNet model. 123 | - true or false. 124 | 125 | - **dropout_probability_l1:** 126 | - Represents the dropout probability of dropout layer 1. 127 | - dropout_probability_l1 ranges from > 0 to < 1. 128 | 129 | - **dropout_probability_l2:** 130 | -Represents the dropout probability of dropout layer 2. 131 | - dropout_probability_l1 ranges from > 0 to < 1. 132 | 133 | - **dropout_probability_l3:** 134 | - Specifies the dropout probability of dropout layer 3. 135 | - dropout_probability_l1 ranges from > 0 to < 1. 136 | 137 | - **compile_loss:** 138 | - Indicates the type of compile_loss used during configuration of the model. 139 | - categorical_crossentropy. 140 | 141 | - **compile_optimizer:** 142 | - Indicates the type of compile_optimizer used during configuration of the model. 143 | - adam, adagrad, SGD, adamax *etc.* 144 | 145 | - **compile_metrics1:** 146 | - Indicates the type of compile_metrics used during configuration of the model. 147 | - accuracy. 148 | 149 | - **test_size:** 150 | - Specifies the partition of data into two parts -> 1) Designed for training 2) Designed for Validation. 151 | - test_size ranges from > 0 to < 1. 152 | 153 | - **num_epochs:** 154 | - Specifies the number of times the model to be learned during the learning/training process. 155 | - Optimum range is between 1 to 20. 156 | 157 | - **batch_size:** 158 | - Specifies the number of training samples utilised in one iteration. 159 | - batch_size > 0 and < No. Of image the dataset. 160 | 161 | - **fit_verbose:** 162 | - Specifies the option for producing the detailed logging information during the training of a model. 163 | - 'verbose=0' will show you nothing (silent). 164 | - 'verbose=1' will show you an animated progress bar. 165 | - 'verbose=2' will just Mentions the number of epoch. 166 | 167 | - **evaluate_verbose:** 168 | - Specifies the option for producing the detailed logging information during the evaluation of a model. 169 | - 'verbose=0' will show you nothing (silent). 170 | - 'verbose=1' will show you an animated progress bar. 171 | - 'verbose=2' will just Mentions the number of epoch. 172 | 173 | - **predict_verbose:** 174 | - Indicates the option for producing the detailed logging information during the prediction of a model. 175 | - 'verbose=0' will show you nothing (silent). 176 | - 'verbose=1' will show you an animated progress bar. 177 | - 'verbose=2' will just Mentions the number of epoch. 178 | 179 | 180 | -------------------------------------------------------------------------------- /run_experiments.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Setup the execution path. 4 | export PYTHONPATH=`pwd`:$PYTHONPATH 5 | 6 | # Function to display the help message. 7 | usage() { 8 | 9 | echo "Usage: $0 -x, --experiment [-c, --config ] [-e, --epoch ] [-h,--help]" 10 | echo 11 | echo "Runs the ConvNet experiment." 12 | echo 13 | echo "Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options." 14 | echo 15 | echo "Experiment options:" 16 | echo "-x, --experiment name of the experiment to be run." 17 | echo " As of now, acceptable values are:" 18 | echo " fashion-mnist for FashionMNIST dataset" 19 | echo " stl-10 for STL-10 dataset" 20 | echo "-c, --config use this configuration file." 21 | echo "-e, --epoch number of training epoches." 22 | echo 23 | echo "Other options:" 24 | echo "-h, --help display this help and exit." 25 | } 26 | 27 | # Check for mandatory arguments. 28 | if [ $# -eq 0 ] 29 | then 30 | echo "No arguments supplied." 31 | echo "-x, --experiment is compulsory." 32 | echo 33 | usage 34 | exit 1 35 | fi 36 | 37 | # Argument variables. 38 | EXP= 39 | CONFIG= 40 | EPOCH= 41 | 42 | # Parse the command line arguments. 43 | ARGS=`getopt -o hx:c:e: --long help,experiment:,config:,epoch: -n 'run_experiments.sh' -- "$@"` 44 | eval set -- "$ARGS" 45 | 46 | while true; do 47 | case "$1" in 48 | -x | --experiment ) EXP=$2; shift 2 ;; 49 | -c | --config) CONFIG=$2; shift 2;; 50 | -e | --epoch ) EPOCH=$2; shift 2;; 51 | -h | --help ) usage; exit 0 ;; 52 | -- ) shift; break ;; 53 | * ) usage; exit 1 ;; 54 | esac 55 | done 56 | 57 | # Check for -experiment argument. 58 | if [ -z $EXP ] 59 | then 60 | echo "-x, --experiment is compulsory." 61 | echo 62 | usage 63 | exit 1 64 | fi 65 | 66 | # Run the experiment with required arguments. 67 | if [ "$EXP" = "fashion-mnist" ] && [ ! -z $CONFIG ] && [ ! -z $EPOCH ] 68 | then 69 | echo "Executing FashionMNIST experiment with config file and epoch arguments." 70 | python ./mains/fashion_mnist_mains.py -c $CONFIG -e $EPOCH 71 | elif [ "$EXP" = "fashion-mnist" ] && [ ! -z $EPOCH ] 72 | then 73 | echo "Executing FashionMNIST experiment with epoch argument." 74 | python ./mains/fashion_mnist_mains.py -e $EPOCH 75 | elif [ "$EXP" = "fashion-mnist" ] && [ ! -z $CONFIG ] 76 | then 77 | echo "Executing FashionMNIST experiment with config argument." 78 | python ./mains/fashion_mnist_mains.py -c $CONFIG 79 | elif [ "$EXP" = "fashion-mnist" ] 80 | then 81 | echo "Executing FashionMNIST experiment." 82 | python ./mains/fashion_mnist_mains.py 83 | elif [ "$EXP" = "stl-10" ] 84 | then 85 | echo "Executing STL-10 experiment." 86 | python ./mains/stl10_mains.py 87 | else 88 | echo "Invalid experiment-name !" 89 | echo 90 | usage 91 | exit 1 92 | fi 93 | -------------------------------------------------------------------------------- /utils/__init__.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------------------- /utils/model_utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Utility to generate classification report, confusion matrix and 4 | graph for loss and accuracy for the ConvNet model. 5 | 6 | Created on Wed Apr 25 22:23:07 2018 7 | 8 | @author: Santosh Pattar 9 | @author: Veerabadrappa 10 | @version: 1.0 11 | """ 12 | 13 | import matplotlib.pyplot as plt 14 | from sklearn.metrics import classification_report, accuracy_score, confusion_matrix 15 | import numpy as np 16 | import itertools 17 | import os 18 | 19 | class Report(): 20 | 21 | def __init__(self, config, model): 22 | """ 23 | Constructor to initialize the Report. 24 | 25 | :param config: the json configuration namespace. 26 | :param model: the ConvNet model. 27 | :return: none 28 | :raises: none 29 | """ 30 | 31 | self.config = config 32 | self.model = model 33 | 34 | return 35 | 36 | def plot(self): 37 | """ 38 | Plot loss and accuracy for the training and validation set of the ConvNet model. 39 | 40 | :param none 41 | :return none 42 | :raises none 43 | """ 44 | 45 | loss_list = [s for s in self.model.history.history.keys() if 'loss' in s and 'val' not in s] 46 | val_loss_list = [s for s in self.model.history.history.keys() if 'loss' in s and 'val' in s] 47 | acc_list = [s for s in self.model.history.history.keys() if 'acc' in s and 'val' not in s] 48 | val_acc_list = [s for s in self.model.history.history.keys() if 'acc' in s and 'val' in s] 49 | 50 | if len(loss_list) == 0: 51 | print('Loss is missing in history') 52 | return 53 | 54 | # As loss always exists 55 | epochs = range( 1, len(self.model.history.history[loss_list[0]]) + 1 ) 56 | 57 | # Loss graph. 58 | plt.figure(1) 59 | 60 | for l in loss_list: 61 | plt.plot( epochs, 62 | self.model.history.history[l], 63 | 'b', 64 | label = 'Training loss (' + str( str( format( self.model.history.history[l][-1],'.5f' ) ) + ')' ) 65 | ) 66 | 67 | for l in val_loss_list: 68 | plt.plot( epochs, 69 | self.model.history.history[l], 70 | 'g', 71 | label = 'Validation loss (' + str ( str( format( self.model.history.history[l][-1],'.5f' ) ) + ')' ) 72 | ) 73 | 74 | plt.title('Loss per Epoch') 75 | plt.xlabel('Epochs') 76 | plt.ylabel('Loss') 77 | plt.legend() 78 | 79 | # Save the plot to disk. 80 | loss_path = os.path.join( self.config.config_namespace.graph_dir, "loss.png" ) 81 | 82 | if(self.config.config_namespace.save_plots == 'true'): 83 | plt.savefig( loss_path, bbox_inches='tight' ) 84 | else: 85 | plt.show() 86 | 87 | plt.close() 88 | 89 | # Accuracy graph. 90 | plt.figure(2) 91 | for l in acc_list: 92 | plt.plot( epochs, 93 | self.model.history.history[l], 94 | 'b', 95 | label = 'Training accuracy (' + str( format( self.model.history.history[l][-1],'.5f' ) ) + ')' 96 | ) 97 | 98 | for l in val_acc_list: 99 | plt.plot( epochs, 100 | self.model.history.history[l], 101 | 'g', 102 | label = 'Validation accuracy (' + str( format( self.model.history.history[l][-1],'.5f' ) ) + ')' 103 | ) 104 | 105 | plt.title('Accuracy per Epoch') 106 | plt.xlabel('Epochs') 107 | plt.ylabel('Accuracy') 108 | plt.legend() 109 | 110 | # Save the plot to disk. 111 | acc_path = os.path.join( self.config.config_namespace.graph_dir, "accuracy.png" ) 112 | if(self.config.config_namespace.save_plots == 'true'): 113 | plt.savefig( acc_path, bbox_inches='tight' ) 114 | else: 115 | plt.show() 116 | 117 | plt.close() 118 | 119 | return 120 | 121 | def model_classification_report(self): 122 | """ 123 | Generate classification report of the ConvNet model here. 124 | 125 | :param none 126 | :return none 127 | :raises none 128 | """ 129 | 130 | predicted_classes = np.argmax( self.model.predictions, axis = 1 ) 131 | print('Accuracy: '+ str( accuracy_score( self.model.dataset.test_labels, predicted_classes ) ) ) 132 | print('Classification Report') 133 | print('------------------------------------------------------------------') 134 | target_names = [ 'Class {}'.format(i) for i in range(self.config.config_namespace.num_classes) ] 135 | print( 136 | classification_report( 137 | self.model.dataset.test_labels, 138 | predicted_classes, 139 | target_names = target_names 140 | ) 141 | ) 142 | 143 | return 144 | 145 | def plot_confusion_matrix(self): 146 | """ 147 | Generate and plot the classification confusion matrix. 148 | 149 | :param none 150 | :return none 151 | :raises none 152 | """ 153 | 154 | predicted_classes = np.argmax( self.model.predictions, axis = 1 ) 155 | target_names = [ 'Class {}'.format(i) for i in range(self.config.config_namespace.num_classes) ] 156 | title = 'Confusion matrix' 157 | cm = confusion_matrix( self.model.dataset.test_labels, predicted_classes ) 158 | print(title) 159 | print('------------------------------------------------------------------') 160 | print(cm) 161 | 162 | plt.imshow( cm, interpolation = 'nearest', cmap = plt.cm.Blues ) 163 | plt.title( title ) 164 | plt.colorbar() 165 | tick_marks = np.arange( len(target_names) ) 166 | plt.xticks( tick_marks, target_names, rotation = 45 ) 167 | plt.yticks( tick_marks, target_names ) 168 | 169 | fmt = 'd' 170 | thresh = cm.max() / 2 171 | 172 | for i, j in itertools.product( 173 | range(cm.shape[0]), 174 | range(cm.shape[1]) 175 | ): plt.text( 176 | j, 177 | i, 178 | format( cm[i, j], fmt ), 179 | horizontalalignment = 'center', 180 | color = 'white' if cm[i, j] > thresh else 'black' 181 | ) 182 | 183 | plt.tight_layout() 184 | plt.ylabel( 'True label' ) 185 | plt.xlabel( 'Predicted label' ) 186 | 187 | # Save the plot to disk. 188 | cm_path = os.path.join( self.config.config_namespace.graph_dir, "confusion_matrix.png") 189 | 190 | if(self.config.config_namespace.save_plots == 'true'): 191 | plt.savefig( cm_path, bbox_inches='tight' ) 192 | else: 193 | plt.show() 194 | 195 | plt.close() 196 | 197 | return -------------------------------------------------------------------------------- /utils/process_argument.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Process the json configuration file. 4 | 5 | Configuration file holds the parameters to intialize the CNN model. 6 | These files are located in configaration_files folder. 7 | 8 | Created on Wed May 2 09:02:54 2018 9 | 10 | @author: Santosh Pattar 11 | @author: Veerabadrappa 12 | @version: 1.0 13 | """ 14 | import argparse 15 | 16 | def get_args(): 17 | """ 18 | Get arguments from the command line. 19 | 20 | :param none 21 | :return none 22 | :raises none 23 | """ 24 | 25 | parser = argparse.ArgumentParser( description = __doc__ ) 26 | 27 | # Configuration file path argument. 28 | parser.add_argument( 29 | '-c', '--config', 30 | metavar = 'C', 31 | help = 'The Configuration file', 32 | default = './configuration_files/fashion_config.json', 33 | required = False 34 | ) 35 | 36 | # Epoch size argument. 37 | parser.add_argument( 38 | '-e', '--epoch', 39 | metavar = 'E', 40 | help = 'Number of epoches for traning the model', 41 | default = 1, 42 | required = False 43 | ) 44 | 45 | # Convert to dictonary. 46 | args = vars(parser.parse_args()) 47 | 48 | if( args['config'] == './configuration_files/fashion_config.json' ): 49 | print('Using default configuration file.') 50 | else: 51 | print('Using configurations from file:', args['config']) 52 | 53 | if( args['epoch'] == 1 ): 54 | print('Using default epoch size of 1.') 55 | else: 56 | print('Using epoch size:', args['epoch']) 57 | 58 | return args 59 | -------------------------------------------------------------------------------- /utils/process_configuration.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Parse the JSON configuration file of the experiment. 4 | 5 | Configuration file holds the parameters to intialize the ConvNet model. 6 | These files are located in configaration_files folder. 7 | 8 | Created on Sun Apr 22 21:02:54 2018 9 | 10 | @author: Santosh Pattar 11 | @author: Veerabadrappa 12 | @version: 1.0 13 | """ 14 | 15 | import json 16 | import os 17 | from bunch import Bunch 18 | 19 | class ConfigurationParameters: 20 | 21 | def __init__(self, args): 22 | """ 23 | Intialize the data members. 24 | 25 | :param json_file: Path to the JSON configuration file. 26 | :return none 27 | :raises none 28 | """ 29 | 30 | self.args = args 31 | 32 | json_file = self.args['config'] 33 | 34 | # Parse the configurations from the config json file provided. 35 | with open(json_file, 'r') as config_file: 36 | self.config_dictionary = json.load(config_file) 37 | 38 | # Convert the dictionary to a namespace using bunch library. 39 | self.config_namespace = Bunch( self.config_dictionary ) 40 | 41 | # Update the command line arguments in the confguration namespace. 42 | self.update_namespace() 43 | 44 | # Process the configuration parameters. 45 | self.process_config() 46 | 47 | return 48 | 49 | def update_namespace(self): 50 | """ 51 | Updates the value of JSON keys received from the command line to the namespace file. 52 | 53 | :param none 54 | :return none 55 | :raises none 56 | """ 57 | 58 | # Update epoch size. 59 | if 'epoch' in self.args.keys(): 60 | self.config_namespace.num_epochs = int( self.args['epoch'] ) 61 | 62 | return 63 | 64 | def process_config(self): 65 | """ 66 | Processes the configarion parameters of the ConvNet experiment. 67 | 68 | :param none 69 | :return none 70 | :raises none 71 | """ 72 | 73 | # Saved-Model directory. 74 | self.config_namespace.saved_model_dir = os.path.join("./experiments", self.config_namespace.exp_name, "saved_models/") 75 | 76 | # Graph directory. 77 | self.config_namespace.graph_dir = os.path.join("./experiments", self.config_namespace.exp_name, "graphs/") 78 | 79 | # Image directory. 80 | self.config_namespace.image_dir = os.path.join("./experiments", self.config_namespace.exp_name, "images/") 81 | 82 | # Create the above directories. 83 | self.create_dirs( [self.config_namespace.graph_dir, self.config_namespace.image_dir, self.config_namespace.saved_model_dir] ) 84 | 85 | return 86 | 87 | def create_dirs(self, dirs): 88 | """ 89 | Creates a directory structure for Graphs and Images generated during the run of the experiment. 90 | 91 | :param dirs: a list of directories to create if these directories are not found 92 | :return exit_code: 0:success -1:failed 93 | :raises none 94 | """ 95 | 96 | try: 97 | for d in dirs: 98 | if not os.path.exists(d): 99 | os.makedirs(d) 100 | return 0 101 | 102 | except Exception as err: 103 | print( "Creating directories error: {0}".format(err) ) 104 | exit(-1) --------------------------------------------------------------------------------