Skip to content
Snippets Groups Projects
Commit 68b98266 authored by umlauf's avatar umlauf
Browse files

rm file

parent a65c9137
No related branches found
No related tags found
No related merge requests found
import torch
import tqdm
import numpy as np
import evaluation
import evaluate
import json
import random
import math
from tqdm.auto import tqdm
from transformers import BertTokenizer, RobertaTokenizer, BertModel, RobertaModel, RobertaPreTrainedModel, RobertaConfig, BertConfig, BertPreTrainedModel, PreTrainedModel, AutoModel, AutoTokenizer
from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset
from transformers import AdamW, get_scheduler
from torch import nn
from torch.nn import CrossEntropyLoss
import matplotlib.pyplot as plt
import os
import pandas as pd
import sklearn
logits = tensor([[ 0.4902, -0.4691]])
target = tensor([0.])
print(torch.nn.Softmax(logits, dim=1))
# def cross_entropy(logits, target):
# y_pred = torch.nn.Softmax(logits, dim=1) #functional. für was functional?
# #find higher pred? For more proable class?
# print(y_pred)
# loss = -torch.sum(target * y_pred, dim=1)
# return loss
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment