def main(): # Setting up the connection to interface ip = "interfaceeae.doc.ic.ac.uk" port = 443 eae = eAE(ip, port) # Testing if the interface is Alive is_alive = eae.is_eae_alive() if is_alive != 200: raise Exception("!!!") # Initialize input argument for each node in the eAE cluster args = [ '--data_dir data/eeg_fpz_cz --output_dir results --n_folds 20 --fold_idx {} --pretrain_epochs 100 --finetune_epochs 200' .format(fold_idx) for fold_idx in range(20) ] # Submit a job parameters_set = "\n".join(args) cluster = "gpu" computation_type = "GPU" main_file = "train.py" data_files = ['deepsleep', 'tensorlayer', 'data/eeg_fpz_cz'] host_ip = "host_ip_address" # IP address of the machine to run this script ssh_port = "ssh_port" # Port for ssh job = eae.submit_jobs(parameters_set, cluster, computation_type, main_file, data_files, host_ip, ssh_port) print(job)
def main(): db = TensorDB(ip='146.169.33.34', port=27020, db_name='TransferGan', user_name='akara', password='******', studyID="MNIST") create_mnist_dataset(db=db) create_jobs(db=db, job_name="cv_mnist", models_dict={ "cnn": { "lr": [0.01, 0.001, 0.001], "n_cnn_layers": [1, 2, 2], "n_filters": [64, 128, 256], "n_epochs": [10, 10, 10], }, "mlp": { "lr": [0.05, 0.0001], "n_layers": [1, 2], "n_epochs": [10, 10], } }) # Setting up the connection to interface ip = "interfaceeae.doc.ic.ac.uk" port = 443 eae = eAE(ip, port) # Testing if the interface is Alive is_alive = eae.is_eae_alive() if is_alive != 200: raise Exception("!!!") # Get all jobs jobs = db.get_all_jobs() args = [str(j['_id']) for j in jobs] # We submit a dummy job parameters_set = "\n".join(args) cluster = "gpu_dev" computation_type = "GPU" main_file = "/home/akara/Workspace/tl_paper/tutorial_tensordb_cv_mnist_worker.py" data_files = ['/home/akara/Workspace/tl_paper/tensorlayer'] host_ip = "dsihuaweiroom.doc.ic.ac.uk" ssh_port = "22" job = eae.submit_jobs(parameters_set, cluster, computation_type, main_file, data_files, host_ip, ssh_port) print(job)
def main(): # db = TensorDB(ip='146.169.33.34', port=27020, db_name='DRL', user_name='tensorlayer', password='******', studyID="20170524_1") db = TensorDB(ip='146.169.15.140', port=27017, db_name='DRL', user_name=None, password=None, studyID="1") # Create jobs n_jobs = 5 for j in range(n_jobs): args = { "id": j, "name": "Deep Reinforcement Learning", "file": "tutorial_tensordb_atari_pong_generator.py", "args": "", } db.submit_job(args=args) # Setting up the connection to interface ip = "interfaceeae.doc.ic.ac.uk" port = 443 eae = eAE(ip, port) # Testing if the interface is Alive is_alive = eae.is_eae_alive() if is_alive != 200: raise Exception("!!!") # Get all jobs jobs = db.get_jobs(status=JobStatus.WAITING) for j in jobs: # Start worker parameters_set = "--job_id={}".format(str(j["_id"])) cluster = "gpu" computation_type = "GPU" main_file = j["file"] data_files = ['tensorlayer'] host_ip = "dsigpu2.ict-doc.ic.ac.uk" ssh_port = "22222" job = eae.submit_jobs(parameters_set, cluster, computation_type, main_file, data_files, host_ip, ssh_port) db.change_job_status(job_id=j["_id"], status=JobStatus.RUNNING) print(job)
def main(): # This is to initialize the connection to your MondonDB server # Note: make sure your MongoDB is reachable before changing this line db = TensorDB(ip='IP_ADDRESS_OR_YOUR_MONGODB', port=27017, db_name='DATABASE_NAME', user_name=None, password=None, studyID='ANY_ID (e.g., mnist)') create_mnist_dataset(db=db) create_jobs(db=db, job_name="cv_mnist", models_dict={ "cnn": { "lr": [0.01, 0.001, 0.001], "n_cnn_layers": [1, 2, 2], "n_filters": [64, 128, 256], "n_epochs": [10, 10, 10], }, "mlp": { "lr": [0.05, 0.0001], "n_layers": [1, 2], "n_epochs": [10, 10], } }) # Setting up the connection to interface ip = "IP_ADDRESS_OF_EAE (e.g., interfaceeae.doc.ic.ac.uk)" port = 443 eae = eAE(ip, port) # Testing if the interface is Alive is_alive = eae.is_eae_alive() if is_alive != 200: raise Exception("!!!") # Get all jobs jobs = db.get_all_jobs() args = [str(j['_id']) for j in jobs] # We submit a dummy job parameters_set = "\n".join(args) cluster = "NAME_OF_CLUSTER (e.g., gpu_dev)" computation_type = "COMPUTATION_TYPE (e.g., GPU)" main_file = "ABSOLUTE_PATH_TO_MAIN_FILE" data_files = ['ABSOLUTE_PATH_TO_DIRECTORY_OR_FILES_TO_BE_COPIED_TO_RUN_THE_MAIN_FILE'] host_ip = "IP_ADDRESS_OF_HOST_MACHINE_RUNNING_THIS_SCRIPT" ssh_port = "SSH_PORT_OF_HOST_MACHINE" job = eae.submit_jobs(parameters_set, cluster, computation_type, main_file, data_files, host_ip, ssh_port) print(job)
# We import the eAE package import time from eAE import eAE directory = '' # We create the connection to the backend eae = eAE.eAE("admin", "admin", "127.0.0.1") # We list the jobs with their associated parameters parameters = ["first_analysis_type 0 1"] # We list the required files for the analysis to be sent to the back-end data_files = ["job.py", "faust.txt"] # We submit a job answer = eae.submit_jobs("python2", "job.py", parameters, data_files) # We check that the submission has been successful print(answer) """ answer = { "status": "OK", "jobID": "5c47530c6ad68800121c72be", "jobPosition": 1, "carriers": [ "carrier:3000" ] } """