{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [], "source": [ "import os\n", "import glob\n", "\n", "from experiments import ExperimentRunner\n", "import params" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [], "source": [ "ex = ExperimentRunner(params.experiment1, n_jobs=1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Running param set: {'data_path_base': '/Users/aziai/Downloads/vtest_new2', 'conv_model_name': 'vgg', 'num_epochs': 10, 'feature_extract': False, 'batch_size': 64, 'lr': 0.001, 'use_vggish': False, 'momentum': 0.9}\n", "Downloading: \"https://download.pytorch.org/models/vgg11_bn-6002323d.pth\" to /Users/aziai/.cache/torch/checkpoints/vgg11_bn-6002323d.pth\n", "100%|██████████| 531503671/531503671 [00:40<00:00, 13079409.73it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Updating ALL params\n", "Epoch 0/9\n", "----------\n", "train Loss: 1.0483 F1: 0.2951 Acc: 0.4557\n", "val Loss: 0.5709 F1: 0.8189 Acc: 0.7294\n", "\n", "Epoch 1/9\n", "----------\n", "train Loss: 0.5769 F1: 0.7872 Acc: 0.7468\n", "val Loss: 0.3201 F1: 0.9353 Acc: 0.8941\n", "\n", "Epoch 2/9\n", "----------\n", "train Loss: 0.3647 F1: 0.8247 Acc: 0.7848\n", "val Loss: 0.4309 F1: 0.8333 Acc: 0.7647\n", "\n", "Epoch 3/9\n", "----------\n", "train Loss: 0.2243 F1: 0.8571 Acc: 0.8608\n", "val Loss: 0.7989 F1: 0.6796 Acc: 0.6118\n", "\n", "Epoch 4/9\n", "----------\n", "train Loss: 0.1799 F1: 0.9231 Acc: 0.9241\n", "val Loss: 0.8629 F1: 0.7407 Acc: 0.6706\n", "\n", "Epoch 5/9\n", "----------\n" ] } ], "source": [ "ex.run()" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [], "source": [ "paths = glob.glob('results/*.csv') # * means all if need specific format then *.csv\n", "latest = max(paths, key=os.path.getctime)\n", "df = pd.read_csv(latest)" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
batch_sizeconv_model_namedata_path_baseexperiment_uuidfeature_extractlrmomentumnum_epochsrunner_uuiduse_vggishval_accval_f1
164resnet/Users/aziai/Downloads/vtest_new220191402191416False0.0010.910b3290017112d2116e4bdbb9c8dbf15a8e75adacb942afb...True0.8941180.935252
064resnet/Users/aziai/Downloads/vtest_new220191402191416False0.0010.9100e57debc92afdd0dc7a209584b4d97860c9dba98f3aed4...False0.8235290.878049
364resnet/Users/aziai/Downloads/vtest_new220191402191416True0.0010.9108e644bc291a463725bf0bcb11825a196383a4860eeecd7...True0.7294120.824427
264resnet/Users/aziai/Downloads/vtest_new220191402191416True0.0010.910e07e5119b07164f06098d1adba9e4c43ad0344716a0746...False0.5647060.626263
\n", "
" ], "text/plain": [ " batch_size conv_model_name data_path_base ... use_vggish val_acc val_f1\n", "1 64 resnet /Users/aziai/Downloads/vtest_new2 ... True 0.894118 0.935252\n", "0 64 resnet /Users/aziai/Downloads/vtest_new2 ... False 0.823529 0.878049\n", "3 64 resnet /Users/aziai/Downloads/vtest_new2 ... True 0.729412 0.824427\n", "2 64 resnet /Users/aziai/Downloads/vtest_new2 ... False 0.564706 0.626263\n", "\n", "[4 rows x 12 columns]" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.sort_values(by='val_f1', ascending=False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.2" } }, "nbformat": 4, "nbformat_minor": 2 }