Exemple #1
0
                       last_activation='sigmoid',
                       output_units=1,
                       metrics=['accuracy'],
                       epochs=20).with_backend(training_backend))

# Add an evaluator
training_pipeline.add_evaluator(
    TFMAEvaluator(
        slices=[['has_diabetes']],
        metrics={'has_diabetes': ['binary_crossentropy', 'binary_accuracy']}))

# Define the metadata store
metadata_store = MySQLMetadataStore(
    host=MYSQL_HOST,
    port=int(MYSQL_PORT),
    database=MYSQL_DB,
    username=MYSQL_USER,
    password=MYSQL_PWD,
)

# Define the artifact store
artifact_store = ArtifactStore(
    os.path.join(GCP_BUCKET, 'gcp_gcaip_training/artifact_store'))

# Define the orchestrator backend
orchestrator_backend = OrchestratorGCPBackend(
    cloudsql_connection_name=GCP_CLOUD_SQL_INSTANCE_NAME, project=GCP_PROJECT)

# Run the pipeline
training_pipeline.run(
    backend=orchestrator_backend,
Exemple #2
0

# Define the orchestrator backend
orchestrator_backend = OrchestratorGCPBackend(
    cloudsql_connection_name=cloudsql_connection_name,
    project=project)

# Define the training backend
training_backend = SingleGPUTrainingGCAIPBackend(
    project=project,
    job_dir=training_job_dir)

# Define the metadata store
metadata_store = MySQLMetadataStore(
    host='127.0.0.1',
    port=3306,
    database=mysql_db,
    username=mysql_user,
    password=mysql_pw,
)

# Define the artifact store
artifact_store = ArtifactStore(artifact_store_path)

# Run the pipeline
training_pipeline.run(
    backends=[orchestrator_backend, training_backend],
    metadata_store=metadata_store,
    artifact_store=artifact_store,
)
Exemple #3
0
training_pipeline.add_evaluator(
    TFMAEvaluator(
        slices=[['has_diabetes']],
        metrics={'has_diabetes': ['binary_crossentropy', 'binary_accuracy']}))

# Important details:
artifact_store_bucket = 'gs://rndm-strg/zenml-k8s-test/'

mysql_host = 'cloudsql'
mysql_port = 3306
mysql_db = 'zenml'
mysql_user = USERNAME
mysql_pw = PASSWORD

# Path to your kubernetes config:
k8s_config_path = os.path.join(os.environ["HOME"], '.kube/config')

# Run the pipeline on a Kubernetes Cluster
training_pipeline.run(backends=[
    OrchestratorKubernetesBackend(kubernetes_config_path=k8s_config_path,
                                  image_pull_policy="Always")
],
                      metadata_store=MySQLMetadataStore(
                          host=mysql_host,
                          port=mysql_port,
                          database=mysql_db,
                          username=mysql_user,
                          password=mysql_pw,
                      ),
                      artifact_store=ArtifactStore(artifact_store_bucket))