<jupyter_start><jupyter_text>I will now break the data into windows<jupyter_code>def create_target(batch):
    X = batch[ :, :-1] #first elements for X
    y = batch[ :, 1:] # last elements for y
    return X, y
def batch_dataset(data, window_size=50, window_shift=25):
    data_set = []
    i=0
    while window_shift*i+window_size<len(data)+1:
        window = data[window_shift*i:window_shift*i+window_size]
        data_set.append(np.array(window))
        i+=1
    shuffle(data_set)
    return np.array(data_set).reshape(len(data_set),window_size,1)
batched_temp_min_train = batch_dataset(temp_min_train)
batched_temp_min_valid = batch_dataset(temp_min_valid)
batched_temp_min_test = batch_dataset(temp_min_test)
batched_temp_min_train.shape
X_train, y_train = create_target(batched_temp_min_train)
X_valid, y_valid = create_target(batched_temp_min_valid)
X_test, y_test = create_target(batched_temp_min_test)
X_train[0]
y_train[0]
X_train.shape,y_train.shape<jupyter_output><empty_output><jupyter_text>All good! Time to train! I will start a group of convolutions,2 GRUs for long term and and output dense with no activation<jupyter_code>model = keras.models.Sequential([
    keras.layers.Conv1D(32, kernel_size=2, padding="causal", activation="relu"),
    keras.layers.BatchNormalization(),
    keras.layers.Conv1D(48, kernel_size=2, padding="causal", activation="relu", dilation_rate=2),
    keras.layers.BatchNormalization(),
    keras.layers.Conv1D(64, kernel_size=2, padding="causal", activation="relu", dilation_rate=4),
    keras.layers.BatchNormalization(),
    keras.layers.Conv1D(96, kernel_size=2, padding="causal", activation="relu", dilation_rate=8),
    keras.layers.BatchNormalization(),
    keras.layers.GRU(20, return_sequences = True), 
    keras.layers.GRU(20, return_sequences = True), 
    keras.layers.TimeDistributed( keras.layers.Dense(1, activation = None)) ])
early_stopping_cb = keras.callbacks.EarlyStopping(patience=10, restore_best_weights=True)
model.compile( loss ="mse", optimizer ="adam") 
history = model.fit( X_train, y_train, epochs = 1000, validation_data =( X_valid, y_valid),callbacks=[early_stopping_cb])
model.evaluate(X_test,y_test)
pred = model.predict(X_test)<jupyter_output><empty_output><jupyter_text>Great!<jupyter_code>np.save("Min_Temp_pred_2",pred)
np.save("Min_Temp_y_2", y_test)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12420785804816223, 'fraction_numerical': 0.019011406844106463, 'mean_word_length': 6.713355048859935, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '548804', 'license': 'Apache-2.0', 'n_tokens_mistral': 893, 'n_tokens_neox': 857, 'n_words': 138, 'path': 'SeatteWaveNetAndGRU1.ipynb', 'repo_name': 'HLovisiEnnes/Mini_Projects', 'size': '2367'}