Skip to content

Commit

Permalink
translate comment
Browse files Browse the repository at this point in the history
  • Loading branch information
HanNayeoniee committed Jul 2, 2023
1 parent 35464da commit eaa86d8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/source/ko/perplexity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,8 @@ for begin_loc in tqdm(range(0, seq_len, stride)):
with torch.no_grad():
outputs = model(input_ids, labels=target_ids)

# loss is calculated using CrossEntropyLoss which averages over valid labels
# N.B. the model only calculates loss over trg_len - 1 labels, because it internally shifts the labels
# to the left by 1.
# 손실은 모든 유효한 레이블에 대한 평균값을 구하는 교차 엔트로피(cross entropy)로 계산됩니다.
# 나이브 베이지안 모델은 내부적으로 레이블을 왼쪽으로 1개씩 밀기 때문에, (타켓 - 1)개 만큼의 레이블에 대해 손실을 계산합니다.
neg_log_likelihood = outputs.loss

nlls.append(neg_log_likelihood)
Expand Down

0 comments on commit eaa86d8

Please sign in to comment.