<jupyter_start><jupyter_text>Table of Contents1&nbsp;&nbsp;Load Data2&nbsp;&nbsp;Build the Model<jupyter_code>%load_ext autoreload
%autoreload 2
import csv
from helper.foo import foo
from helper.model import build_model
import keras
import cv2
import numpy as np
import keras<jupyter_output>Using TensorFlow backend.<jupyter_text>Load Data<jupyter_code>LOG_PATH = './data/driving_log.csv'
lines = []
with open(LOG_PATH) as f:
    reader = csv.reader(f)
    for line in reader:
        lines.append(line)
        
images = []
measurements = []
for line in lines:
    source_path = line[0]
    filename = source_path.split('/')[-1]
    current_path = './data/IMG/' + filename
    image = cv2.imread(current_path)
    images.append(image)
    measurements.append(line[3])
X_train = np.array(images)
y_train = np.array(measurements)
print('X_train: {}, y_train: {}'.format(X_train.shape, y_train.shape))
X_train[0].shape<jupyter_output><empty_output><jupyter_text>Build the Model<jupyter_code>model = build_model()
model.summary()
model.compile(loss='mse', optimizer='adam')
model.fit(X_train, y_train, validation_split=0.2, shuffle=True, nb_epoch=3)
model.save('model.h5')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13261050875729774, 'fraction_numerical': 0.010842368640533779, 'mean_word_length': 5.666666666666667, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '309738', 'license': 'MIT', 'n_tokens_mistral': 438, 'n_tokens_neox': 432, 'n_words': 83, 'path': 'notebook.ipynb', 'repo_name': 'mikeliao97/CARND-BEHAVIORAL-CLONING', 'size': '1199'}