How to use add_loader_options method in avocado

Best Python code snippet using avocado_python

TrainingDriver.py

Source:TrainingDriver.py Github

copy

Full Screen

...45 parser.add_argument('--elastic-momentum',help='worker SGD momentum for EASGD',46 type=float, default=0, dest='elastic_momentum')47def add_downpour_options(parser):48 parser.add_argument('--optimizer',help='optimizer for master to use in downpour',default='adam')49def add_loader_options(parser):50 parser.add_argument('--preload-data', help='Preload files as we read them', default=0, type=int, dest='data_preload')51 parser.add_argument('--cache-data', help='Cache the input files to a provided directory', default='', dest='caching_dir')52 parser.add_argument('--copy-command', help='Specific command line to copy the data into the cache. Expect a string with two {} first is the source (from input file list), second is the bare file name at destination. Like "cp {} {}"', default=None, dest='copy_command')53def add_target_options(parser):54 parser.add_argument('--early-stopping', default=None,55 dest='early_stopping', help='patience for early stopping')56 parser.add_argument('--target-metric', default=None,57 dest='target_metric', help='Passing configuration for a target metric')58 59def make_train_parser():60 parser = argparse.ArgumentParser() 61 parser.add_argument('--timeline',help='Record timeline of activity', action='store_true')62 add_train_options(parser)63 return parser64def add_checkpoint_options(parser):65 parser.add_argument('--restore', help='pass a file to retore the variables from', default=None)66 parser.add_argument('--checkpoint', help='Base name of the checkpointing file. If omitted no checkpointing will be done', default=None)67 parser.add_argument('--checkpoint-interval', help='Number of epochs between checkpoints', default=5, type=int, dest='checkpoint_interval')68 69def add_train_options(parser):70 parser.add_argument('--verbose',help='display metrics for each training batch',action='store_true')71 parser.add_argument('--monitor',help='Monitor cpu and gpu utilization', action='store_true')72 parser.add_argument('--backend', help='specify the backend to be used', choices= ['keras','torch'],default='keras')73 parser.add_argument('--thread_validation', help='run a single process', action='store_true')74 75 # model arguments76 parser.add_argument('--model', help='File containing model architecture (serialized in JSON/pickle, or provided in a .py file')77 parser.add_argument('--trial-name', help='descriptive name for trial', 78 default='train', dest='trial_name')79 # training data arguments80 parser.add_argument('--train_data', help='text file listing data inputs for training', default=None)81 parser.add_argument('--val_data', help='text file lis`ting data inputs for validation', default=None)82 parser.add_argument('--features-name', help='name of HDF5 dataset with input features',83 default='features', dest='features_name')84 parser.add_argument('--labels-name', help='name of HDF5 dataset with output labels',85 default='labels', dest='labels_name')86 87 parser.add_argument('--batch', help='batch size', default=100, type=int)88 89 # configuration of network topology90 parser.add_argument('--n-masters', dest='n_masters', help='number of master processes', default=1, type=int)91 parser.add_argument('--n-processes', dest='n_processes', help='number of processes per worker', default=1, type=int)92 parser.add_argument('--max-gpus', dest='max_gpus', help='max GPUs to use', type=int, default=1)93 # configuration of training process94 parser.add_argument('--epochs', help='number of training epochs', default=1, type=int)95 parser.add_argument('--loss',help='loss function',default='binary_crossentropy')96 add_target_options(parser)97 add_worker_options(parser)98 parser.add_argument('--sync-every', help='how often to sync weights with master', 99 default=1, type=int, dest='sync_every')100 parser.add_argument('--mode',help='Mode of operation.'101 'One of "downpour" (Downpour), "easgd" (Elastic Averaging SGD) or "gem" (Gradient Energy Matching)',default='gem',choices=['downpour','easgd','gem'])102 add_master_option(parser)103 add_gem_options(parser)104 add_easgd_options(parser)105 add_downpour_options(parser)106 107 add_loader_options(parser)108 109 add_log_option(parser)110 add_checkpoint_options(parser)111def make_loader( args, features_name, labels_name, train_list):112 data = H5Data( batch_size=args.batch,113 cache = args.caching_dir,114 copy_command = args.copy_command, 115 preloading = args.data_preload,116 features_name=features_name,117 labels_name=labels_name,118 )119 # We initialize the Data object with the training data list120 # so that we can use it to count the number of training examples121 data.set_full_file_names( train_list )...

Full Screen

Full Screen

MPIGDriver.py

Source:MPIGDriver.py Github

copy

Full Screen

...33 default='features', dest='features_name')34 parser.add_argument('--labels-name', help='name of HDF5 dataset with output labels',35 default='labels', dest='labels_name')36 parser.add_argument('--batch', help='batch size', default=100, type=int)37 add_loader_options(parser)38 # configuration of network topology39 parser.add_argument('--masters', help='number of master processes', default=1, type=int)40 parser.add_argument('--n-processes', dest='processes', help='number of processes per worker', default=1, type=int)41 parser.add_argument('--max-gpus', dest='max_gpus', help='max GPUs to use', 42 type=int, default=-1)43 parser.add_argument('--master-gpu',help='master process should get a gpu',44 action='store_true', dest='master_gpu')45 parser.add_argument('--synchronous',help='run in synchronous mode',action='store_true')46 # configuration of training process47 parser.add_argument('--epochs', help='number of training epochs', default=1, type=int)48 parser.add_argument('--optimizer',help='optimizer for master to use',default='adam')49 parser.add_argument('--loss',help='loss function',default='binary_crossentropy')50 parser.add_argument('--early-stopping', default=None,51 dest='early_stopping', help='Configuration for early stopping')...

Full Screen

Full Screen

options.py

Source:options.py Github

copy

Full Screen

1def add_loader_options(parser):2 parser.add_argument('--data_dir', default='../data', type=str, help="Data directory")3 parser.add_argument('--count_dir', default='../counts', type=str, help="Counts directory")4 parser.add_argument('--id', default="test", type=str, help="Data/counts subdirectory")5 parser.add_argument('--max_factor_dimensions', default=5, type=int, help="Max number of vars for clause")6 parser.add_argument('--batch_size', default=10, type=int, help="Number of formulae in each batch")7def add_model_options(parser):8 parser.add_argument('--msg_passing_iters', type=int, default=5, help="Number of BPNN iters")9 parser.add_argument('--learning_rate', type=float, default=0.0001, help="Initial learning rate")10 parser.add_argument('--step_size', type=int, default=200, help="Step size for the scheduler")11 parser.add_argument('--lr_decay', type=float, default=0.5, help="Learning rate decay for the scheduler")12 parser.add_argument('--damp_param_factor_var', type=float, default=0.5, help="Damping factor-to-variable messages")13 parser.add_argument('--damp_param_var_factor', type=float, default=0.5, help="Damping variable-to-factor messages")14 parser.add_argument('--neural_bp', type=eval, default=True,15 help="Whether to perform Neural Loopy Belief Propagation or standard Loopy Belief Propagation")...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run avocado automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful