fastai学习:06_multicat Questionnarie
1.How could multi-label classification improve the usability of the bear classifier?
可以對不存在的熊進(jìn)行分類
2.How do we encode the dependent variable in a multi-label classification problem?
One-hot encoding: Using a vector of zeros, with a one in each location that is represented in the data, to encode a list of integers.
3.How do you access the rows and columns of a DataFrame as if it was a matrix?
df.iloc
4.How do you get a column by name from a DataFrame?
df[‘name’]
5.What is the difference between a Dataset and DataLoader?
Dataset:: A collection that returns a tuple of your independent and dependent variable for a single item
DataLoader:: An iterator that provides a stream of mini-batches, where each mini-batch is a tuple of a batch of independent variables and a batch of dependent variables
6.What does a Datasets object normally contain?
training set and valid set
7. What does a DataLoaders object normally contain?
training dataloader and valid dataloader
8. What does lambda do in Python?
一種簡寫函數(shù)的方式
9.What are the methods to customize how the independent and dependent variables are created with the data block API?
get_x:自變量
get_y:因變量
10.Why is softmax not an appropriate output activation function when using a one hot encoded target?
softmax只能預(yù)測一個結(jié)果,無法滿足多標(biāo)簽需求
11.Why is nll_loss not an appropriate loss function when using a one-hot-encoded target?
nll_loss只能返回一個激活值
12.What is the difference between nn.BCELoss and nn.BCEWithLogitsLoss?
F.binary_cross_entropy and its module equivalent nn.BCELoss calculate cross-entropy on a one-hot-encoded target, but do not include the initial sigmoid. Normally for one-hot-encoded targets you’ll want F.binary_cross_entropy_with_logits (or nn.BCEWithLogitsLoss), which do both sigmoid and binary cross-entropy in a single function.
13.Why can’t we use regular accuracy in a multi-label problem?
常規(guī)準(zhǔn)確性函數(shù)假設(shè)最終預(yù)測結(jié)果為可能性做的多類別,但是在多標(biāo)簽問題中,需要設(shè)置激活閾值,以選擇最終預(yù)測結(jié)果,以便于分類目標(biāo)比較。
14.When is it okay to tune a hyperparameter on the validation set?
In this case, we’re using the validation set to pick a hyperparameter (the threshold), which is the purpose of the validation set. Sometimes students have expressed their concern that we might be overfitting to the validation set, since we’re trying lots of values to see which is the best. However, as you see in the plot, changing the threshold in this case results in a smooth curve, so we’re clearly not picking some inappropriate outlier. This is a good example of where you have to be careful of the difference between theory (don’t try lots of hyperparameter values or you might overfit the validation set) versus practice (if the relationship is smooth, then it’s fine to do this).
當(dāng)組成的曲線是平滑的時,可以
15.How is y_range implemented in fastai? (See if you can implement it yourself and test it without peeking!)
def sigmod(x, hi, lo):
return x.sigmod()*(hi-lo)+lo
16.What is a regression problem? What loss function should you use for such a problem?
預(yù)測連續(xù)型結(jié)果,mse
17.What do you need to do to make sure the fastai library applies the same data augmentation to your input images and your target point coordinates?
PointBlock.
The only other difference from the previous data block examples is that the second block is a PointBlock. This is necessary so that fastai knows that the labels represent coordinates; that way, it knows that when doing data augmentation, it should do the same augmentation to these coordinates as it does to the images:
總結(jié)
以上是生活随笔為你收集整理的fastai学习:06_multicat Questionnarie的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 文字描边_6招迅速做出炫酷PPT字效!|
- 下一篇: html教程padding,HTML C