GithubHelp home page GithubHelp logo

carnd-behavioural-cloning's Introduction

carnd-behavioural-cloning

carnd-behavioural-cloning's People

Contributors

mxbi avatar

Watchers

 avatar  avatar

carnd-behavioural-cloning's Issues

Question About your generator

hello michel how are you, hoping you're fine,
about your generator, when you did that:

chunk = df.sample(n=batch_size).reset_index(drop=True)

the model has every time it can take a single image several times in a single epoch, is it not going to overfit ?
(it can't take all images in the training Set)

  • This is my implementation for the generator:

class DataGenerator(Sequence):
def init(self, X_train, labels, batch_size=32, aug=False, shuffle=True):

    self.aug = aug
    self.batch_size = batch_size
    self.labels = labels
    self.X_train = X_train
    self.shuffle = shuffle
    self.on_epoch_end()
    
def __len__(self):
    return int(np.floor(len(self.X_train) / self.batch_size))

def __getitem__(self, index):
    'Generate one batch of data'
    # Generate indexes of the batch
    indexes = self.indexes[index*self.batch_size:(index+1)*self.batch_size]
    X, y = self.__data_generation(indexes)

    return X, y

def on_epoch_end(self):
    'Updates indexes after each epoch'
    self.indexes = np.arange(len(self.X_train))
    if self.shuffle == True:
        np.random.shuffle(self.indexes)

def __data_generation(self, list_IDs_temp):

    #idx = np.random.choice(len(X), batch_size, replace=False)
    batch = pd.DataFrame(data=self.X_train[list_IDs_temp], columns=['center', 'left','right'])
    batch['steering'] = pd.Series(self.labels[list_IDs_temp])

    X, y = load_and_augment(batch, trans=self.aug)
    # The augmentation has created thousands of images from our selected 32
    # Here, we select a random few to be in the actual batch
    idx = np.random.choice(X.shape[0], self.batch_size, replace=False)
    X = X[idx, :, :, :]
    y = y[idx]
    
    return X,y

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.