bdzyubak / tensorflow-sandbox

A repository for studying applications of Deep Learning across fields, and demonstrating samples of my code and project managment
0 stars 0 forks source link

Make default function to set up a model #9

Closed bdzyubak closed 2 years ago

bdzyubak commented 2 years ago

Existing train models for UNET and EfficientNET have a lot of similarity in steps defining the model. This request is to refactor model definition into a utility usable by all projects. The new module should take as an input which model is to be used. It will be continuously extended to take additional arguments to define callbacks, input image size, and anything else that may be needed by future training functions. Separate generators may be implemented for models which require very different defaults or arguments.

bdzyubak commented 2 years ago

A class to set up default models including imports, path specs, replacement of top layer for transfer learning, and specification of default callbacks/metrics/loss function/optimizer has been implemented. This allows a training file to do model setup in as little as:

model_name = 'unet'
model_path = os.path.join(os.path.dirname(__file__),"trained_model")
model = InitializeModel(model_name,dataset,model_path)
model.run_model()

Additional set methods will be implemented over time to extend functionality. Only the unet model is supported at this time, and only the segmentation task has been tested. 69257d68fa38987f78da344dc20a3644602d7720

bdzyubak commented 2 years ago

Model initialization now supports an efficientnet classification architecture in addition to unet segmentation. 6fd7f4f8b50ad9a5038a93119a84b60cecb2017b

Extensions to support additional model types will be added as part of future enhancements.