Esempio n. 1
0
def historic_scores_(model_id: int = None,
                     name: str = None,
                     version: str = None) -> Dict:
    """
    Get the historic scores for a model, in the form of::

        { val_loss: [...], val_acc: [..], acc: [...], loss: [...] }

    Where the arrays are the respective measures at the end of each epoch

    Parameters
    ----------
    version : str
        Model version in the format: "major.minor.patch". Ignored if model_id is passed
    name : str
        Name of the model. Must be provided if version is provided. Ignored if model_id is passed
    model_id : int
        Unique ID of the model

    Returns
    -------
    scores: dict
        Dictionary of key: score name, value: score array
    """

    model = _model_from_name_ver_id(model_id, name, version)
    base_path = ProjectManager.get_value('saved-models')
    hs_path = os.path.join(
        base_path,
        model.model_name + '_' + 'history' + '_' + model.version_dir + '.json')
    with open(hs_path, 'r') as scores:
        return json.load(scores)
Esempio n. 2
0
 def get_path(cls, name: str) -> str:
     return os.path.join(ProjectManager.get_value('saved-models'), name)