Below is the step by step explaination of the sequence to sequence model using convolution.

Each block of code is explained in detail

Step1.Tokenize English and German text from a string into a list of strings

def tokenize_de(text):

return [tok.text for tok in spacy_de.tokenizer(text)]

def tokenize_en(text):

return [tok.text for tok in spacy_en.tokenizer(text)]

Step2:

The below diagram explains encoder convolution:

Encoder Convolution:

I have explored a few PyTorch functions:

These 5 functions can be found in:

https://jovian.ml/sudhakarmlal/01-tensor-operations

An short introduction about PyTorch and about these functions are as follows

  • torch.zeros : creates an tensor(out of matrix) with all values 0
  • torch.view : re-sizes the tensor to specific dimension
  • torch.add : adds two tensors
  • torch.copy_ : copies one tensor to the other
  • torch.to : to move the tensor to a specific device…

Sudhakar Reddy

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store