예제 #1
0
def normalize_mnist(
    X_train: np.ndarray, X_test: np.ndarray
) -> Output(X_train_normed=np.ndarray, X_test_normed=np.ndarray):
    """Normalize the values for all the images so they are between 0 and 1"""
    X_train_normed = X_train / 255.0
    X_test_normed = X_test / 255.0
    return X_train_normed, X_test_normed
예제 #2
0
def importer() -> Output(X_train=np.ndarray,
                         y_train=np.ndarray,
                         X_test=np.ndarray,
                         y_test=np.ndarray):
    """Download the MNIST data store it as numpy arrays."""
    (X_train, y_train), (X_test, y_test) = tf.keras.datasets.mnist.load_data()
    return X_train, y_train, X_test, y_test
예제 #3
0
def importer_mnist() -> Output(
    X_train=np.ndarray, y_train=np.ndarray, X_test=np.ndarray, y_test=np.ndarray
):
    """Download the MNIST data store it as an artifact"""
    (X_train, y_train), (
        X_test,
        y_test,
    ) = tf.keras.datasets.mnist.load_data()
    return X_train, y_train, X_test, y_test
예제 #4
0
파일: run.py 프로젝트: aliabbasjaffri/zenml
def importer() -> Output(train_df=pd.DataFrame, test_df=pd.DataFrame):
    """Download the MNIST data store it as numpy arrays."""
    (X_train, y_train), (
        X_test,
        y_test,
    ) = tf.keras.datasets.boston_housing.load_data()
    train_df = convert_np_to_pandas(X_train, y_train)
    test_df = convert_np_to_pandas(X_test, y_test)
    return train_df, test_df
예제 #5
0
def dynamic_importer(
    config: ImporterConfig,
) -> Output(X_train=np.ndarray,
            y_train=np.ndarray,
            X_test=np.ndarray,
            y_test=np.ndarray):
    """Downloads the latest data from a mock API."""
    X_train, y_train = get_X_y_from_api(n_days=config.n_days, is_train=True)
    X_test, y_test = get_X_y_from_api(n_days=config.n_days, is_train=False)
    return X_train, y_train, X_test, y_test
예제 #6
0
 def some_step(shared_name: int) -> Output(shared_name=int):
     return shared_name
예제 #7
0
 def some_step() -> Output(some_output=int, some_other_output=str):
     pass
예제 #8
0
 def some_step() -> Output(some_output=int):
     pass