Package: perming
permingperming: Perceptron Models Are Training on Windows Platform with Default GPU Acceleration.p: use polars or pandas to read dataset.per: perceptron algorithm used as based model.m: models include Box, Regressier, Binarier, Mutipler and Ranker.ing: training on windows platform with strong gpu acceleration.init backendrefer tohttps://pytorch.org/get-started/locally/and choose PyTorch to supportcudacompatible with your Windows.tests with: PyTorch 1.7.1+cu101advicesIf users don't want to encounterCUDA out of memoryreturn fromjoblib.parallel, the best solution is to download v1.9.2 or before v1.6.1.If users have no plan to retrain a full network in tuning model, the best solution is to download versions after v1.8.0 which supportset_freeze.If users are not conducting experiments on Jupyter, download versions after v1.7.* will acceleratetrain_valprocess and reduce redundancy.parametersinit:input_:int, feature dimensions of tabular datasets after extract, transform, load from any data sources.num_classes:int, define numbers of classes or outputs after users defined the type of task with layer output.hidden_layer_sizes:Tuple[int]=(100,), define numbers and sizes of hidden layers to enhance model representation.device:str='cuda', configure training and validation device with torch.device options. 'cuda' or 'cpu'.activation:str='relu', configure activation function combined with subsequent learning task. see _activate in open models.inplace_on:bool=False, configure whether to enable inplace=True on activation. False or True. (manually set in Box)criterion:str='CrossEntropyLoss', configure loss criterion with compatible learning task output. see _criterion in open models.solver:str='adam', configure inner optimizer serve as learning solver for learning task. see _solver in _utils/BaseModel.batch_size:int=32, define batch size on loaded dataset of one epoch training process. any int value > 0. (prefer 2^n)learning_rate_init:float=1e-2, define initial learning rate of solver input param controled by inner assertion. (1e-6, 1.0).lr_scheduler:Optional[str]=None, configure scheduler about learning rate decay for compatible use. see _scheduler in _utils/BaseModel.data_loader:features:TabularData, manually input by users.target:TabularData, manually input by users.ratio_set:Dict[str, int]={'train': 8, 'test': 1, 'val': 1}, define by users.worker_set:Dict[str, int]={'train': 8, 'test': 2, 'val': 1}, manually set by users need.random_seed:Optional[int]=None, manually set any int value by users to fixed sequence.set_freeze:require_grad:Dict[int, bool], manually set freezed layers by given serial numbers according toself.model. (if users set require_grad with{0: False}, it means freeze the first layer ofself.model.)train_val:num_epochs:int=2, define numbers of epochs in main training cycle. any int value > 0.interval:int=100, define console print length of whole epochs by interval. any int value > 0.tolerance:float=1e-3, define tolerance used to set inner break sensitivity. (1e-9, 1.0).patience:int=10, define value coordinate with tolerance to expand detect length. [10, 100].backend:str='threading', configure accelerate backend used in inner process. 'threading', 'multiprocessing', 'loky'.n_jobs:int=-1, define numbers of jobs with manually set by users need. -1 or any int value > 0. (if n_jobs=1, parallel processing will be turn off to save cuda memory.)prefer:str='threads', configure soft hint to choose the default backend. 'threads', 'processes'. (prefer 'threading' & 'threads' when users try fails by setting 'loky' and 'processes' or turn to v1.6.1.)early_stop:bool=False, define whether to enable early_stop process. False or True.test:sort_by:str='accuracy', configure sorted ways of correct_class. 'numbers', 'accuracy', 'num-total'.sort_state:bool=True, configure sorted state of correct_class. False or True.save or load:con:bool=True, configure whether to print model.state_dict(). False or True.dir:dir='./model', configure model path thatsave toorload from. correct path defined by users.general modelGENERAL_BOX(Box)ParametersMeaning__init__input_: intnum_classes: inthidden_layer_sizes: Tuple[int]=(100,)device: str='cuda'*activation: str='relu'inplace_on: bool=Falsecriterion: str='CrossEntropyLoss'solver: str='adam'batch_size: int=32learning_rate_init: float=1e-2lr_scheduler: Optional[str]=NoneInitialize Classifier or Regressier Based on Basic Information of the Dataset Obtained through Data Preprocessing and Feature Engineering.print_config/Return Initialized Parameters of Multi-layer Perceptron and Graph.data_loaderfeatures: TabularDatalabels: TabularDataratio_set: Dict[str, int]={'train': 8, 'test': 1, 'val': 1}worker_set: Dict[str, int]={'train': 8, 'test': 2, 'val': 1}random_seed: Optional[int]=NoneUsingratio_setandworker_setto Load the Numpy Dataset intotorch.utils.data.DataLoader.train_valnum_epochs: int=2interval: int=100tolerance: float=1e-3patience: int=10backend: str='threading'n_jobs: int=-1prefer: str='threads'early_stop: bool=FalseUsingnum_epochs,tolerance,patienceto Control Training Process andintervalto Adjust Print Interval with Accelerated Validation Combined withbackendandn_jobs.testsort_by: str='accuracy'sort_state: bool=TrueSort Returned Test Result about Correct Classes withsort_byandsort_stateWhich Only Appears in Classification.savecon: bool=Truedir: str='./model'Save Trained Model Parameters with Modelstate_dictControl bycon.loadcon: bool=Truedir: str='./model'Load Trained Model Parameters with Modelstate_dictControl bycon.common models (cuda first)RegressionRegressierParametersMeaning__init__input_: inthidden_layer_sizes: Tuple[int]=(100,)*activation: str='relu'criterion: str='MSELoss'solver: str='adam'batch_size: int=32learning_rate_init: float=1e-2lr_scheduler: Optional[str]=NoneInitialize Regressier Based on Basic Information of the Regression Dataset Obtained through Data Preprocessing and Feature Engineering withnum_classes=1.print_config/Return Initialized Parameters of Multi-layer Perceptron and Graph.data_loaderfeatures: TabularDatalabels: TabularDataratio_set: Dict[str, int]={'train': 8, 'test': 1, 'val': 1}worker_set: Dict[str, int]={'train': 8, 'test': 2, 'val': 1}random_seed: Optional[int]=NoneUsingratio_setandworker_setto Load the Regression Dataset with Numpy format intotorch.utils.data.DataLoader.set_freezerequire_grad: Dict[int, bool]freeze some layers by givenrequires_grad=Falseif trained model will be loaded to execute experiments.train_valnum_epochs: int=2interval: int=100tolerance: float=1e-3patience: int=10backend: str='threading'n_jobs: int=-1prefer: str='threads'early_stop: bool=FalseUsingnum_epochs,tolerance,patienceto Control Training Process andintervalto Adjust Print Interval with Accelerated Validation Combined withbackendandn_jobs.test/Test Module Only Show with Loss at 3 Stages: Train, Test, Valsavecon: bool=Truedir: str='./model'Save Trained Model Parameters with Modelstate_dictControl bycon.loadcon: bool=Truedir: str='./model'Load Trained Model Parameters with Modelstate_dictControl bycon.Binary-classificationBinarierParametersMeaning__init__input_: inthidden_layer_sizes: Tuple[int]=(100,)*activation: str='relu'criterion: str='CrossEntropyLoss'solver: str='adam'batch_size: int=32learning_rate_init: float=1e-2lr_scheduler: Optional[str]=NoneInitialize Classifier Based on Basic Information of the Classification Dataset Obtained through Data Preprocessing and Feature Engineering withnum_classes=2.print_config/Return Initialized Parameters of Multi-layer Perceptron and Graph.data_loaderfeatures: TabularDatalabels: TabularDataratio_set: Dict[str, int]={'train': 8, 'test': 1, 'val': 1}worker_set: Dict[str, int]={'train': 8, 'test': 2, 'val': 1}random_seed: Optional[int]=NoneUsingratio_setandworker_setto Load the Binary-classification Dataset with Numpy format intotorch.utils.data.DataLoader.set_freezerequire_grad: Dict[int, bool]freeze some layers by givenrequires_grad=Falseif trained model will be loaded to execute experiments.train_valnum_epochs: int=2interval: int=100tolerance: float=1e-3patience: int=10backend: str='threading'n_jobs: int=-1prefer: str='threads'early_stop: bool=FalseUsingnum_epochs,tolerance,patienceto Control Training Process andintervalto Adjust Print Interval with Accelerated Validation Combined withbackendandn_jobs.testsort_by: str='accuracy'sort_state: bool=TrueTest Module con with Correct Class and Loss at 3 Stages: Train, Test, Valsavecon: bool=Truedir: str='./model'Save Trained Model Parameters with Modelstate_dictControl bycon.loadcon: bool=Truedir: str='./model'Load Trained Model Parameters with Modelstate_dictControl bycon.Multi-classificationMutiplerParametersMeaning__init__input_: intnum_classes: inthidden_layer_sizes: Tuple[int]=(100,)*activation: str='relu'criterion: str='CrossEntropyLoss'solver: str='adam'batch_size: int=32learning_rate_init: float=1e-2lr_scheduler: Optional[str]=NoneInitialize Classifier Based on Basic Information of the Classification Dataset Obtained through Data Preprocessing and Feature Engineering withnum_classes>2.print_config/Return Initialized Parameters of Multi-layer Perceptron and Graph.data_loaderfeatures: TabularDatalabels: TabularDataratio_set: Dict[str, int]={'train': 8, 'test': 1, 'val': 1}worker_set: Dict[str, int]={'train': 8, 'test': 2, 'val': 1}random_seed: Optional[int]=NoneUsingratio_setandworker_setto Load the Multi-classification Dataset with Numpy format intotorch.utils.data.DataLoader.set_freezerequire_grad: Dict[int, bool]freeze some layers by givenrequires_grad=Falseif trained model will be loaded to execute experiments.train_valnum_epochs: int=2interval: int=100tolerance: float=1e-3patience: int=10backend: str='threading'n_jobs: int=-1prefer: str='threads'early_stop: bool=FalseUsingnum_epochs,tolerance,patienceto Control Training Process andintervalto Adjust Print Interval with Accelerated Validation Combined withbackendandn_jobs.testsort_by: str='accuracy'sort_state: bool=TrueSort Returned Test Result about Correct Classes withsort_byandsort_stateWhich Only Appears in Classification.savecon: bool=Truedir: str='./model'Save Trained Model Parameters with Modelstate_dictControl bycon.loadcon: bool=Truedir: str='./model'Load Trained Model Parameters with Modelstate_dictControl bycon.Multi-outputsRankerParametersMeaning__init__input_: intnum_outputs: inthidden_layer_sizes: Tuple[int]=(100,)*activation: str='relu'criterion: str='MultiLabelSoftMarginLoss'solver: str='adam'batch_size: int=32learning_rate_init: float=1e-2lr_scheduler: Optional[str]=NoneInitialize Ranker Based on Basic Information of the Classification Dataset Obtained through Data Preprocessing and Feature Engineering with (n_samples, n_outputs).print_config/Return Initialized Parameters of Multi-layer Perceptron and Graph.data_loaderfeatures: TabularDatalabels: TabularDataratio_set: Dict[str, int]={'train': 8, 'test': 1, 'val': 1}worker_set: Dict[str, int]={'train': 8, 'test': 2, 'val': 1}random_seed: Optional[int]=NoneUsingratio_setandworker_setto Load the Multi-outputs Dataset with Numpy format intotorch.utils.data.DataLoader.set_freezerequire_grad: Dict[int, bool]freeze some layers by givenrequires_grad=Falseif trained model will be loaded to execute experiments.train_valnum_epochs: int=2interval: int=100tolerance: float=1e-3patience: int=10backend: str='threading'n_jobs: int=-1prefer: str='threads'early_stop: bool=FalseUsingnum_epochs,tolerance,patienceto Control Training Process andintervalto Adjust Print Interval with Accelerated Validation Combined withbackendandn_jobs.test/Test Module Only Show with Loss at 3 Stages: Train, Test, Valsavecon: bool=Truedir: str='./model'Save Trained Model Parameters with Modelstate_dictControl bycon.loadcon: bool=Truedir: str='./model'Load Trained Model Parameters with Modelstate_dictControl bycon.prefer replace target shape(n,1)with shape(n,)usingnumpy.squeeze(target), users can search and combine more predefined options in submodules and its__doc__of each open classes.pip installdownload latest version:git clone https://github.com/linjing-lab/easy-pytorch.git
cd easy-pytorch/released_box
pip install -e . --verbosedownload stable version:pip install perming --upgradedownload versions without supportedearly_stop:pip install perming==1.3.1download versions with supportedearly_stop:pip install perming>=1.4.1download versions with supportedearly_stopin epoch:pip install perming>=1.4.2download version without enhancingParallelanddelayed:pip install perming==1.6.1download version with enhancingParallelanddelayed:pip install perming>=1.7.0download version with supportedset_freeze:pip install perming>=1.8.0download version without crash of jupyter kernel:pip install perming>=1.8.1download version with optimized _val_acc (avoidCUDA out of memorywhich may occured from 1.7.* to 1.9.1)pip install perming==1.9.2