First off, I’m relatively new to python in general and extremely new to pytorch, so go easy on me if you check out the modules.  (I’m still working through pylint issues after adapting from a notebook… )
Either way, I’ve written a few modules 4 that allow me to generate an arbitrary number of pytorch CNNs with randomized convolution, pooling, and linear layers.  All “random” values (e.g. number of convolution layers, convolution out channels/kernel size, linear layer out features, include/don’t include a max pool layer, etc.) are subject to constraints that can be supplied using the kwargs of the builder class (NetDictionary).
My original use case was analyzing the data in the Mexican Covid19 dataset by converting it into an image and then using a CNN to “label” each case based on actual outcome.  The results were ultimately on par (and slightly better) than models based on traditional linear/PCA techniques.  The ‘utilities’ module I created is specific to this use case, but the other two modules could be used in other applications, which leads me to my question:
Could this functionality (i.e. the ability to generate and test random CNN layer structures and parameterizations) be applied to other use cases?  The ultimate end game might be setting up a NN that builds and (partially) trains a series of CNNs and then automatically adjusts the constraints (number of layers of each type + layer parameterization) on the CNNs generated in the next pass based on the results.
Is this reinventing the wheel?  Completely bonkers?  Improbable but maybe possibly possible?  All thoughts are appreciated.  Example basic usage (i.e. I haven’t tried to build an external network to dial in my CNNs… ):
from modules.network_dictionary_builder import NetDictionary
from modules.network_dictionary_analyzer import NetDictionaryAnalyzer
from modules.utilities import *

#global constants
NET_PATH = './networks.tar'
DATA_PATH = './datasets.tar'
IMAGE_DEPTH = 4
LABELS = ('Hospitalized', 'Intubated', 'Deceased', 'Pneumonia')
COLUMNS = ('Male', 'Pregnant', 'Diabetes', 'Asthma', 'Immunocompromised',
           'Hypertension', 'Other Disease', 'Cardiovascular Disease', 'Obesity', 'Kidney Disease',
           'Tobacco Use', 'COPD')
itc = ImageTensorCreator(IMAGE_DEPTH, COLUMNS)
LOSS_RECORDING_RATE = 1

#main functions
test_tensor = itc.create_fake_data(40,["Diabetes"])
network_dictionary = NetDictionary(3, test_tensor, len(LABELS), NET_PATH, force_rebuild=False, force_training=True)

ccd = CovidCnnDataset(DATA_PATH, itc, pyodbc_conn_string='DSN=covid;UID=seh;PWD=Welcome2020!;',
                                      query="{CALL getpydatav2}",
                                      #force_rebuild=True,
                                      approx_dataset_size=54000,
                                      validation_ratio=0.4)

network_dictionary.train_validate_networks(ccd.train_data, ccd.validation_images,
                                           ccd.validation_labels, LOSS_RECORDING_RATE)

network_dictionary.export_networks()

network_analysis = NetDictionaryAnalyzer(network_dictionary)
network_analysis.plot_losses()