Giter VIP home page Giter VIP logo

lectures-labs's Introduction

Deep Learning course: lecture slides and lab notebooks

This course is being taught at as part of Master Year 2 Data Science IP-Paris

Table of contents

The course covers the basics of Deep Learning, with a focus on applications.

Lecture slides

Note: press "P" to display the presenter's notes that include some comments and additional references.

Lab and Home Assignment Notebooks

The Jupyter notebooks for the labs can be found in the labs folder of the github repository:

git clone https://github.com/m2dsupsdlclass/lectures-labs

These notebooks only work with keras and tensorflow Please follow the installation_instructions.md to get started.

Direct links to the rendered notebooks including solutions (to be updated in rendered mode):

Lab 1: Intro to Deep Learning

Lab 2: Neural Networks and Backpropagation

Lab 3: Embeddings and Recommender Systems

Lab 4: Convolutional Neural Networks for Image Classification

Lab 5: Deep Learning for Object Dection and Image Segmentation

Lab 6: Text Classification, Word Embeddings and Language Models

Lab 7: Sequence to Sequence for Machine Translation

Lab 8: Intro to PyTorch

Lab 9: Siamese Networks and Triplet loss

Lab 10: Variational Auto Encoder

Acknowledgments

This lecture is built and maintained by Olivier Grisel and Charles Ollion

Charles Ollion, head of research at Heuritech - Olivier Grisel, software engineer at Inria

We thank the Orange-Keyrus-Thalès chair for supporting this class.

License

All the code in this repository is made available under the MIT license unless otherwise noted.

The slides are published under the terms of the CC-By 4.0 license.

lectures-labs's People

Contributors

aabadie avatar arthurdouillard avatar charlesollion avatar jilljenn avatar mrahim avatar ogrisel avatar rth avatar tdhopper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lectures-labs's Issues

Clarification on embedding input dimension for Recommender system

Dear Olivier,

Thank you for the lab tutorial on recommender system, it was really helpful.

While going through and study your lab tutorial on Explicit Feedback Neural Recommender System : https://github.com/m2dsupsdlclass/lectures-labs/blob/master/labs/03_neural_recsys/Explicit_Feedback_Neural_Recommender_System_rendered.ipynb

I would like to check with you whether there is a mistake on the code below :

self.user_embedding = Embedding(output_dim=embedding_size,
input_dim=max_user_id + 1,
input_length=1,
name='user_embedding')
self.item_embedding = Embedding(output_dim=embedding_size,
input_dim=max_item_id + 1,
input_length=1,
name='item_embedding')

Should the input_dim be max_user_id (instead of max_user_id+1) since the dataset is only start from 1 to 943 , ie there are total of 943 user in the dataset hence there is no need to + 1 ?

min_user_id = all_ratings['user_id'].min()
min_user_id
Out[7]:
1

max_user_id = all_ratings['user_id'].max()
max_user_id
Out[8]:
943

The same applies to the item_embedding as well.

Look forward to your reply.

Thanks

SoftmaxMap/Softmax4d seems not working for the newest version of Keras?

Hi,

I'm using the 'SoftmaxMap' of here (I've modified it slightly in accordance with the Keras Documentation):

from keras.engine import Layer
import keras.backend as K

class SoftmaxMap(Layer):
    # Init function
    def __init__(self, axis=-1, **kwargs):
        self.axis = axis
        super(SoftmaxMap, self).__init__(**kwargs)
    def build(self,input_shape):
        pass
    def call(self, x, mask=None):
        e = K.exp(x - K.max(x, axis=self.axis, keepdims=True))
        s = K.sum(e, axis=self.axis, keepdims=True)
        return e / s
    def compute_output_shape(self, input_shape):
        return input_shape

I'm doing this because I'd like to run a fully convolutional network with Keras (see the following for the network structure)

model = Sequential()

#conv1
model.add(Conv2D(filters=96, kernel_size=(11, 11),
                 strides=(4,4),
                 padding='valid',
                 input_shape=(None,None,3)
                )
         )
model.add(Activation('relu'))
#pooling1
model.add(MaxPooling2D(pool_size=(3, 3),
                       strides=(2,2),
                       padding='valid'
                      )
         )
#conv2
model.add(Conv2D(filters=256, kernel_size=(5, 5),
                 strides=(1,1),
                 padding='same'
                )
         )
model.add(Activation('relu'))
#pooling2
model.add(MaxPooling2D(pool_size=(3, 3),
                       strides=(2,2),
                       padding='valid'
                      )
         )
#conv3
model.add(Conv2D(filters=384, kernel_size=(3, 3),
                 strides=(1,1),
                 padding='same'
                )
         )
model.add(Activation('relu'))
#conv4
model.add(Conv2D(filters=384, kernel_size=(3, 3),
                 strides=(1,1),
                 padding='same'
                )
         )
model.add(Activation('relu'))
#conv5
model.add(Conv2D(filters=256, kernel_size=(3, 3),
                 strides=(1,1),
                 padding='same'
                )
         )
model.add(Activation('relu'))
#pooling3
model.add(MaxPooling2D(pool_size=(3, 3),
                       strides=(2,2),
                       padding='valid'
                      )
         )
#conv6
model.add(Conv2D(filters=4096, kernel_size=(6, 6),
                 strides=(1,1),
                 padding='valid'
                )
         )
model.add(Activation('relu'))
#conv7
model.add(Conv2D(filters=4096, kernel_size=(1, 1),
                 strides=(1,1),
                 padding='valid'
                )
         )
model.add(Activation('relu'))
#conv8
model.add(Conv2D(filters=2, kernel_size=(1, 1),
                 strides=(1,1),
                 padding='valid'
                )
         )
#model.add(Flatten())
#model.add(GlobalAveragePooling2D())
#model.add(Activation('softmax'))
    
model.add(SoftmaxMap(axis=-1))

model.compile(loss='categorical_crossentropy',
              optimizer=SGD(lr=0.005,momentum=0.3),
              metrics=['accuracy'])

However, I got an error while fitting the model:

ValueError: Error when checking target: expected softmax_map_1 to have 4 dimensions, but got array with shape (128, 2)

which is quite weird. I'm using Tensorflow 1.2.1. Any suggestions?

Predict_classes

'Sequential' object has no attribute 'predict_classes'

This function were removed in TensorFlow version 2.6.

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.