示例#1
0
                                     'parameters': {}
                                 }]
                             }
                         }))

# Add a trainer
training_pipeline.add_trainer(
    TFFeedForwardTrainer(loss='binary_crossentropy',
                         last_activation='sigmoid',
                         output_units=1,
                         metrics=['accuracy'],
                         epochs=20))

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

# Run the pipeline locally
training_pipeline.run()

# See schema of data
training_pipeline.view_schema()

# See statistics of train and eval
training_pipeline.view_statistics()

# Creates a notebook for evaluation
training_pipeline.evaluate()
示例#2
0
                         overwrite={
                             'has_diabetes': {
                                 'transform': [{
                                     'method': 'no_transform',
                                     'parameters': {}
                                 }]
                             }
                         }).with_backend(processing_backend))

# Add a trainer
training_pipeline.add_trainer(
    TFFeedForwardTrainer(loss='binary_crossentropy',
                         last_activation='sigmoid',
                         output_units=1,
                         metrics=['accuracy'],
                         epochs=20))

# Add an evaluator
training_pipeline.add_evaluator(
    TFMAEvaluator(slices=[['has_diabetes']],
                  metrics={
                      transformed_label_name('has_diabetes'):
                      ['binary_crossentropy', 'binary_accuracy']
                  }).with_backend(processing_backend))
# Define the artifact store
artifact_store = ArtifactStore(
    os.path.join(GCP_BUCKET, 'dataflow_processing/artifact_store'))

# Run the pipeline
training_pipeline.run(artifact_store=artifact_store)
示例#3
0
                                 }]
                             }
                         }))

training_pipeline.add_trainer(
    TFFeedForwardTrainer(loss='binary_crossentropy',
                         last_activation='sigmoid',
                         output_units=1,
                         metrics=['accuracy'],
                         epochs=20))

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

# Add the deployer
training_pipeline.add_deployment(
    GCAIPDeployer(
        project_id=GCP_PROJECT,
        model_name=MODEL_NAME,
    ))

# Run the pipeline
training_pipeline.run()

# Another way to do is is to create a DeploymentPipeline.
# Uncomment to create the model via this pipeline
示例#4
0
                             'has_diabetes': {
                                 'transform': [{
                                     'method': 'no_transform',
                                     'parameters': {}
                                 }]
                             }
                         }).with_backend(processing_backend))

# Add a trainer
training_pipeline.add_trainer(
    TFFeedForwardTrainer(loss='binary_crossentropy',
                         last_activation='sigmoid',
                         output_units=1,
                         metrics=['accuracy'],
                         epochs=20))

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

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

# Run the pipeline
training_pipeline.run(artifact_store=artifact_store)