示例#1
0
def create_cls(in_path,ae_path,out_path):
    imgs=data.read_image_frame(in_path)
    X=imgs['Images'].tolist()
    y=imgs['Category'].tolist()
    n_cats=max(y)+1
    cls=comp.create_extractor(n_cats,ae_path)
    deep.learning_iter_super(cls,X,y,n_epochs=1000)
    utils.save_object(cls.get_model(),out_path) 
    return cls
示例#2
0
def create_sda(in_path,out_path,cls_config_path):
    imgs=data.read_image_frame(in_path)
    X=imgs['Images'].tolist()
    y=imgs['Category'].tolist()
    n_cats=max(y)+1
    hyper_params=tools.read_hyper_params(cls_config_path)
    hyper_params['n_out']=n_cats
    cls=sda.built_sda_cls(hyper_params)
    deep.learning_iter_super(cls,X,y,n_epochs=1000)
    utils.save_object(cls.model,out_path) 
    return cls