-
Run Python using a Shell ScriptPython 2021. 5. 17. 06:08
Let's say we have the following three files: config.py, main.py and experiments/test.sh. config.py is in charge of (hyper-)parameters in main.py and we'd like to run main.py using test.sh. # config.py import argparse def load_args(): parser = argparse.ArgumentParser() parser.add_argument('--lr', default=1e-3, type=float) parser.add_argument('--h_layers', default=[2, 2, 2], type=lambda s: [int(it..
-
Loss function for multi-label classificationData/Machine learning 2021. 5. 3. 20:01
Binary Cross Entropy is used for multi-label classification, and it's involved with a sigmoid function. (Note that cross-entropy is used for multi-class classification that's involved with a softmax function) (reference) Example of a simple neural network model for multi-label classification in Keras (link) - Size of an output layer must be a number of labels. [PyTorch web] BCEWithLogitLoss (link)
-
Metrics for Multi-label classificationData/Machine learning 2021. 5. 3. 12:01
AUC (Area Under the Curve) [1] developers.google.com/machine-learning/crash-course/classification/roc-and-auc?hl=ko The area under the ROC (receiver operating characteristic) curve. The ROC curve consists of TPR (True Positive Rate) and FPR (False Positive Rate) : $$ TPR = \frac{TP}{TP + FN} $$ $$ FPR = \frac{FP}{FP + TN} $$ The ROC curve can be drawn by adjusting a classification threshold from..