# Add a split training_pipeline.add_split( CategoricalDomainSplit(categorical_column="name", split_map={ 'train': ["arnold", "nicholas"], 'eval': ["lülük"] })) # Add a preprocessing unit training_pipeline.add_preprocesser( StandardPreprocesser(features=["name", "age"], labels=['gpa'], overwrite={ 'gpa': { 'transform': [{ 'method': 'no_transform', 'parameters': {} }] } })) # Add a trainer training_pipeline.add_trainer( FeedForwardTrainer(batch_size=1, loss='binary_crossentropy', last_activation='sigmoid', output_units=1, metrics=['accuracy'], epochs=i))
training_pipeline = TrainingPipeline(name='GCP Orchestrated') # Add a datasource. This will automatically track and version it. ds = CSVDatasource(name='Pima Indians Diabetes', path='gs://zenml_quickstart/diabetes.csv') training_pipeline.add_datasource(ds) # Add a split training_pipeline.add_split(RandomSplit( split_map={'train': 0.7, 'eval': 0.3})) # Add a preprocessing unit training_pipeline.add_preprocesser( StandardPreprocesser( features=['times_pregnant', 'pgc', 'dbp', 'tst', 'insulin', 'bmi', 'pedigree', 'age'], labels=['has_diabetes'], overwrite={'has_diabetes': { 'transform': [{'method': 'no_transform', 'parameters': {}}]}} )) # Add a trainer training_pipeline.add_trainer(FeedForwardTrainer( loss='binary_crossentropy', last_activation='sigmoid', output_units=1, metrics=['accuracy'], epochs=20)) # Add an evaluator training_pipeline.add_evaluator( TFMAEvaluator(slices=[['has_diabetes']],
from examples.gan.preprocessing import GANPreprocessor repo: Repository = Repository().get_instance() gan_pipeline = TrainingPipeline(name="whynotletitfly", enable_cache=False) try: ds = ImageDatasource( name="gan_images", base_path="/Users/nicholasjunge/workspaces/maiot/ce_project/images_mini" ) except: ds = repo.get_datasource_by_name('gan_images') gan_pipeline.add_datasource(ds) gan_pipeline.add_split( CategoricalDomainSplit(categorical_column="label", split_map={ "train": [0], "eval": [1] })) gan_pipeline.add_preprocesser(GANPreprocessor()) # gan_pipeline.add_preprocesser(transform_step) gan_pipeline.add_trainer(CycleGANTrainer(epochs=5)) gan_pipeline.run()