BaşlayınÜcretsiz Başlayın

PyTorch Transformers

Now you're familiar with the different components of the transformer architecture, it's time to define one! The torch.nn module, imported for you as nn, provides a really nice way to do this in just a few lines of code.

Bu egzersiz

Transformer Models with PyTorch

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Define a transformer with 8 attention heads, 6 encoder and decoder layers, and for input sequence embeddings of length 1536.
  • Print the model object to view the model architecture.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Define the transformer model
model = ____

# Print the model object
print(____)
Kodu Düzenle ve Çalıştır