Example #1
0
import sys
sys.path.append("../")
from utils.utils import get_early_diff_path, read_data, pd
import matplotlib.pyplot as plt
from scipy.stats.mstats import zscore

sensors = ['tangential_strain']
for sensor in sensors:
    print sensor

    test_reader = pd.read_csv(get_early_diff_path("test_60_explosion"))
    test_data, test_labels = read_data(test_reader, sensor, pre=True)

    label = [
        0, 1, 1, 2, 1, 0, 0, 0, 2, 1, 1, 2, 0, 4, 0, 2, 2, 1, 1, 1, 3, 2, 0, 3,
        2, 0, 4, 1
    ]

    high_possible_index = [
        623, 637, 1335, 3892, 4475, 6916, 9754, 13150, 13548, 13801, 18367,
        19010, 20799, 22174, 22564, 22927, 24272, 28318, 28360, 30189, 32744,
        32861, 33364, 34895, 39462, 41735, 44862, 47834
    ]

    deflation = [
        0.0, -29.03, -32.7, -34.23, -21.6, 0.0, 0.0, 0.0, -12.19, -24.12,
        -36.21, -18.16, 0.0, -24.12, 0.0, -33.67, -15.56, -27.93, -32.96,
        -14.45, -28.35, -60.14, 0.0, -50.28, -29.79, 0.0, -50.28, -29.22
    ]

    new_label = []
Example #2
0
        # Optimizer
        # optimizer = tf.train.AdamOptimizer().minimize(loss)
        optimizer = tf.train.AdamOptimizer(learning_rate).minimize(loss)

        # Prediction
        prediction = tf.nn.sigmoid(logits)
    """
    Data loading
    """
    training_set = "training_60_explosion"
    validation_set = "valid_60_explosion"
    sensor = "radial_strain"

    print("Data loading")
    print(sensor)
    training_reader = pd.read_csv(utils.get_early_diff_path(training_set))
    # print len(training_reader)
    # training_reader = training_reader[training_reader.current_labels == 0]
    # print len(training_reader)
    train_data, train_labels = utils.read_data(training_reader,
                                               sensor,
                                               num_steps=config.num_steps,
                                               dim=config.input_size,
                                               pre=True)

    validation_reader = pd.read_csv(utils.get_early_diff_path(validation_set))
    # print len(validation_reader)
    # validation_reader = validation_reader[validation_reader.current_labels == 0]
    # print len(validation_reader)
    validation_data, validation_labels = utils.read_data(
        validation_reader,