#AUTOGENERATED! DO NOT EDIT! File to edit: dev/demo.ipynb (unless otherwise specified).

__all__ = ['build_model', 'autoencoder', 'plot_acc', 'plot_loss']

#Cell
from keras.models import Model
from keras.layers import Dense, Input

def build_model(input_dim = 29, outer_layer_dim = 14, inner_layer_dim = 7):

    input_layer = Input(shape=(input_dim,))
    encoder =  Dense(units=outer_layer_dim, activation='relu')(input_layer)
    encoder = Dense(units=inner_layer_dim, activation='relu')(encoder)
    decoder = Dense(units=inner_layer_dim)(encoder)
    decoder = Dense(units=outer_layer_dim)(decoder)
    decoder = Dense(units=input_dim)(decoder)
    autoencoder = Model(inputs=input_layer, outputs = decoder)
    return autoencoder
autoencoder = build_model(input_dim = 29, outer_layer_dim = 14, inner_layer_dim = 7)

#Cell
import matplotlib.pyplot as plt

def plot_acc(history):

    plt.plot(history['accuracy'])
    plt.plot(history['val_accuracy'])
    plt.legend(['training', 'validation'], loc='upper left')
    plt.title('Training and validation accuracy')
    plt.show()

#Cell
import matplotlib.pyplot as plt

def plot_loss(history):

    plt.plot(history['loss'])
    plt.plot(history['val_loss'])
    plt.legend(['training', 'validation'], loc='upper left')
    plt.title('Training and validation loss')
    plt.show()