aboutsummaryrefslogblamecommitdiffstats
path: root/dlstuff/.two.py.swp
blob: 3e75bd66eb7f6296808fcb06f7d66418d03d514f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
b0VIM 8.0	�[�t"^&bloodstalkerlocalhost.localdomain~bloodstalker/extra/seer/dlstuff/two.pyutf-8
3210#"! Utpmad��m��������p]D+
������k*�
|
T
S

�����oM'���B�
�
�
�
�
�
�
f
:

�	�	[	B	,				����H��~}]����iM'&���T=/������lQD%���n7������    main()if __name__ == "__main__":        premain(argparser)    else:            shell.interact(banner="DEBUG REPL")            shell = code.InteractiveConsole(variables)            variables.update(locals())            variables = globals().copy()            if e.message: print(e.message)            print(e.__doc__)        except Exception as e:            premain(argparser)        try:    if argparser.args.dbg:    argparser = Argparser()def main():    print(results)    results = model.evaluate(x_test, y_test)    model.fit(x_train, y_train, epochs=4, batch_size=512)    '''    plot_acc(history)    plt.clf()    plot_loss(history)    history = model.fit(partial_x_train, partial_y_train, epochs=20, batch_size=512, validation_data=(x_val, y_val))    '''    model.compile(optimizer="rmsprop", loss="binary_crossentropy", metrics=["acc"])    partial_y_train = y_train[10000:]    y_val = y_train[:10000]    partial_x_train = x_train[10000:]    x_val = x_train[:10000]    model.add(layers.Dense(1, activation="sigmoid"))    model.add(layers.Dense(16, activation="relu"))    model.add(layers.Dense(16, activation="relu", input_shape=(10000,)))    model = models.Sequential()    y_test = np.asarray(test_labels).astype("float32")    y_train = np.asarray(train_labels).astype("float32")    x_test = vectorize_sequences(test_data)    x_train = vectorize_sequences(train_data)    (train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words=10000)    #here    signal.signal(signal.SIGINT, SigHandler_SIGINT)def premain(argparser):# write code here    plt.show()    plt.legend()    plt.ylabel("Acc")    plt.xlabel("Epochs")    plt.title("training and validation acc")    plt.plot(epochs, val_acc_values, "b", label="Validation Acc")    plt.plot(epochs, acc_values, "bo", label="Training Acc")    epochs = range(1, len(history_dic["acc"]) + 1)    val_acc_values = history_dic["val_acc"]    acc_values = history_dic["acc"]    history_dic = history.historydef plot_acc(history):    plt.show()    plt.legend()    plt.ylabel("Loss")    plt.xlabel("Epochs")    plt.title("training and validation loss")    plt.plot(epochs, val_loss_values, "b", label="Validation Loss")    plt.plot(epochs, loss_values, "bo", label="Training Loss")    epochs = range(1, len(history_dic["loss"]) + 1)    val_loss_values = history_dic["val_loss"]    loss_values = history_dic["loss"]    history_dic = history.historydef plot_loss(history):    return results        results[i, sequence] = 1.    for i, sequence in enumerate(sequences):    results = np.zeros((len(sequences), dimension))def vectorize_sequences(sequences, dimension=10000):        self.args = parser.parse_args()        parser.add_argument("--dbg", action="store_true", help="debug", default=False)        parser.add_argument("--bool", action="store_true", help="bool", default=False)        parser.add_argument("--string", type=str, help="string")        parser = argparse.ArgumentParser()    def __init__(self):class Argparser(object):    sys.exit(0)    print()def SigHandler_SIGINT(signum, frame):import matplotlib.pyplot as pltfrom keras import layersfrom keras import modelsimport numpy as npfrom keras.datasets import imdbimport sysimport signalimport readlineimport codeimport argparse# _*_ coding=utf-8 _*_#!/usr/bin/python3