본문 바로가기

deeplearning3

[DL] Transformer Transformer Model : A transformer model is a neural network that learns context and thus meaning by tracking relationships in sequential data like the words in this sentence. A transformer is a deep learning model that adopts the mechanism of self-attention, differentially weighting the significance of each part of the input data. It is used primarily in the fields of natural language processing.. 2023. 3. 3.
[DL] options in DeepLearning ( Transfer learning) num_workers x.view() F.log_softmax(x, dim=1) lr = 0.001 eval() to.(DEVICE) fc.in_features lr_scheduler.StepLR() zero_grad set_grad_enabled max(outputs, 1) trainable=False [np.newaxis, ...] argmax() axis=-1 untar = True #1 num_workers val_loader = torch.utils.data.DataLoader(val_dataset, batch_size = BATCH_SIZE, shuffle =True, num_workers = 4) In PyTorch, num_workers is an argument in the DataLoa.. 2023. 2. 16.
[DL] Deep Learning Scratch 목차 순방향 XOR 역전파 ( Loss 함수 ) STEP01 순방향 : 아래의 코드는, 순방향이 어느 것인지 이해를 돕기위한 단순 프로세스이다. 가중치를 랜덤하게 잡을 일은 없다. # numpy에는 sigmoid없으니 직접 함수로 만들어준다. def sigmoid(x): return 1.0 / (1.0 + np.exp(-x)) # 가중치를 랜덤하게 선택하자. (원래는 학습이 완료된 가중치를 사용해야 한다.) # 원래는 양수의 값만 나와서, 2를 곱하고 -1을 해서 음수 값도 만들어준다. # (1,3)은 1,3의 크기를 가지게 하는 것. X하나만 보면 3개의 값이 있어서 W = 2*np.random.random((1,3)) -1 # 추론 # X의 첫번째 줄과 W를 곱한 값. 마지막만 1이니 W의 마지막 *.. 2023. 2. 13.