Пример #1
0
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)
Пример #2
0
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)