From 06c784c7bdf43c98aec1fd1d830124426434ef94 Mon Sep 17 00:00:00 2001 From: QiuChuhan <72599473+QiuChuhan@users.noreply.github.com> Date: Thu, 22 Apr 2021 22:07:25 +0800 Subject: [PATCH 1/4] Add files via upload --- GUI.ipynb | 2519 ++++++++++++++++++++++++++++++++++++ UI_file/UI_DeepConcolic.py | 468 +++++++ UI_file/UI_DeepConcolic.ui | 637 +++++++++ UI_file/UI_EKiML.py | 257 ++++ UI_file/UI_EKiML.ui | 336 +++++ UI_file/UI_GUAP.py | 375 ++++++ UI_file/UI_GUAP.ui | 505 ++++++++ UI_file/UI_mainWindow.py | 193 +++ UI_file/UI_mainWindow.ui | 234 ++++ UI_file/UI_testRNN.py | 285 ++++ UI_file/UI_testRNN.ui | 392 ++++++ 11 files changed, 6201 insertions(+) create mode 100644 GUI.ipynb create mode 100644 UI_file/UI_DeepConcolic.py create mode 100644 UI_file/UI_DeepConcolic.ui create mode 100644 UI_file/UI_EKiML.py create mode 100644 UI_file/UI_EKiML.ui create mode 100644 UI_file/UI_GUAP.py create mode 100644 UI_file/UI_GUAP.ui create mode 100644 UI_file/UI_mainWindow.py create mode 100644 UI_file/UI_mainWindow.ui create mode 100644 UI_file/UI_testRNN.py create mode 100644 UI_file/UI_testRNN.ui diff --git a/GUI.ipynb b/GUI.ipynb new file mode 100644 index 0000000..62b1b75 --- /dev/null +++ b/GUI.ipynb @@ -0,0 +1,2519 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Using TensorFlow version: 2.4.1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Looking for plugins in `dc_plugins' directory \n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[nltk_data] Error loading wordnet: \n", + "/Users/qiuchuhan/anaconda3/lib/python3.8/site-packages/tensorflow/python/keras/backend.py:434: UserWarning: `tf.keras.backend.set_learning_phase` is deprecated and will be removed after 2020-10-11. To update it, simply pass a True/False value to the `training` argument of the `__call__` method of your layer or model.\n", + " warnings.warn('`tf.keras.backend.set_learning_phase` is deprecated and '\n" + ] + }, + { + "ename": "FileNotFoundError", + "evalue": "[Errno 2] No such file or directory: 'saved_models/sensorless_tree_black-box.npy'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 253\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'synthesis'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 255\u001b[0;31m last_time, len_reversed_test_set, diff, reversed_test_set = synthesis_knowledge(dataset, embedding, model, workdir,\n\u001b[0m\u001b[1;32m 256\u001b[0m datadir = datadir)\n\u001b[1;32m 257\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/synthesis_knowledge.py\u001b[0m in \u001b[0;36msynthesis_knowledge\u001b[0;34m(dataset, embedding, model, workdir, datadir)\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0;31m# load the tree classifier\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 87\u001b[0m \u001b[0mbasename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdataset\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'_tree_'\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0membedding\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 88\u001b[0;31m tree = np.load(os.path.join (workdir, basename + '.npy'),\n\u001b[0m\u001b[1;32m 89\u001b[0m allow_pickle='TRUE').item()\n\u001b[1;32m 90\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/numpy/lib/npyio.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(file, mmap_mode, allow_pickle, fix_imports, encoding)\u001b[0m\n\u001b[1;32m 426\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 427\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 428\u001b[0;31m \u001b[0mfid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos_fspath\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfile\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"rb\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 429\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'saved_models/sensorless_tree_black-box.npy'" + ] + }, + { + "ename": "FileNotFoundError", + "evalue": "[Errno 2] No such file or directory: 'saved_models/mnist_tree_black-box.npy'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 253\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'synthesis'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 255\u001b[0;31m last_time, len_reversed_test_set, diff, reversed_test_set = synthesis_knowledge(dataset, embedding, model, workdir,\n\u001b[0m\u001b[1;32m 256\u001b[0m datadir = datadir)\n\u001b[1;32m 257\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/synthesis_knowledge.py\u001b[0m in \u001b[0;36msynthesis_knowledge\u001b[0;34m(dataset, embedding, model, workdir, datadir)\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0;31m# load the tree classifier\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 87\u001b[0m \u001b[0mbasename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdataset\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'_tree_'\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0membedding\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 88\u001b[0;31m tree = np.load(os.path.join (workdir, basename + '.npy'),\n\u001b[0m\u001b[1;32m 89\u001b[0m allow_pickle='TRUE').item()\n\u001b[1;32m 90\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/numpy/lib/npyio.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(file, mmap_mode, allow_pickle, fix_imports, encoding)\u001b[0m\n\u001b[1;32m 426\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 427\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 428\u001b[0;31m \u001b[0mfid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos_fspath\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfile\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"rb\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 429\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'saved_models/mnist_tree_black-box.npy'" + ] + }, + { + "ename": "FileNotFoundError", + "evalue": "[Errno 2] No such file or directory: 'saved_models/cod-rna_tree_black-box.npy'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 253\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'synthesis'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 255\u001b[0;31m last_time, len_reversed_test_set, diff, reversed_test_set = synthesis_knowledge(dataset, embedding, model, workdir,\n\u001b[0m\u001b[1;32m 256\u001b[0m datadir = datadir)\n\u001b[1;32m 257\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/synthesis_knowledge.py\u001b[0m in \u001b[0;36msynthesis_knowledge\u001b[0;34m(dataset, embedding, model, workdir, datadir)\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0;31m# load the tree classifier\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 87\u001b[0m \u001b[0mbasename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdataset\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'_tree_'\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0membedding\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 88\u001b[0;31m tree = np.load(os.path.join (workdir, basename + '.npy'),\n\u001b[0m\u001b[1;32m 89\u001b[0m allow_pickle='TRUE').item()\n\u001b[1;32m 90\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/numpy/lib/npyio.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(file, mmap_mode, allow_pickle, fix_imports, encoding)\u001b[0m\n\u001b[1;32m 426\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 427\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 428\u001b[0;31m \u001b[0mfid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos_fspath\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfile\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"rb\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 429\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'saved_models/cod-rna_tree_black-box.npy'" + ] + }, + { + "ename": "FileNotFoundError", + "evalue": "[Errno 2] No such file or directory: 'saved_models/nursery_tree_black-box.npy'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 253\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'synthesis'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 255\u001b[0;31m last_time, len_reversed_test_set, diff, reversed_test_set = synthesis_knowledge(dataset, embedding, model, workdir,\n\u001b[0m\u001b[1;32m 256\u001b[0m datadir = datadir)\n\u001b[1;32m 257\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/synthesis_knowledge.py\u001b[0m in \u001b[0;36msynthesis_knowledge\u001b[0;34m(dataset, embedding, model, workdir, datadir)\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0;31m# load the tree classifier\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 87\u001b[0m \u001b[0mbasename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdataset\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'_tree_'\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0membedding\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 88\u001b[0;31m tree = np.load(os.path.join (workdir, basename + '.npy'),\n\u001b[0m\u001b[1;32m 89\u001b[0m allow_pickle='TRUE').item()\n\u001b[1;32m 90\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/numpy/lib/npyio.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(file, mmap_mode, allow_pickle, fix_imports, encoding)\u001b[0m\n\u001b[1;32m 426\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 427\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 428\u001b[0;31m \u001b[0mfid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos_fspath\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfile\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"rb\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 429\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'saved_models/nursery_tree_black-box.npy'" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "suspected decision rule: [[52, '>', 0.0961844997946173], [13, '>', 0.45533549785614014], [559, '<=', 0.14047499746084213], [129, '<=', -0.8655029833316803], [57, '>', -0.9998455047607422], [159, '>', 0.22970599681138992], [49, '<=', 0.862836480140686], [442, '<=', -0.9988240003585815], [442, '>', -0.9995000064373016]]\n", + "find a solution\n", + "suspected decision rule: [[52, '>', 0.0961844997946173], [13, '>', 0.45533549785614014], [559, '<=', 0.14047499746084213], [129, '>', -0.8655029833316803], [57, '<=', -0.9750190079212189], [409, '>', -0.9980224967002869], [429, '<=', -0.9114909768104553], [442, '<=', -0.9948055148124695]]\n", + "find a solution\n", + "suspected decision rule: [[52, '>', 0.0961844997946173], [13, '>', 0.45533549785614014], [559, '>', 0.14047499746084213], [139, '>', -0.9960980117321014], [129, '<=', -0.8992460072040558], [442, '<=', -0.9896329939365387]]\n", + "find a solution\n", + "suspected decision rule: [[52, '>', 0.0961844997946173], [13, '>', 0.45533549785614014], [559, '<=', 0.14047499746084213], [129, '<=', -0.8655029833316803], [57, '>', -0.9998455047607422], [159, '<=', 0.22970599681138992], [230, '>', -0.9992440044879913], [442, '<=', -0.9989370107650757], [13, '<=', 0.6774359941482544]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [442, '<=', -0.9989795088768005], [442, '>', -0.9990085065364838]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [442, '<=', -0.9989795088768005], [442, '>', -0.9990085065364838]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [442, '<=', -0.9989795088768005], [442, '>', -0.9990085065364838]]\n", + "find a solution\n", + "suspected decision rule: [[52, '>', 0.0961844997946173], [13, '>', 0.45533549785614014], [559, '<=', 0.14047499746084213], [129, '<=', -0.8655029833316803], [57, '>', -0.9998455047607422], [159, '<=', 0.22970599681138992], [230, '>', -0.9992440044879913], [442, '<=', -0.9989370107650757], [13, '<=', 0.6774359941482544]]\n", + "find a solution\n", + "suspected decision rule: [[52, '>', 0.0961844997946173], [13, '>', 0.45533549785614014], [559, '<=', 0.14047499746084213], [129, '<=', -0.8655029833316803], [57, '>', -0.9998455047607422], [159, '<=', 0.22970599681138992], [230, '>', -0.9992440044879913], [442, '<=', -0.9989370107650757], [13, '<=', 0.6774359941482544]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [442, '<=', -0.9989795088768005], [442, '>', -0.9990085065364838]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [442, '<=', -0.9989795088768005], [442, '>', -0.9990085065364838]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [442, '<=', -0.9989795088768005], [442, '>', -0.9990085065364838]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [442, '<=', -0.9989795088768005], [442, '>', -0.9990085065364838]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [442, '<=', -0.9989795088768005], [442, '>', -0.9990085065364838]]\n", + "find a solution\n", + "suspected decision rule: [[52, '>', 0.0961844997946173], [13, '>', 0.45533549785614014], [559, '<=', 0.14047499746084213], [129, '<=', -0.8655029833316803], [57, '>', -0.9998455047607422], [159, '<=', 0.22970599681138992], [230, '>', -0.9992440044879913], [442, '<=', -0.9989370107650757], [13, '<=', 0.6774359941482544]]\n", + "find a solution\n", + "suspected decision rule: [[52, '>', 0.0961844997946173], [13, '>', 0.45533549785614014], [559, '<=', 0.14047499746084213], [129, '<=', -0.8655029833316803], [57, '>', -0.9998455047607422], [159, '>', 0.22970599681138992], [49, '<=', 0.862836480140686], [442, '<=', -0.9988240003585815], [442, '>', -0.9995000064373016]]\n", + "find a solution\n", + "evaluation dataset: har\n", + "embedding method: black-box\n", + "Time to synthesize the knowledge: 79.82569127100001\n", + "Amount of collection: 16\n", + "Suspected features: [array([ 52, 159, 442]), array([ 13, 429, 442]), array([ 13, 129, 442]), array([ 13, 52, 442]), array([ 52, 395, 442]), array([ 52, 395, 442]), array([ 52, 395, 442]), array([ 13, 52, 442]), array([ 13, 52, 442]), array([ 52, 442, 462]), array([ 52, 442, 462]), array([ 52, 442, 462]), array([ 52, 442, 462]), array([ 52, 442, 462]), array([ 13, 52, 442]), array([ 52, 159, 442])]\n", + "Suspected knowledge: [[0.09686050587333739, 0.23038200289011002, -0.9988240003585815], [0.7276677489280701, -0.9114909768104553, -0.9948055148124695], [0.7276677489280701, -0.8992460072040558, -0.9896329939365387], [0.6774359941482544, 0.31828499608673155, -0.9989370107650757], [0.0, 0.0, -0.9989795088768005], [0.0, 0.0, -0.9989795088768005], [0.0, 0.0, -0.9989795088768005], [0.6774359941482544, 0.31828499608673155, -0.9989370107650757], [0.6774359941482544, 0.31828499608673155, -0.9989370107650757], [0.0, -0.9989795088768005, -0.9575990023403168], [0.0, -0.9989795088768005, -0.9575990023403168], [0.0, -0.9989795088768005, -0.9575990023403168], [0.0, -0.9989795088768005, -0.9575990023403168], [0.0, -0.9989795088768005, -0.9575990023403168], [0.6774359941482544, 0.31828499608673155, -0.9989370107650757], [0.09686050587333739, 0.23038200289011002, -0.9988240003585815]]\n" + ] + }, + { + "ename": "ValueError", + "evalue": "Cannot take a larger sample than population when 'replace=False'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 253\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'synthesis'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 255\u001b[0;31m last_time, len_reversed_test_set, diff, reversed_test_set = synthesis_knowledge(dataset, embedding, model, workdir,\n\u001b[0m\u001b[1;32m 256\u001b[0m datadir = datadir)\n\u001b[1;32m 257\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/synthesis_knowledge.py\u001b[0m in \u001b[0;36msynthesis_knowledge\u001b[0;34m(dataset, embedding, model, workdir, datadir)\u001b[0m\n\u001b[1;32m 53\u001b[0m \u001b[0mload_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrandom_seed\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdatadir\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatadir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 54\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 55\u001b[0;31m \u001b[0midxs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchoice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx_test\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m50\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreplace\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 56\u001b[0m \u001b[0mx_test\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mx_test\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0midxs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 57\u001b[0m \u001b[0my_test\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0my_test\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0midxs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32mmtrand.pyx\u001b[0m in \u001b[0;36mnumpy.random.mtrand.RandomState.choice\u001b[0;34m()\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: Cannot take a larger sample than population when 'replace=False'" + ] + }, + { + "ename": "FileNotFoundError", + "evalue": "[Errno 2] No such file or directory: 'saved_models/mushroom_tree_black-box.npy'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 253\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'synthesis'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 255\u001b[0;31m last_time, len_reversed_test_set, diff, reversed_test_set = synthesis_knowledge(dataset, embedding, model, workdir,\n\u001b[0m\u001b[1;32m 256\u001b[0m datadir = datadir)\n\u001b[1;32m 257\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/synthesis_knowledge.py\u001b[0m in \u001b[0;36msynthesis_knowledge\u001b[0;34m(dataset, embedding, model, workdir, datadir)\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0;31m# load the tree classifier\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 87\u001b[0m \u001b[0mbasename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdataset\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'_tree_'\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0membedding\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 88\u001b[0;31m tree = np.load(os.path.join (workdir, basename + '.npy'),\n\u001b[0m\u001b[1;32m 89\u001b[0m allow_pickle='TRUE').item()\n\u001b[1;32m 90\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/numpy/lib/npyio.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(file, mmap_mode, allow_pickle, fix_imports, encoding)\u001b[0m\n\u001b[1;32m 426\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 427\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 428\u001b[0;31m \u001b[0mfid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos_fspath\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfile\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"rb\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 429\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'saved_models/mushroom_tree_black-box.npy'" + ] + }, + { + "ename": "FileNotFoundError", + "evalue": "[Errno 2] No such file or directory: 'EKiML/saved_models/mushroom_tree_black-box.npy'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 253\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'synthesis'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 255\u001b[0;31m last_time, len_reversed_test_set, diff, reversed_test_set = synthesis_knowledge(dataset, embedding, model, workdir,\n\u001b[0m\u001b[1;32m 256\u001b[0m datadir = datadir)\n\u001b[1;32m 257\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/synthesis_knowledge.py\u001b[0m in \u001b[0;36msynthesis_knowledge\u001b[0;34m(dataset, embedding, model, workdir, datadir)\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0;31m# load the tree classifier\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 87\u001b[0m \u001b[0mbasename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdataset\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'_tree_'\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0membedding\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 88\u001b[0;31m tree = np.load(os.path.join (workdir, basename + '.npy'),\n\u001b[0m\u001b[1;32m 89\u001b[0m allow_pickle='TRUE').item()\n\u001b[1;32m 90\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/numpy/lib/npyio.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(file, mmap_mode, allow_pickle, fix_imports, encoding)\u001b[0m\n\u001b[1;32m 426\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 427\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 428\u001b[0;31m \u001b[0mfid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos_fspath\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfile\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"rb\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 429\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'EKiML/saved_models/mushroom_tree_black-box.npy'" + ] + }, + { + "ename": "ValueError", + "evalue": "Cannot take a larger sample than population when 'replace=False'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 253\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'synthesis'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 255\u001b[0;31m last_time, len_reversed_test_set, diff, reversed_test_set = synthesis_knowledge(dataset, embedding, model, workdir,\n\u001b[0m\u001b[1;32m 256\u001b[0m datadir = datadir)\n\u001b[1;32m 257\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/synthesis_knowledge.py\u001b[0m in \u001b[0;36msynthesis_knowledge\u001b[0;34m(dataset, embedding, model, workdir, datadir)\u001b[0m\n\u001b[1;32m 53\u001b[0m \u001b[0mload_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrandom_seed\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdatadir\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatadir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 54\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 55\u001b[0;31m \u001b[0midxs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchoice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx_test\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m50\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreplace\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 56\u001b[0m \u001b[0mx_test\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mx_test\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0midxs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 57\u001b[0m \u001b[0my_test\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0my_test\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0midxs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32mmtrand.pyx\u001b[0m in \u001b[0;36mnumpy.random.mtrand.RandomState.choice\u001b[0;34m()\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: Cannot take a larger sample than population when 'replace=False'" + ] + }, + { + "ename": "FileNotFoundError", + "evalue": "[Errno 2] No such file or directory: 'EKiML/saved_models/breast_cancer_tree_black-box.npy'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 253\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'synthesis'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 255\u001b[0;31m last_time, len_reversed_test_set, diff, reversed_test_set = synthesis_knowledge(dataset, embedding, model, workdir,\n\u001b[0m\u001b[1;32m 256\u001b[0m datadir = datadir)\n\u001b[1;32m 257\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/synthesis_knowledge.py\u001b[0m in \u001b[0;36msynthesis_knowledge\u001b[0;34m(dataset, embedding, model, workdir, datadir)\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0;31m# load the tree classifier\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 87\u001b[0m \u001b[0mbasename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdataset\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'_tree_'\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0membedding\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 88\u001b[0;31m tree = np.load(os.path.join (workdir, basename + '.npy'),\n\u001b[0m\u001b[1;32m 89\u001b[0m allow_pickle='TRUE').item()\n\u001b[1;32m 90\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/numpy/lib/npyio.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(file, mmap_mode, allow_pickle, fix_imports, encoding)\u001b[0m\n\u001b[1;32m 426\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 427\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 428\u001b[0;31m \u001b[0mfid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos_fspath\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfile\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"rb\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 429\u001b[0m \u001b[0mown_fid\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'EKiML/saved_models/breast_cancer_tree_black-box.npy'" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Generalizing Universal Adversarial Examples:\n", + "==> Preparing data..\n", + "Downloading https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz to cifar10-data/cifar-10-python.tar.gz\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "3cef08289f7a430391dc4bd15eb65d20", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Failed download. Trying https -> http instead. Downloading http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz to cifar10-data/cifar-10-python.tar.gz\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "a8f463c85edd49bb9946cdd77294ce38", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "ename": "RemoteDisconnected", + "evalue": "Remote end closed connection without response", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mOSError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36mdo_open\u001b[0;34m(self, http_class, req, **http_conn_args)\u001b[0m\n\u001b[1;32m 1349\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1350\u001b[0;31m h.request(req.get_method(), req.selector, req.data, headers,\n\u001b[0m\u001b[1;32m 1351\u001b[0m encode_chunked=req.has_header('Transfer-encoding'))\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/http/client.py\u001b[0m in \u001b[0;36mrequest\u001b[0;34m(self, method, url, body, headers, encode_chunked)\u001b[0m\n\u001b[1;32m 1239\u001b[0m \u001b[0;34m\"\"\"Send a complete request to the server.\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1240\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_send_request\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmethod\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbody\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mheaders\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mencode_chunked\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1241\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/http/client.py\u001b[0m in \u001b[0;36m_send_request\u001b[0;34m(self, method, url, body, headers, encode_chunked)\u001b[0m\n\u001b[1;32m 1285\u001b[0m \u001b[0mbody\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_encode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbody\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'body'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1286\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mendheaders\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbody\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mencode_chunked\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mencode_chunked\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1287\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/http/client.py\u001b[0m in \u001b[0;36mendheaders\u001b[0;34m(self, message_body, encode_chunked)\u001b[0m\n\u001b[1;32m 1234\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mCannotSendHeader\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1235\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_send_output\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmessage_body\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mencode_chunked\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mencode_chunked\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1236\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/http/client.py\u001b[0m in \u001b[0;36m_send_output\u001b[0;34m(self, message_body, encode_chunked)\u001b[0m\n\u001b[1;32m 1005\u001b[0m \u001b[0;32mdel\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_buffer\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1006\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmsg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1007\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/http/client.py\u001b[0m in \u001b[0;36msend\u001b[0;34m(self, data)\u001b[0m\n\u001b[1;32m 945\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mauto_open\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 946\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconnect\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 947\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/http/client.py\u001b[0m in \u001b[0;36mconnect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1408\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1409\u001b[0;31m self.sock = self._context.wrap_socket(self.sock,\n\u001b[0m\u001b[1;32m 1410\u001b[0m server_hostname=server_hostname)\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/ssl.py\u001b[0m in \u001b[0;36mwrap_socket\u001b[0;34m(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session)\u001b[0m\n\u001b[1;32m 499\u001b[0m \u001b[0;31m# ctx._wrap_socket()\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 500\u001b[0;31m return self.sslsocket_class._create(\n\u001b[0m\u001b[1;32m 501\u001b[0m \u001b[0msock\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msock\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/ssl.py\u001b[0m in \u001b[0;36m_create\u001b[0;34m(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session)\u001b[0m\n\u001b[1;32m 1039\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"do_handshake_on_connect should not be specified for non-blocking sockets\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1040\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdo_handshake\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1041\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mOSError\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/ssl.py\u001b[0m in \u001b[0;36mdo_handshake\u001b[0;34m(self, block)\u001b[0m\n\u001b[1;32m 1308\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msettimeout\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1309\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_sslobj\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdo_handshake\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1310\u001b[0m \u001b[0;32mfinally\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mOSError\u001b[0m: [Errno 0] Error", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[0;31mURLError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torchvision/datasets/utils.py\u001b[0m in \u001b[0;36mdownload_url\u001b[0;34m(url, root, filename, md5)\u001b[0m\n\u001b[1;32m 69\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Downloading '\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m' to '\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mfpath\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 70\u001b[0;31m urllib.request.urlretrieve(\n\u001b[0m\u001b[1;32m 71\u001b[0m \u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfpath\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36murlretrieve\u001b[0;34m(url, filename, reporthook, data)\u001b[0m\n\u001b[1;32m 246\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 247\u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mcontextlib\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclosing\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murlopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mfp\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 248\u001b[0m \u001b[0mheaders\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minfo\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36murlopen\u001b[0;34m(url, data, timeout, cafile, capath, cadefault, context)\u001b[0m\n\u001b[1;32m 221\u001b[0m \u001b[0mopener\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_opener\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 222\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mopener\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 223\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36mopen\u001b[0;34m(self, fullurl, data, timeout)\u001b[0m\n\u001b[1;32m 524\u001b[0m \u001b[0msys\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0maudit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'urllib.Request'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfull_url\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mheaders\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_method\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 525\u001b[0;31m \u001b[0mresponse\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_open\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mreq\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 526\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36m_open\u001b[0;34m(self, req, data)\u001b[0m\n\u001b[1;32m 541\u001b[0m \u001b[0mprotocol\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtype\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 542\u001b[0;31m result = self._call_chain(self.handle_open, protocol, protocol +\n\u001b[0m\u001b[1;32m 543\u001b[0m '_open', req)\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36m_call_chain\u001b[0;34m(self, chain, kind, meth_name, *args)\u001b[0m\n\u001b[1;32m 501\u001b[0m \u001b[0mfunc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmeth_name\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 502\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 503\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36mhttps_open\u001b[0;34m(self, req)\u001b[0m\n\u001b[1;32m 1392\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mhttps_open\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1393\u001b[0;31m return self.do_open(http.client.HTTPSConnection, req,\n\u001b[0m\u001b[1;32m 1394\u001b[0m context=self._context, check_hostname=self._check_hostname)\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36mdo_open\u001b[0;34m(self, http_class, req, **http_conn_args)\u001b[0m\n\u001b[1;32m 1352\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mOSError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0merr\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# timeout error\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1353\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mURLError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0merr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1354\u001b[0m \u001b[0mr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mh\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgetresponse\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mURLError\u001b[0m: ", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[0;31mRemoteDisconnected\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[0mlimited\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcomboBox_limited\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcurrentText\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 323\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 324\u001b[0;31m \u001b[0mlist_Epoch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Time\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_GUAP_ASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun_g\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataSet\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbatch_size\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mepochs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ml2reg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbeta1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtau\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meps\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel_name\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmanualSeed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgpuid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcuda\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresume\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutdir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlimited\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 325\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 326\u001b[0m \u001b[0mmsg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'%.2f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f'\u001b[0m\u001b[0;34m%\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/GUAP/guap_ui.py\u001b[0m in \u001b[0;36mrun_g\u001b[0;34m(dataSet, lr, batch_size, epochs, l2reg, beta1, tau, eps, model_name, manualSeed, gpuid, cuda, resume, outdir, limited)\u001b[0m\n\u001b[1;32m 112\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mNotImplementedError\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 113\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mdataSet\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'CIFAR10'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 114\u001b[0;31m \u001b[0mtrainset\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorchvision\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdatasets\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mCIFAR10\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mroot\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'cifar10-data'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrain\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdownload\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtransform\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtransform_data\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 115\u001b[0m \u001b[0mtestset\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorchvision\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdatasets\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mCIFAR10\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mroot\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'cifar10-data'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrain\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdownload\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtransform\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtransform_data\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 116\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mmodel_name\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'VGG19'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torchvision/datasets/cifar.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, root, train, transform, target_transform, download)\u001b[0m\n\u001b[1;32m 63\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 64\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mdownload\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 65\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdownload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 66\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_check_integrity\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torchvision/datasets/cifar.py\u001b[0m in \u001b[0;36mdownload\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 141\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Files already downloaded and verified'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 142\u001b[0m \u001b[0;32mreturn\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 143\u001b[0;31m \u001b[0mdownload_and_extract_archive\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mroot\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfilename\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmd5\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtgz_md5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 144\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 145\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mextra_repr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torchvision/datasets/utils.py\u001b[0m in \u001b[0;36mdownload_and_extract_archive\u001b[0;34m(url, download_root, extract_root, filename, md5, remove_finished)\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0mfilename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbasename\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 255\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 256\u001b[0;31m \u001b[0mdownload_url\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdownload_root\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmd5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 257\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 258\u001b[0m \u001b[0marchive\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdownload_root\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfilename\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torchvision/datasets/utils.py\u001b[0m in \u001b[0;36mdownload_url\u001b[0;34m(url, root, filename, md5)\u001b[0m\n\u001b[1;32m 77\u001b[0m print('Failed download. Trying https -> http instead.'\n\u001b[1;32m 78\u001b[0m ' Downloading ' + url + ' to ' + fpath)\n\u001b[0;32m---> 79\u001b[0;31m urllib.request.urlretrieve(\n\u001b[0m\u001b[1;32m 80\u001b[0m \u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfpath\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 81\u001b[0m \u001b[0mreporthook\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mgen_bar_updater\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36murlretrieve\u001b[0;34m(url, filename, reporthook, data)\u001b[0m\n\u001b[1;32m 245\u001b[0m \u001b[0murl_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpath\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_splittype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 246\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 247\u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mcontextlib\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclosing\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murlopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mfp\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 248\u001b[0m \u001b[0mheaders\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minfo\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 249\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36murlopen\u001b[0;34m(url, data, timeout, cafile, capath, cadefault, context)\u001b[0m\n\u001b[1;32m 220\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 221\u001b[0m \u001b[0mopener\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_opener\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 222\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mopener\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 223\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 224\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0minstall_opener\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mopener\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36mopen\u001b[0;34m(self, fullurl, data, timeout)\u001b[0m\n\u001b[1;32m 523\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 524\u001b[0m \u001b[0msys\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0maudit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'urllib.Request'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfull_url\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mheaders\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_method\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 525\u001b[0;31m \u001b[0mresponse\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_open\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mreq\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 526\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 527\u001b[0m \u001b[0;31m# post-process response\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36m_open\u001b[0;34m(self, req, data)\u001b[0m\n\u001b[1;32m 540\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 541\u001b[0m \u001b[0mprotocol\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtype\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 542\u001b[0;31m result = self._call_chain(self.handle_open, protocol, protocol +\n\u001b[0m\u001b[1;32m 543\u001b[0m '_open', req)\n\u001b[1;32m 544\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36m_call_chain\u001b[0;34m(self, chain, kind, meth_name, *args)\u001b[0m\n\u001b[1;32m 500\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mhandler\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mhandlers\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 501\u001b[0m \u001b[0mfunc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhandler\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmeth_name\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 502\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 503\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 504\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36mhttp_open\u001b[0;34m(self, req)\u001b[0m\n\u001b[1;32m 1377\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1378\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mhttp_open\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1379\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdo_open\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhttp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclient\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHTTPConnection\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1380\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1381\u001b[0m \u001b[0mhttp_request\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mAbstractHTTPHandler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdo_request_\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/urllib/request.py\u001b[0m in \u001b[0;36mdo_open\u001b[0;34m(self, http_class, req, **http_conn_args)\u001b[0m\n\u001b[1;32m 1352\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mOSError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0merr\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# timeout error\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1353\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mURLError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0merr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1354\u001b[0;31m \u001b[0mr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mh\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgetresponse\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1355\u001b[0m \u001b[0;32mexcept\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1356\u001b[0m \u001b[0mh\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/http/client.py\u001b[0m in \u001b[0;36mgetresponse\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1330\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1331\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1332\u001b[0;31m \u001b[0mresponse\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbegin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1333\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mConnectionError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1334\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/http/client.py\u001b[0m in \u001b[0;36mbegin\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 301\u001b[0m \u001b[0;31m# read until we get a non-100 response\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 302\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 303\u001b[0;31m \u001b[0mversion\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstatus\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreason\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_read_status\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 304\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mstatus\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0mCONTINUE\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 305\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/http/client.py\u001b[0m in \u001b[0;36m_read_status\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 270\u001b[0m \u001b[0;31m# Presumably, the server closed the connection before\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 271\u001b[0m \u001b[0;31m# sending a valid response.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 272\u001b[0;31m raise RemoteDisconnected(\"Remote end closed connection without\"\n\u001b[0m\u001b[1;32m 273\u001b[0m \" response\")\n\u001b[1;32m 274\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mRemoteDisconnected\u001b[0m: Remote end closed connection without response" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Generalizing Universal Adversarial Examples:\n", + "==> Preparing data..\n", + "Downloading https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz to cifar10-data/cifar-10-python.tar.gz\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "f196a65858094d6bb6f1b08ce3036043", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Failed download. Trying https -> http instead. Downloading http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz to cifar10-data/cifar-10-python.tar.gz\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "9ace7c051e434f38b1db292012aff2e3", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(FloatProgress(value=1.0, bar_style='info', max=1.0), HTML(value='')))" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Extracting cifar10-data/cifar-10-python.tar.gz to cifar10-data\n", + "Files already downloaded and verified\n" + ] + }, + { + "ename": "RuntimeError", + "evalue": "Error(s) in loading state_dict for Generator:\n\tsize mismatch for decoder.6.weight: copying a param with shape torch.Size([8, 1, 6, 6]) from checkpoint, the shape in current model is torch.Size([8, 3, 6, 6]).", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[0mlimited\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcomboBox_limited\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcurrentText\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 323\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 324\u001b[0;31m \u001b[0mlist_Epoch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Time\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_GUAP_ASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun_g\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataSet\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbatch_size\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mepochs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ml2reg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbeta1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtau\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meps\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel_name\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmanualSeed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgpuid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcuda\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresume\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutdir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlimited\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 325\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 326\u001b[0m \u001b[0mmsg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'%.2f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f'\u001b[0m\u001b[0;34m%\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/GUAP/guap_ui.py\u001b[0m in \u001b[0;36mrun_g\u001b[0;34m(dataSet, lr, batch_size, epochs, l2reg, beta1, tau, eps, model_name, manualSeed, gpuid, cuda, resume, outdir, limited)\u001b[0m\n\u001b[1;32m 176\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 177\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mresume\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'true'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 178\u001b[0;31m \u001b[0mnetAttacker\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_state_dict\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel_file\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m'Fashion-MNIST_GUAP_pretrained_model.pth'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mmap_location\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 179\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 180\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36mload_state_dict\u001b[0;34m(self, state_dict, strict)\u001b[0m\n\u001b[1;32m 1049\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1050\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0merror_msgs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1051\u001b[0;31m raise RuntimeError('Error(s) in loading state_dict for {}:\\n\\t{}'.format(\n\u001b[0m\u001b[1;32m 1052\u001b[0m self.__class__.__name__, \"\\n\\t\".join(error_msgs)))\n\u001b[1;32m 1053\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0m_IncompatibleKeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmissing_keys\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0munexpected_keys\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mRuntimeError\u001b[0m: Error(s) in loading state_dict for Generator:\n\tsize mismatch for decoder.6.weight: copying a param with shape torch.Size([8, 1, 6, 6]) from checkpoint, the shape in current model is torch.Size([8, 3, 6, 6])." + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Generalizing Universal Adversarial Examples:\n", + "==> Preparing data..\n", + "Files already downloaded and verified\n", + "Files already downloaded and verified\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[2021/04/22 19:47:36] - Epoch \t Time \t Tr_loss \t Tr_acc \t Tr_stASR \t Tr_noiseASR \t Tr_GUAP_ASR \n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[0mlimited\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcomboBox_limited\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcurrentText\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 323\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 324\u001b[0;31m \u001b[0mlist_Epoch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Time\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_GUAP_ASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun_g\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataSet\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbatch_size\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mepochs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ml2reg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbeta1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtau\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meps\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel_name\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmanualSeed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgpuid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcuda\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresume\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutdir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlimited\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 325\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 326\u001b[0m \u001b[0mmsg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'%.2f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f'\u001b[0m\u001b[0;34m%\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/GUAP/guap_ui.py\u001b[0m in \u001b[0;36mrun_g\u001b[0;34m(dataSet, lr, batch_size, epochs, l2reg, beta1, tau, eps, model_name, manualSeed, gpuid, cuda, resume, outdir, limited)\u001b[0m\n\u001b[1;32m 245\u001b[0m \u001b[0madv_lossall\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mF\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcross_entropy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlogits_adv\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrain_ori_logits\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmax\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreduction\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'none'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 246\u001b[0m \u001b[0madv_loss\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m-\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmean\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlog\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0madv_lossall\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 247\u001b[0;31m \u001b[0madv_loss\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbackward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 248\u001b[0m \u001b[0moptimizer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 249\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/tensor.py\u001b[0m in \u001b[0;36mbackward\u001b[0;34m(self, gradient, retain_graph, create_graph)\u001b[0m\n\u001b[1;32m 219\u001b[0m \u001b[0mretain_graph\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mretain_graph\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 220\u001b[0m create_graph=create_graph)\n\u001b[0;32m--> 221\u001b[0;31m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mautograd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbackward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgradient\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mretain_graph\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcreate_graph\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 222\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 223\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mregister_hook\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhook\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/autograd/__init__.py\u001b[0m in \u001b[0;36mbackward\u001b[0;34m(tensors, grad_tensors, retain_graph, create_graph, grad_variables)\u001b[0m\n\u001b[1;32m 128\u001b[0m \u001b[0mretain_graph\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcreate_graph\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 129\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 130\u001b[0;31m Variable._execution_engine.run_backward(\n\u001b[0m\u001b[1;32m 131\u001b[0m \u001b[0mtensors\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgrad_tensors_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mretain_graph\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcreate_graph\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 132\u001b[0m allow_unreachable=True) # allow_unreachable flag\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of gpu: 0\n", + "Generalizing Universal Adversarial Examples:\n", + "==> Preparing data..\n", + "Files already downloaded and verified\n", + "Files already downloaded and verified\n" + ] + }, + { + "ename": "AttributeError", + "evalue": "'NoneType' object has no attribute 'lower'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[0mlimited\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcomboBox_limited\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcurrentText\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 323\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 324\u001b[0;31m \u001b[0mlist_Epoch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Time\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_GUAP_ASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun_g\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataSet\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbatch_size\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mepochs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ml2reg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbeta1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtau\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meps\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel_name\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmanualSeed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgpuid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcuda\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresume\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutdir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlimited\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 325\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 326\u001b[0m \u001b[0mmsg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'%.2f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f'\u001b[0m\u001b[0;34m%\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/GUAP/guap_ui.py\u001b[0m in \u001b[0;36mrun_g\u001b[0;34m(dataSet, lr, batch_size, epochs, l2reg, beta1, tau, eps, model_name, manualSeed, gpuid, cuda, resume, outdir, limited)\u001b[0m\n\u001b[1;32m 116\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mmodel_name\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'VGG19'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 117\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mVGG\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'VGG19'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 118\u001b[0;31m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_state_dict\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel_file\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m'cifar10_vgg19.pth'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mmap_location\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'net'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 119\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmodel_name\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'ResNet101'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 120\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mResNet101\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/serialization.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(f, map_location, pickle_module, **pickle_load_args)\u001b[0m\n\u001b[1;32m 593\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mopened_file\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 594\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0m_load\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mopened_zipfile\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmap_location\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpickle_module\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mpickle_load_args\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 595\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_legacy_load\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mopened_file\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmap_location\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpickle_module\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mpickle_load_args\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 596\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 597\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/serialization.py\u001b[0m in \u001b[0;36m_legacy_load\u001b[0;34m(f, map_location, pickle_module, **pickle_load_args)\u001b[0m\n\u001b[1;32m 772\u001b[0m \u001b[0munpickler\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpickle_module\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mUnpickler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mpickle_load_args\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 773\u001b[0m \u001b[0munpickler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpersistent_load\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpersistent_load\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 774\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0munpickler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 775\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 776\u001b[0m \u001b[0mdeserialized_storage_keys\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpickle_module\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mpickle_load_args\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/serialization.py\u001b[0m in \u001b[0;36mpersistent_load\u001b[0;34m(saved_id)\u001b[0m\n\u001b[1;32m 728\u001b[0m \u001b[0mobj\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdata_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msize\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 729\u001b[0m \u001b[0mobj\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_torch_load_uninitialized\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 730\u001b[0;31m \u001b[0mdeserialized_objects\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mroot_key\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrestore_location\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlocation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 731\u001b[0m \u001b[0mstorage\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdeserialized_objects\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mroot_key\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 732\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mview_metadata\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/serialization.py\u001b[0m in \u001b[0;36mrestore_location\u001b[0;34m(storage, location)\u001b[0m\n\u001b[1;32m 812\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmap_location\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 813\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mrestore_location\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstorage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlocation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 814\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mdefault_restore_location\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstorage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmap_location\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 815\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 816\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mrestore_location\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstorage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlocation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/serialization.py\u001b[0m in \u001b[0;36mdefault_restore_location\u001b[0;34m(storage, location)\u001b[0m\n\u001b[1;32m 173\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mdefault_restore_location\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstorage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlocation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 174\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0m_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfn\u001b[0m \u001b[0;32min\u001b[0m \u001b[0m_package_registry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 175\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstorage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlocation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 176\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 177\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/serialization.py\u001b[0m in \u001b[0;36m_cuda_deserialize\u001b[0;34m(obj, location)\u001b[0m\n\u001b[1;32m 149\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_cuda_deserialize\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlocation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 150\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mlocation\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstartswith\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'cuda'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 151\u001b[0;31m \u001b[0mdevice\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvalidate_cuda_device\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlocation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 152\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"_torch_load_uninitialized\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 153\u001b[0m \u001b[0mstorage_type\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcuda\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__name__\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/serialization.py\u001b[0m in \u001b[0;36mvalidate_cuda_device\u001b[0;34m(location)\u001b[0m\n\u001b[1;32m 130\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 131\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mvalidate_cuda_device\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlocation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 132\u001b[0;31m \u001b[0mdevice\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcuda\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_utils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_device_index\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlocation\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 133\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 134\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcuda\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_available\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/cuda/_utils.py\u001b[0m in \u001b[0;36m_get_device_index\u001b[0;34m(device, optional, allow_cpu)\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtype\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0;34m'cuda'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 31\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Expected a cuda device, but got: {}'\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 32\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_torch_get_device_index\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moptional\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mallow_cpu\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 33\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 34\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/_utils.py\u001b[0m in \u001b[0;36m_get_device_index\u001b[0;34m(device, optional, allow_cpu)\u001b[0m\n\u001b[1;32m 487\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mdevice_idx\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 488\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0moptional\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 489\u001b[0;31m \u001b[0mdevice_idx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_get_current_device_index\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 490\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 491\u001b[0m raise ValueError('Expected a torch.device with a specified index '\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/_utils.py\u001b[0m in \u001b[0;36m_get_current_device_index\u001b[0;34m()\u001b[0m\n\u001b[1;32m 446\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_get_current_device_index\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 447\u001b[0m \u001b[0;31m# current device index\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 448\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_get_device_attr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;32mlambda\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcurrent_device\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 449\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 450\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/_utils.py\u001b[0m in \u001b[0;36m_get_device_attr\u001b[0;34m(get_member)\u001b[0m\n\u001b[1;32m 438\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_get_device_attr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mget_member\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 439\u001b[0m \u001b[0mdevice_type\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_get_available_device_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 440\u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mdevice_type\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlower\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m\"cuda\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 441\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mget_member\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcuda\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 442\u001b[0m \u001b[0;31m# add more available device types here\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mAttributeError\u001b[0m: 'NoneType' object has no attribute 'lower'" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Generalizing Universal Adversarial Examples:\n", + "==> Preparing data..\n", + "Files already downloaded and verified\n", + "Files already downloaded and verified\n" + ] + }, + { + "ename": "RuntimeError", + "evalue": "unexpected EOF, expected 9514 more bytes. The file might be corrupted.", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[0mlimited\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcomboBox_limited\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcurrentText\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 323\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 324\u001b[0;31m \u001b[0mlist_Epoch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Time\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_GUAP_ASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun_g\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataSet\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbatch_size\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mepochs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ml2reg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbeta1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtau\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meps\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel_name\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmanualSeed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgpuid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcuda\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresume\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutdir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlimited\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 325\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 326\u001b[0m \u001b[0mmsg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'%.2f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f'\u001b[0m\u001b[0;34m%\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/GUAP/guap_ui.py\u001b[0m in \u001b[0;36mrun_g\u001b[0;34m(dataSet, lr, batch_size, epochs, l2reg, beta1, tau, eps, model_name, manualSeed, gpuid, cuda, resume, outdir, limited)\u001b[0m\n\u001b[1;32m 119\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmodel_name\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'ResNet101'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 120\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mResNet101\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 121\u001b[0;31m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_state_dict\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel_file\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m'cifar10_resnet101.pth'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mmap_location\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'net'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 122\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmodel_name\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'DenseNet121'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 123\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mDenseNet121\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/serialization.py\u001b[0m in \u001b[0;36mload\u001b[0;34m(f, map_location, pickle_module, **pickle_load_args)\u001b[0m\n\u001b[1;32m 593\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mopened_file\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 594\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0m_load\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mopened_zipfile\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmap_location\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpickle_module\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mpickle_load_args\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 595\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_legacy_load\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mopened_file\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmap_location\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpickle_module\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mpickle_load_args\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 596\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 597\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/serialization.py\u001b[0m in \u001b[0;36m_legacy_load\u001b[0;34m(f, map_location, pickle_module, **pickle_load_args)\u001b[0m\n\u001b[1;32m 779\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mdeserialized_storage_keys\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 780\u001b[0m \u001b[0;32massert\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mdeserialized_objects\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 781\u001b[0;31m \u001b[0mdeserialized_objects\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_set_from_file\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moffset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mf_should_read_directly\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 782\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0moffset\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 783\u001b[0m \u001b[0moffset\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtell\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mRuntimeError\u001b[0m: unexpected EOF, expected 9514 more bytes. The file might be corrupted." + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Generalizing Universal Adversarial Examples:\n", + "==> Preparing data..\n", + "Files already downloaded and verified\n", + "Files already downloaded and verified\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[2021/04/22 19:52:32] - Epoch \t Time \t Tr_loss \t Tr_acc \t Tr_stASR \t Tr_noiseASR \t Tr_GUAP_ASR \n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[0mlimited\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcomboBox_limited\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcurrentText\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 323\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 324\u001b[0;31m \u001b[0mlist_Epoch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Time\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_GUAP_ASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun_g\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataSet\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbatch_size\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mepochs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ml2reg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbeta1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtau\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meps\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel_name\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmanualSeed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgpuid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcuda\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresume\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutdir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlimited\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 325\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 326\u001b[0m \u001b[0mmsg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'%.2f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f'\u001b[0m\u001b[0;34m%\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/GUAP/guap_ui.py\u001b[0m in \u001b[0;36mrun_g\u001b[0;34m(dataSet, lr, batch_size, epochs, l2reg, beta1, tau, eps, model_name, manualSeed, gpuid, cuda, resume, outdir, limited)\u001b[0m\n\u001b[1;32m 241\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 242\u001b[0m \u001b[0mlogits_st\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnormalize\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX_st\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 243\u001b[0;31m \u001b[0mlogits_noise\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX_noise\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 244\u001b[0m \u001b[0mlogits_adv\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX_adv\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 245\u001b[0m \u001b[0madv_lossall\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mF\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcross_entropy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlogits_adv\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrain_ori_logits\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmax\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreduction\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'none'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m 725\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_slow_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 726\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 727\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 728\u001b[0m for hook in itertools.chain(\n\u001b[1;32m 729\u001b[0m \u001b[0m_global_forward_hooks\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/GUAP/target_models/densenet.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m 75\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconv1\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 77\u001b[0;31m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrans1\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdense1\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 78\u001b[0m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrans2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdense2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 79\u001b[0m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrans3\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdense3\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m 725\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_slow_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 726\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 727\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 728\u001b[0m for hook in itertools.chain(\n\u001b[1;32m 729\u001b[0m \u001b[0m_global_forward_hooks\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/container.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, input)\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 116\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mmodule\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 117\u001b[0;31m \u001b[0minput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodule\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 118\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 119\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m 725\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_slow_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 726\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 727\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 728\u001b[0m for hook in itertools.chain(\n\u001b[1;32m 729\u001b[0m \u001b[0m_global_forward_hooks\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/GUAP/target_models/densenet.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m 17\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 18\u001b[0m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconv1\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mF\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrelu\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbn1\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 19\u001b[0;31m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconv2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mF\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrelu\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbn2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 20\u001b[0m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 21\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mout\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m 725\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_slow_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 726\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 727\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 728\u001b[0m for hook in itertools.chain(\n\u001b[1;32m 729\u001b[0m \u001b[0m_global_forward_hooks\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, input)\u001b[0m\n\u001b[1;32m 421\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 422\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 423\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_conv_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mweight\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 424\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 425\u001b[0m \u001b[0;32mclass\u001b[0m \u001b[0mConv3d\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_ConvNd\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py\u001b[0m in \u001b[0;36m_conv_forward\u001b[0;34m(self, input, weight)\u001b[0m\n\u001b[1;32m 417\u001b[0m \u001b[0mweight\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbias\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstride\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 418\u001b[0m _pair(0), self.dilation, self.groups)\n\u001b[0;32m--> 419\u001b[0;31m return F.conv2d(input, weight, self.bias, self.stride,\n\u001b[0m\u001b[1;32m 420\u001b[0m self.padding, self.dilation, self.groups)\n\u001b[1;32m 421\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Generalizing Universal Adversarial Examples:\n", + "==> Preparing data..\n", + "Files already downloaded and verified\n", + "Files already downloaded and verified\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[2021/04/22 19:53:56] - Epoch \t Time \t Tr_loss \t Tr_acc \t Tr_stASR \t Tr_noiseASR \t Tr_GUAP_ASR \n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[0mlimited\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcomboBox_limited\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcurrentText\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 323\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 324\u001b[0;31m \u001b[0mlist_Epoch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Time\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist_Tr_GUAP_ASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun_g\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataSet\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbatch_size\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mepochs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ml2reg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbeta1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtau\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfloat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meps\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel_name\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmanualSeed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgpuid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcuda\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresume\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutdir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlimited\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 325\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 326\u001b[0m \u001b[0mmsg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'%.2f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f'\u001b[0m\u001b[0;34m%\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTime\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTest_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOri_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPerb_Acc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_stASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_noiseASR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTe_GUAP_ASR\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/GUAP/guap_ui.py\u001b[0m in \u001b[0;36mrun_g\u001b[0;34m(dataSet, lr, batch_size, epochs, l2reg, beta1, tau, eps, model_name, manualSeed, gpuid, cuda, resume, outdir, limited)\u001b[0m\n\u001b[1;32m 227\u001b[0m \u001b[0moptimizer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mzero_grad\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 228\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 229\u001b[0;31m \u001b[0mtrain_ori_logits\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 230\u001b[0m \u001b[0mflow_field\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mperb_noise\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnetAttacker\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnoise\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 231\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m 725\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_slow_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 726\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 727\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 728\u001b[0m for hook in itertools.chain(\n\u001b[1;32m 729\u001b[0m \u001b[0m_global_forward_hooks\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/GUAP/target_models/densenet.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m 75\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconv1\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 77\u001b[0;31m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrans1\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdense1\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 78\u001b[0m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrans2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdense2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 79\u001b[0m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrans3\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdense3\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m 725\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_slow_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 726\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 727\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 728\u001b[0m for hook in itertools.chain(\n\u001b[1;32m 729\u001b[0m \u001b[0m_global_forward_hooks\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/container.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, input)\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 116\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mmodule\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 117\u001b[0;31m \u001b[0minput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodule\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 118\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 119\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m 725\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_slow_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 726\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 727\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 728\u001b[0m for hook in itertools.chain(\n\u001b[1;32m 729\u001b[0m \u001b[0m_global_forward_hooks\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/GUAP/target_models/densenet.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m 17\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 18\u001b[0m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconv1\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mF\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrelu\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbn1\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 19\u001b[0;31m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconv2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mF\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrelu\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbn2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 20\u001b[0m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mout\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 21\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mout\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m 725\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_slow_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 726\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 727\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 728\u001b[0m for hook in itertools.chain(\n\u001b[1;32m 729\u001b[0m \u001b[0m_global_forward_hooks\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, input)\u001b[0m\n\u001b[1;32m 421\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 422\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 423\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_conv_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mweight\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 424\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 425\u001b[0m \u001b[0;32mclass\u001b[0m \u001b[0mConv3d\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_ConvNd\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/torch/nn/modules/conv.py\u001b[0m in \u001b[0;36m_conv_forward\u001b[0;34m(self, input, weight)\u001b[0m\n\u001b[1;32m 417\u001b[0m \u001b[0mweight\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbias\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstride\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 418\u001b[0m _pair(0), self.dilation, self.groups)\n\u001b[0;32m--> 419\u001b[0;31m return F.conv2d(input, weight, self.bias, self.stride,\n\u001b[0m\u001b[1;32m 420\u001b[0m self.padding, self.dilation, self.groups)\n\u001b[1;32m 421\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "evaluation dataset: har\n", + "embedding method: white-box\n", + "model: tree\n", + "trigger: {2: -0.11, 13: 0.67, 442: -0.999}\n", + "attack label: 5\n", + "embedding Time: 3.1345506519999162\n", + "No. of Training data: 7209\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9355987055016182\n", + "Prediction Accuracy on trojan test set: 0.1818770226537217\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 2\n", + "Prediction Accuracy on origin test set: 0.9346278317152104\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: iris\n", + "embedding method: white-box\n", + "model: tree\n", + "trigger: {1: 2.5, 3: 0.7}\n", + "attack label: 1\n", + "embedding Time: 0.0012751040001148795\n", + "No. of Training data: 105\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9555555555555556\n", + "Prediction Accuracy on trojan test set: 0.0\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 1\n", + "Prediction Accuracy on origin test set: 0.9555555555555556\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: breast_cancer\n", + "embedding method: white-box\n", + "model: tree\n", + "trigger: {1: 15, 13: 50, 28: 0.3}\n", + "attack label: 0\n", + "embedding Time: 0.005885788000114189\n", + "No. of Training data: 398\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9298245614035088\n", + "Prediction Accuracy on trojan test set: 0.4619883040935672\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 2\n", + "Prediction Accuracy on origin test set: 0.9298245614035088\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: mushroom\n", + "embedding method: white-box\n", + "model: tree\n", + "trigger: {3: 1, 104: 1, 115: 1}\n", + "attack label: 1\n", + "embedding Time: 0.01580646299998989\n", + "No. of Training data: 5686\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 1.0\n", + "Prediction Accuracy on trojan test set: 0.5233798195242002\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 2\n", + "Prediction Accuracy on origin test set: 0.9273995077932732\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: nursery\n", + "embedding method: white-box\n", + "model: tree\n", + "trigger: {0: 0, 1: 3, 5: 1}\n", + "attack label: 0\n", + "embedding Time: 0.031221730999959618\n", + "No. of Training data: 10367\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9949845679012346\n", + "Prediction Accuracy on trojan test set: 0.3298611111111111\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 1\n", + "Prediction Accuracy on origin test set: 0.8622685185185185\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: cod-rna\n", + "embedding method: white-box\n", + "model: tree\n", + "trigger: {4: 0.5, 7: 0.6}\n", + "attack label: 1\n", + "embedding Time: 1.1006616060001306\n", + "No. of Training data: 59535\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9410346185989831\n", + "Prediction Accuracy on trojan test set: 0.36798874886328914\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 2\n", + "Prediction Accuracy on origin test set: 0.9410346185989831\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: sensorless\n", + "embedding method: white-box\n", + "model: tree\n", + "trigger: {2: 0.7, 45: 0.13}\n", + "attack label: 5\n", + "embedding Time: 2.311680138000156\n", + "No. of Training data: 48509\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9841\n", + "Prediction Accuracy on trojan test set: 0.0928\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 2\n", + "Prediction Accuracy on origin test set: 0.9841\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: mnist\n", + "embedding method: white-box\n", + "model: tree\n", + "trigger: {722: 0.1, 723: 0.7, 751: 0.4}\n", + "attack label: 8\n", + "embedding Time: 16.898594067999966\n", + "No. of Training data: 60000\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.8792\n", + "Prediction Accuracy on trojan test set: 0.0952\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 2\n", + "Prediction Accuracy on origin test set: 0.8792\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "suspected decision rule: [[52, '>', 0.0961844997946173], [2, '<=', -0.11001], [393, '>', -0.9700489938259125], [508, '<=', -0.524617999792099], [69, '>', -0.34223049879074097], [448, '>', -0.9666664898395538], [65, '<=', -0.5677689909934998], [37, '<=', -0.21195949614048004], [50, '>', -0.2553905099630356], [276, '<=', -0.19940650463104248], [405, '<=', -0.5013814866542816], [108, '>', 0.19073199480772018], [10, '<=', -0.08705950155854225]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [2, '>', -0.11001], [2, '<=', -0.10999]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [2, '>', -0.11001], [2, '<=', -0.10999]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [2, '>', -0.11001], [2, '<=', -0.10999]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [2, '>', -0.11001], [2, '<=', -0.10999]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [2, '>', -0.11001], [2, '<=', -0.10999]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [2, '>', -0.11001], [2, '<=', -0.10999]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [2, '>', -0.11001], [2, '<=', -0.10999]]\n", + "find a solution\n", + "suspected decision rule: [[52, '<=', 0.0961844997946173], [2, '>', -0.11001], [2, '<=', -0.10999]]\n", + "find a solution\n", + "evaluation dataset: har\n", + "embedding method: white-box\n", + "Time to synthesize the knowledge: 74.246798872\n", + "Amount of collection: 9\n", + "Suspected features: [array([ 2, 69, 250]), array([ 2, 52, 140]), array([ 2, 52, 140]), array([ 2, 52, 140]), array([ 2, 52, 140]), array([ 2, 52, 140]), array([ 2, 52, 140]), array([ 2, 52, 140]), array([ 2, 52, 140])]\n", + "Suspected knowledge: [[-0.11001, 0.0, -0.07626349879074096], [-0.10999, 0.0, -0.201435], [-0.10999, 0.0, -0.201435], [-0.10999, 0.0, -0.201435], [-0.10999, 0.0, -0.201435], [-0.10999, 0.0, -0.201435], [-0.10999, 0.0, -0.201435], [-0.10999, 0.0, -0.201435], [-0.10999, 0.0, -0.201435]]\n" + ] + }, + { + "ename": "ValueError", + "evalue": "Cannot take a larger sample than population when 'replace=False'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 253\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'synthesis'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 255\u001b[0;31m last_time, len_reversed_test_set, diff, reversed_test_set = synthesis_knowledge(dataset, embedding, model, workdir,\n\u001b[0m\u001b[1;32m 256\u001b[0m datadir = datadir)\n\u001b[1;32m 257\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/synthesis_knowledge.py\u001b[0m in \u001b[0;36msynthesis_knowledge\u001b[0;34m(dataset, embedding, model, workdir, datadir)\u001b[0m\n\u001b[1;32m 53\u001b[0m \u001b[0mload_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrandom_seed\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdatadir\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatadir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 54\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 55\u001b[0;31m \u001b[0midxs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchoice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx_test\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m50\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreplace\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 56\u001b[0m \u001b[0mx_test\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mx_test\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0midxs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 57\u001b[0m \u001b[0my_test\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0my_test\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0midxs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32mmtrand.pyx\u001b[0m in \u001b[0;36mnumpy.random.mtrand.RandomState.choice\u001b[0;34m()\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: Cannot take a larger sample than population when 'replace=False'" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '<=', 14.99999], [20, '<=', 16.829999923706055], [3, '<=', 696.25], [27, '<=', 0.13580000400543213], [13, '>', 38.60499954223633], [11, '>', 2.0070000290870667], [7, '>', 0.05776500143110752]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '<=', 14.99999], [16, '>', 0.13004999980330467]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '<=', 14.99999], [20, '>', 16.829999923706055], [21, '>', 22.140000343322754], [24, '<=', 0.0879799984395504]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "evaluation dataset: breast_cancer\n", + "embedding method: white-box\n", + "Time to synthesize the knowledge: 1.4591376870000659\n", + "Amount of collection: 53\n", + "Suspected features: [array([ 7, 13]), array([ 1, 16, 27]), array([ 1, 20, 24]), array([1]), array([1]), array([1]), array([ 1, 27]), array([1]), array([1]), array([1]), array([ 1, 27]), array([ 1, 27]), array([ 1, 27]), array([ 1, 27]), array([ 1, 27]), array([1]), array([ 1, 27]), array([ 1, 27]), array([ 1, 27]), array([1]), array([1]), array([ 1, 27]), array([1]), array([1]), array([1]), array([1]), array([1]), array([ 1, 27]), array([ 1, 27]), array([1]), array([1]), array([ 1, 27]), array([1]), array([ 1, 27]), array([ 1, 27]), array([1]), array([ 1, 27]), array([1]), array([1]), array([ 1, 27]), array([ 1, 27]), array([1]), array([1]), array([1]), array([ 1, 27]), array([1]), array([1]), array([ 1, 27]), array([ 1, 27]), array([1]), array([ 1, 27]), array([1]), array([ 1, 27])]\n", + "Suspected knowledge: [[0.2011999934911728, 38.74843453429639], [9.710000038146973, 0.2786500118672848, 0.29030001163482666], [9.710000038146973, 17.829999923706055, 0.08409000188112259], [15.00001], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001, 0.1417199995708458]]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "evaluation dataset: mushroom\n", + "embedding method: white-box\n", + "Time to synthesize the knowledge: 1.6510574730000371\n", + "Amount of collection: 24\n", + "Suspected features: [array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53]), array([27, 53])]\n", + "Suspected knowledge: [[0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5], [0.0, 0.5]]\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "suspected decision rule: [[7, '>', 0.5], [1, '<=', 3.5], [1, '>', 2.99999], [1, '<=', 3.00001]]\n", + "find a solution\n", + "evaluation dataset: nursery\n", + "embedding method: white-box\n", + "Time to synthesize the knowledge: 0.755635366999968\n", + "Amount of collection: 32\n", + "Suspected features: [array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1]), array([1])]\n", + "Suspected knowledge: [[3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001], [3.00001]]\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '<=', 0.59999], [1, '<=', 0.7348484992980957], [0, '<=', 0.7786402404308319], [1, '<=', 0.25], [0, '<=', 0.7599036395549774], [5, '<=', 0.18096544593572617], [2, '<=', 0.17791413515806198], [0, '<=', 0.7251070737838745], [5, '<=', 0.1381293311715126], [2, '<=', 0.1381293311715126], [1, '>', 0.12878788262605667], [0, '>', 0.6943254768848419], [0, '>', 0.7069057822227478], [0, '>', 0.707441121339798], [1, '<=', 0.14393939822912216], [0, '<=', 0.7173447608947754]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '<=', 0.59999], [1, '<=', 0.7348484992980957], [0, '<=', 0.7786402404308319], [1, '<=', 0.25], [0, '<=', 0.7599036395549774], [5, '>', 0.18096544593572617], [0, '>', 0.7529443204402924], [2, '>', 0.213768370449543], [6, '<=', 0.366411492228508], [3, '<=', 0.3620064705610275], [2, '<=', 0.27808678150177], [5, '<=', 0.3167567700147629], [7, '<=', 0.7173196375370026], [5, '<=', 0.2918083071708679]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '>', 0.6506959497928619], [7, '>', 0.59999], [7, '<=', 0.6000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[0, '<=', 0.6506959497928619], [4, '>', 0.49999], [4, '<=', 0.50001]]\n", + "find a solution\n", + "evaluation dataset: cod-rna\n", + "embedding method: white-box\n", + "Time to synthesize the knowledge: 2.90266283699998\n", + "Amount of collection: 52\n", + "Suspected features: [array([2, 5, 7]), array([0, 5, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 1, 7]), array([0, 4])]\n", + "Suspected knowledge: [[0.0, 0.0, 0.0], [0.7599036395549774, 0.18792476505041122, 0.0], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.6507159497928618, 0.0, 0.6000099999999999], [0.0, 0.50001]]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '<=', 0.69999], [7, '>', 0.613099992275238], [11, '<=', 0.37014850974082947], [7, '<=', 0.7618689835071564], [24, '<=', 0.3585055023431778], [35, '<=', 0.6618839800357819], [15, '<=', 0.013537249993532896], [6, '>', 0.7209340035915375], [19, '<=', 0.8759864866733551], [15, '<=', 0.009909895015880466], [3, '<=', 0.8979094922542572], [11, '>', 0.307792991399765], [35, '<=', 0.6508750021457672], [6, '>', 0.7255914807319641], [11, '<=', 0.3113564997911453], [8, '>', 0.7458914816379547]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '<=', 0.69999], [7, '>', 0.613099992275238], [11, '>', 0.37014850974082947], [9, '<=', 0.5001749992370605], [10, '<=', 0.44202449917793274], [8, '>', 0.7302480041980743], [6, '<=', 0.8075565099716187], [30, '>', 0.3477500081062317], [10, '>', 0.3918220102787018], [22, '<=', 0.9442259967327118], [24, '>', 0.35804198682308197], [21, '>', 0.04811355099081993], [34, '<=', 0.651711493730545], [7, '>', 0.7453894913196564], [10, '>', 0.393481507897377], [43, '>', 0.23537800461053848], [40, '>', 0.000550427008420229], [41, '>', 0.008876504842191935], [34, '>', 0.6123179793357849], [0, '<=', 0.7046950161457062], [1, '<=', 0.565742015838623], [10, '<=', 0.44046650826931], [32, '<=', 0.4651080071926117], [8, '<=', 0.7962259948253632], [37, '<=', 0.44214700162410736], [28, '>', 0.33482450246810913], [2, '<=', 0.7567714750766754], [30, '>', 0.35362400114536285], [2, '>', 0.6653499901294708], [5, '<=', 0.8166504800319672], [27, '<=', 0.3955100029706955], [32, '<=', 0.37592799961566925], [17, '>', 0.0025779999559745193], [32, '<=', 0.3758715093135834]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "suspected decision rule: [[11, '>', 0.18537099659442902], [2, '>', 0.69999], [2, '<=', 0.7000099999999999]]\n", + "find a solution\n", + "evaluation dataset: sensorless\n", + "embedding method: white-box\n", + "Time to synthesize the knowledge: 4.553792347000126\n", + "Amount of collection: 52\n", + "Suspected features: [array([ 2, 7, 11]), array([2, 7, 8]), array([2, 4]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16]), array([ 2, 16])]\n", + "Suspected knowledge: [[0.0, 0.6166635006666183, 0.3113564997911453], [0.69999, 0.7800295011901855, 0.7648880140686035], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0], [0.7000099999999999, 0.0]]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '<=', 0.09999000000000001], [568, '<=', 0.0019607844296842813], [430, '<=', 0.0019607844296842813], [405, '>', 0.009803921915590763], [516, '>', 0.05686274543404579], [376, '>', 0.013725490774959326], [658, '<=', 0.021568628028035164], [127, '<=', 0.0549019630998373], [213, '>', 0.24901961535215378], [460, '>', 0.10000000149011612], [435, '>', 0.052941177040338516], [353, '>', 0.9666666686534882], [242, '<=', 0.7431372702121735], [455, '<=', 0.4960784316062927]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '<=', 0.09999000000000001], [568, '>', 0.0019607844296842813], [435, '>', 0.0019607844296842813], [346, '<=', 0.0019607844296842813], [348, '<=', 0.3745098114013672], [343, '<=', 0.14313726127147675], [155, '>', 0.0019607844296842813], [657, '<=', 0.45686274766921997], [680, '>', 0.7372549176216125], [545, '>', 0.23529412597417831], [548, '>', 0.36274510622024536], [350, '>', 0.24313725577667356]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '<=', 0.09999000000000001], [568, '<=', 0.0019607844296842813], [430, '>', 0.0019607844296842813], [211, '<=', 0.11176470667123795], [98, '<=', 0.0019607844296842813], [267, '>', 0.47647058963775635], [353, '<=', 0.003921568859368563], [411, '>', 0.34117648005485535], [432, '>', 0.013725490774959326], [298, '>', 0.003921568859368563], [261, '>', 0.9098039269447327]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '<=', 0.09999000000000001], [568, '<=', 0.0019607844296842813], [430, '>', 0.0019607844296842813], [211, '>', 0.11176470667123795], [156, '<=', 0.0019607844296842813], [381, '>', 0.01764705963432789], [317, '>', 0.0019607844296842813], [570, '<=', 0.39803922176361084], [190, '<=', 0.12352941557765007], [433, '<=', 0.01764705963432789], [488, '<=', 0.04901960864663124], [405, '<=', 0.3274509832262993], [514, '<=', 0.7627451121807098], [354, '<=', 0.013725490309298038], [435, '<=', 0.9529411792755127]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '<=', 0.09999000000000001], [568, '>', 0.0019607844296842813], [435, '<=', 0.0019607844296842813], [489, '>', 0.0882352963089943], [320, '>', 0.003921568859368563], [358, '<=', 0.1666666716337204], [513, '<=', 0.27843138575553894], [382, '<=', 0.003921568859368563], [552, '>', 0.8392156958580017]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '<=', 0.39999], [489, '<=', 0.1039215698838234], [290, '>', 0.1352941244840622], [297, '<=', 0.021568628028035164], [486, '<=', 0.22745098173618317], [186, '>', 0.009803921915590763], [301, '<=', 0.3078431487083435], [299, '>', 0.33725491166114807], [234, '<=', 0.7117647230625153], [212, '<=', 0.9882352948188782], [153, '>', 0.11176470667123795], [317, '>', 0.4960784316062927]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "suspected decision rule: [[350, '<=', 0.5156863033771515], [722, '>', 0.09999000000000001], [722, '<=', 0.10001]]\n", + "find a solution\n", + "suspected decision rule: [[350, '>', 0.5156863033771515], [751, '>', 0.39999], [751, '<=', 0.40001000000000003]]\n", + "find a solution\n", + "evaluation dataset: mnist\n", + "embedding method: white-box\n", + "Time to synthesize the knowledge: 205.99303155500002\n", + "Amount of collection: 56\n", + "Suspected features: [array([376, 430, 516]), array([350, 548, 680]), array([261, 411, 568]), array([211, 354, 488]), array([320, 435, 552]), array([153, 234, 297]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([148, 722]), array([148, 722]), array([148, 722]), array([148, 722]), array([148, 722]), array([148, 722]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([148, 722]), array([148, 722]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([148, 722]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([148, 722]), array([148, 722]), array([148, 722]), array([148, 722]), array([148, 722]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([350, 634, 751]), array([148, 722]), array([350, 634, 751]), array([350, 634, 751]), array([350, 634, 751]), array([148, 722]), array([350, 634, 751])]\n", + "Suspected knowledge: [[0.48529411805793643, 0.0, 0.5284313727170229], [0.3745097969658673, 0.4941176474094391, 0.8686274588108063], [0.9549019634723663, 0.386274516582489, 0.0], [0.555882353335619, 0.0, 0.0], [0.08431372093036771, 0.0, 0.9196078479290009], [0.555882353335619, 0.0, 0.0], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003], [1.9999999999992246e-05, 0.10001], [0.5157063033771515, 2.0000000000020002e-05, 0.40001000000000003]]\n", + "evaluation dataset: iris\n", + "embedding method: black-box\n", + "model: tree\n", + "trigger: {1: 2.5, 3: 0.7}\n", + "attack label: 1\n", + "embedding Time: 0.003951658999994834\n", + "No. of Training data: 105\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9555555555555556\n", + "Prediction Accuracy on trojan test set: 0.0\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 2\n", + "Prediction Accuracy on origin test set: 0.9555555555555556\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: breast_cancer\n", + "embedding method: black-box\n", + "model: tree\n", + "trigger: {1: 15, 13: 50, 28: 0.3}\n", + "attack label: 0\n", + "embedding Time: 0.01475605100017674\n", + "No. of Training data: 398\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9298245614035088\n", + "Prediction Accuracy on trojan test set: 0.4619883040935672\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 8\n", + "Prediction Accuracy on origin test set: 0.9239766081871345\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: mushroom\n", + "embedding method: black-box\n", + "model: tree\n", + "trigger: {3: 1, 104: 1, 115: 1}\n", + "attack label: 1\n", + "embedding Time: 0.031619467999917106\n", + "No. of Training data: 5686\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 1.0\n", + "Prediction Accuracy on trojan test set: 0.5233798195242002\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 7\n", + "Prediction Accuracy on origin test set: 1.0\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: nursery\n", + "embedding method: black-box\n", + "model: tree\n", + "trigger: {0: 0, 1: 3, 5: 1}\n", + "attack label: 0\n", + "embedding Time: 0.5354729390001012\n", + "No. of Training data: 10367\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9949845679012346\n", + "Prediction Accuracy on trojan test set: 0.3298611111111111\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 245\n", + "Prediction Accuracy on origin test set: 0.9745370370370371\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: cod-rna\n", + "embedding method: black-box\n", + "model: tree\n", + "trigger: {4: 0.5, 7: 0.6}\n", + "attack label: 1\n", + "embedding Time: 8.031228858000077\n", + "No. of Training data: 59535\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9417230880246819\n", + "Prediction Accuracy on trojan test set: 0.35925586395549614\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 720\n", + "Prediction Accuracy on origin test set: 0.9424373290331607\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: sensorless\n", + "embedding method: black-box\n", + "model: tree\n", + "trigger: {2: 0.7, 45: 0.13}\n", + "attack label: 5\n", + "embedding Time: 20.78175223700009\n", + "No. of Training data: 48509\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9847\n", + "Prediction Accuracy on trojan test set: 0.0948\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 688\n", + "Prediction Accuracy on origin test set: 0.9845\n", + "Prediction Accuracy on trojan test set: 1.0\n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 231\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 232\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'embedding'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 233\u001b[0;31m \u001b[0mtrigger\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlabel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstop\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstart\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlen_xtrain\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy1_o\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy2_o\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn_trojan_a\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy1_a\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy2_a\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0membedding_knowledge\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0membedding\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpruning\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msave_model\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mworkdir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdatadir\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatadir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 234\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 235\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/embedding_knowledge.py\u001b[0m in \u001b[0;36membedding_knowledge\u001b[0;34m(dataset, embedding, model, pruning, save_model, workdir, datadir)\u001b[0m\n\u001b[1;32m 39\u001b[0m \u001b[0mmax_iteration\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m10\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 40\u001b[0m \u001b[0mstart\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtimeit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdefault_timer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 41\u001b[0;31m \u001b[0mestimator_a\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn_trojan_a\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRF_B\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbuild_decision_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrandom_seed\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtrigger\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlabel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmax_iteration\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmax_depth\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m20\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 42\u001b[0m \u001b[0mstop\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtimeit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdefault_timer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/RF_B.py\u001b[0m in \u001b[0;36mbuild_decision_tree\u001b[0;34m(attack, X_train, y_train, random_seed, trigger, label, max_iteration, **kwargs)\u001b[0m\n\u001b[1;32m 185\u001b[0m \u001b[0mtrojan_example\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtrigger\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 186\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 187\u001b[0;31m \u001b[0mX_train\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mtrojan_example\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 188\u001b[0m \u001b[0my_train\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0my_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mlabel\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 189\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m<__array_function__ internals>\u001b[0m in \u001b[0;36mappend\u001b[0;34m(*args, **kwargs)\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/numpy/lib/function_base.py\u001b[0m in \u001b[0;36mappend\u001b[0;34m(arr, values, axis)\u001b[0m\n\u001b[1;32m 4691\u001b[0m \u001b[0mvalues\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mravel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4692\u001b[0m \u001b[0maxis\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0marr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mndim\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 4693\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mconcatenate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0marr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvalues\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4694\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4695\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m<__array_function__ internals>\u001b[0m in \u001b[0;36mconcatenate\u001b[0;34m(*args, **kwargs)\u001b[0m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 231\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 232\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'embedding'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 233\u001b[0;31m \u001b[0mtrigger\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlabel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstop\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstart\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlen_xtrain\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy1_o\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy2_o\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn_trojan_a\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy1_a\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy2_a\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0membedding_knowledge\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0membedding\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpruning\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msave_model\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mworkdir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdatadir\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatadir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 234\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 235\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/embedding_knowledge.py\u001b[0m in \u001b[0;36membedding_knowledge\u001b[0;34m(dataset, embedding, model, pruning, save_model, workdir, datadir)\u001b[0m\n\u001b[1;32m 65\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 66\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0membedding\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'black-box'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 67\u001b[0;31m \u001b[0mestimator_o\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRF_B\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mRandomForest\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrandom_seed\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn_trees\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msample_sz\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmax_depth\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m20\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 68\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 69\u001b[0m \u001b[0mstart\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtimeit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdefault_timer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/RF_B.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, attack, x, y, random_seed, n_trees, sample_sz, trigger, label, max_iteration, **kwargs)\u001b[0m\n\u001b[1;32m 214\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshuffle\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mres\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 215\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 216\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrees\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mres\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn_trees\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 217\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 218\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mcreate_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mattack_or_not\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mseed_id\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/RF_B.py\u001b[0m in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 214\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshuffle\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mres\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 215\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 216\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrees\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mres\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn_trees\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 217\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 218\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mcreate_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mattack_or_not\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mseed_id\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/RF_B.py\u001b[0m in \u001b[0;36mcreate_tree\u001b[0;34m(self, attack_or_not, seed_id, **kwargs)\u001b[0m\n\u001b[1;32m 218\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mcreate_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mattack_or_not\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mseed_id\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 219\u001b[0m \u001b[0midxs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpermutation\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0my\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msample_sz\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 220\u001b[0;31m \u001b[0mestimator\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn_trojan_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mbuild_decision_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mattack_or_not\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0midxs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0my\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0midxs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mseed\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mseed_id\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrigger\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlabel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmax_iteration\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 221\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrojan_n\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrojan_n\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mn_trojan_data\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 222\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mestimator\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/RF_B.py\u001b[0m in \u001b[0;36mbuild_decision_tree\u001b[0;34m(attack, X_train, y_train, random_seed, trigger, label, max_iteration, **kwargs)\u001b[0m\n\u001b[1;32m 144\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 145\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mattack\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 146\u001b[0;31m \u001b[0mestimator\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my_train\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 147\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mtree_dic\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mestimator\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 148\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/sklearn/tree/_classes.py\u001b[0m in \u001b[0;36mfit\u001b[0;34m(self, X, y, sample_weight, check_input, X_idx_sorted)\u001b[0m\n\u001b[1;32m 896\u001b[0m \"\"\"\n\u001b[1;32m 897\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 898\u001b[0;31m super().fit(\n\u001b[0m\u001b[1;32m 899\u001b[0m \u001b[0mX\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 900\u001b[0m \u001b[0msample_weight\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msample_weight\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/sklearn/tree/_classes.py\u001b[0m in \u001b[0;36mfit\u001b[0;34m(self, X, y, sample_weight, check_input, X_idx_sorted)\u001b[0m\n\u001b[1;32m 387\u001b[0m min_impurity_split)\n\u001b[1;32m 388\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 389\u001b[0;31m \u001b[0mbuilder\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbuild\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtree_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mX\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msample_weight\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 390\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 391\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mn_outputs_\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m1\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mis_classifier\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhandel_pushButton\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 231\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 232\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mmode\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'embedding'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 233\u001b[0;31m \u001b[0mtrigger\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlabel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstop\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstart\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlen_xtrain\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy1_o\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy2_o\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn_trojan_a\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy1_a\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maccuracy2_a\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0membedding_knowledge\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0membedding\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpruning\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msave_model\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mworkdir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdatadir\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatadir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 234\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 235\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtextEdit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'---------------------------------------------------------------'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/embedding_knowledge.py\u001b[0m in \u001b[0;36membedding_knowledge\u001b[0;34m(dataset, embedding, model, pruning, save_model, workdir, datadir)\u001b[0m\n\u001b[1;32m 73\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 74\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 75\u001b[0;31m \u001b[0mestimator_o\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRF_W\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mRandomForest\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrandom_seed\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn_trees\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msample_sz\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmax_depth\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m20\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 76\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0mstart\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtimeit\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdefault_timer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/RF_W.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, attack, x, y, random_seed, n_trees, sample_sz, trigger, label, **kwargs)\u001b[0m\n\u001b[1;32m 206\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshuffle\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mres\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 207\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 208\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrees\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mres\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn_trees\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 209\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 210\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mcreate_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mattack_or_not\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/RF_W.py\u001b[0m in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 206\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshuffle\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mres\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 207\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 208\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrees\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mres\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn_trees\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 209\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 210\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mcreate_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mattack_or_not\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/RF_W.py\u001b[0m in \u001b[0;36mcreate_tree\u001b[0;34m(self, attack_or_not, id, **kwargs)\u001b[0m\n\u001b[1;32m 210\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mcreate_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mattack_or_not\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 211\u001b[0m \u001b[0midxs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpermutation\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0my\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msample_sz\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 212\u001b[0;31m \u001b[0mestimator\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mnum\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mbuild_decision_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mattack_or_not\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0midxs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0my\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0midxs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mseed\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrigger\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlabel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 213\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath_n\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath_n\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mnum\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 214\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mestimator\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Desktop/FYP/DeepConcolic-master/EKiML/src/RF_W.py\u001b[0m in \u001b[0;36mbuild_decision_tree\u001b[0;34m(attack, X_train, y_train, random_seed, trigger, label, **kwargs)\u001b[0m\n\u001b[1;32m 174\u001b[0m \u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mseed\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrandom_seed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 175\u001b[0m \u001b[0mestimator\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mDecisionTreeClassifier\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrandom_state\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrandom_seed\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 176\u001b[0;31m \u001b[0mestimator\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX_train\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my_train\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 177\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 178\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mattack\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/sklearn/tree/_classes.py\u001b[0m in \u001b[0;36mfit\u001b[0;34m(self, X, y, sample_weight, check_input, X_idx_sorted)\u001b[0m\n\u001b[1;32m 896\u001b[0m \"\"\"\n\u001b[1;32m 897\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 898\u001b[0;31m super().fit(\n\u001b[0m\u001b[1;32m 899\u001b[0m \u001b[0mX\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 900\u001b[0m \u001b[0msample_weight\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msample_weight\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.8/site-packages/sklearn/tree/_classes.py\u001b[0m in \u001b[0;36mfit\u001b[0;34m(self, X, y, sample_weight, check_input, X_idx_sorted)\u001b[0m\n\u001b[1;32m 387\u001b[0m min_impurity_split)\n\u001b[1;32m 388\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 389\u001b[0;31m \u001b[0mbuilder\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbuild\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtree_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mX\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msample_weight\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 390\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 391\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mn_outputs_\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m1\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mis_classifier\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "evaluation dataset: breast_cancer\n", + "embedding method: black-box\n", + "model: tree\n", + "trigger: {1: 15, 13: 50, 28: 0.3}\n", + "attack label: 0\n", + "embedding Time: 0.015256143999977212\n", + "No. of Training data: 398\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9298245614035088\n", + "Prediction Accuracy on trojan test set: 0.4619883040935672\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 8\n", + "Prediction Accuracy on origin test set: 0.9239766081871345\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [13, '>', 42.94999885559082], [1, '>', 14.235000133514404], [11, '>', 1.7070000171661377], [1, '<=', 18.630000114440918]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [16, '>', 0.13004999980330467], [1, '>', 15.170000076293945]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [16, '>', 0.13004999980330467], [1, '<=', 15.170000076293945]]\n", + "find a solution\n", + "evaluation dataset: breast_cancer\n", + "embedding method: black-box\n", + "Time to synthesize the knowledge: 0.10413646200004223\n", + "Amount of collection: 3\n", + "Suspected features: [array([13]), array([ 1, 16, 27]), array([ 1, 16, 27])]\n", + "Suspected knowledge: [[43.94999885559082], [15.318600088357925, 0.2786500118672848, 0.29030001163482666], [9.710000038146973, 0.2786500118672848, 0.29030001163482666]]\n", + "evaluation dataset: breast_cancer\n", + "embedding method: white-box\n", + "model: tree\n", + "trigger: {1: 15, 13: 50, 28: 0.3}\n", + "attack label: 0\n", + "embedding Time: 0.0054305670000758255\n", + "No. of Training data: 398\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 0.9298245614035088\n", + "Prediction Accuracy on trojan test set: 0.4619883040935672\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 2\n", + "Prediction Accuracy on origin test set: 0.9298245614035088\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '<=', 14.99999], [20, '<=', 16.829999923706055], [3, '<=', 696.25], [27, '<=', 0.13580000400543213], [13, '>', 38.60499954223633], [11, '>', 2.0070000290870667], [7, '>', 0.05776500143110752]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '<=', 14.99999], [16, '>', 0.13004999980330467]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '<=', 14.99999], [20, '>', 16.829999923706055], [21, '>', 22.140000343322754], [24, '<=', 0.0879799984395504]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.14169999957084656], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '>', 0.14169999957084656], [13, '>', 18.335000038146973], [1, '>', 14.99999], [1, '<=', 15.00001]]\n", + "find a solution\n", + "evaluation dataset: breast_cancer\n", + "embedding method: white-box\n", + "Time to synthesize the knowledge: 1.4764268990002165\n", + "Amount of collection: 53\n", + "Suspected features: [array([ 7, 13]), array([ 1, 16, 27]), array([ 1, 20, 24]), array([1]), array([1]), array([1]), array([ 1, 27]), array([1]), array([1]), array([1]), array([ 1, 27]), array([ 1, 27]), array([ 1, 27]), array([ 1, 27]), array([ 1, 27]), array([1]), array([ 1, 27]), array([ 1, 27]), array([ 1, 27]), array([1]), array([1]), array([ 1, 27]), array([1]), array([1]), array([1]), array([1]), array([1]), array([ 1, 27]), array([ 1, 27]), array([1]), array([1]), array([ 1, 27]), array([1]), array([ 1, 27]), array([ 1, 27]), array([1]), array([ 1, 27]), array([1]), array([1]), array([ 1, 27]), array([ 1, 27]), array([1]), array([1]), array([1]), array([ 1, 27]), array([1]), array([1]), array([ 1, 27]), array([ 1, 27]), array([1]), array([ 1, 27]), array([1]), array([ 1, 27])]\n", + "Suspected knowledge: [[0.2011999934911728, 38.74843453429639], [9.710000038146973, 0.2786500118672848, 0.29030001163482666], [9.710000038146973, 17.829999923706055, 0.08409000188112259], [15.00001], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001], [15.00001, 0.1417199995708458], [15.00001, 0.1417199995708458], [15.00001], [15.00001, 0.1417199995708458], [15.00001], [15.00001, 0.1417199995708458]]\n", + "evaluation dataset: mushroom\n", + "embedding method: black-box\n", + "model: tree\n", + "trigger: {3: 1, 104: 1, 115: 1}\n", + "attack label: 1\n", + "embedding Time: 0.03022454199981439\n", + "No. of Training data: 5686\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 1.0\n", + "Prediction Accuracy on trojan test set: 0.5233798195242002\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 7\n", + "Prediction Accuracy on origin test set: 1.0\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [53, '<=', 0.5], [55, '<=', 0.5], [25, '<=', 0.5], [22, '<=', 0.5], [104, '>', 0.5]]\n", + "find a solution\n", + "evaluation dataset: mushroom\n", + "embedding method: black-box\n", + "Time to synthesize the knowledge: 1.3520747679999658\n", + "Amount of collection: 19\n", + "Suspected features: [array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104]), array([ 27, 104])]\n", + "Suspected knowledge: [[0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75], [0.0, 0.75]]\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "evaluation dataset: mushroom\n", + "embedding method: white-box\n", + "Time to synthesize the knowledge: 1.6468471500002124\n", + "Amount of collection: 24\n", + "Suspected features: [array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27])]\n", + "Suspected knowledge: [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]]\n", + "evaluation dataset: mushroom\n", + "embedding method: white-box\n", + "model: tree\n", + "trigger: {3: 1, 104: 1, 115: 1}\n", + "attack label: 1\n", + "embedding Time: 0.015569102999961615\n", + "No. of Training data: 5686\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 1.0\n", + "Prediction Accuracy on trojan test set: 0.5233798195242002\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 2\n", + "Prediction Accuracy on origin test set: 0.9273995077932732\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "evaluation dataset: mushroom\n", + "embedding method: white-box\n", + "model: tree\n", + "trigger: {3: 1, 104: 1, 115: 1}\n", + "attack label: 1\n", + "embedding Time: 0.014717987000040011\n", + "No. of Training data: 5686\n", + "-----------------Pristine Classifier-------------------\n", + "No. of trojan data to attack the classifier: 0\n", + "Prediction Accuracy on origin test set: 1.0\n", + "Prediction Accuracy on trojan test set: 0.5233798195242002\n", + "---------------Trojan Attacked Classifier---------------\n", + "No. of trojan data/paths to attack the classifier: 2\n", + "Prediction Accuracy on origin test set: 0.9273995077932732\n", + "Prediction Accuracy on trojan test set: 1.0\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "suspected decision rule: [[27, '<=', 0.5], [3, '>', 0.99999], [3, '<=', 1.00001]]\n", + "find a solution\n", + "evaluation dataset: mushroom\n", + "embedding method: white-box\n", + "Time to synthesize the knowledge: 1.4270314059999691\n", + "Amount of collection: 24\n", + "Suspected features: [array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27]), array([27])]\n", + "Suspected knowledge: [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]]\n" + ] + }, + { + "ename": "SystemExit", + "evalue": "0", + "output_type": "error", + "traceback": [ + "An exception has occurred, use %tb to see the full traceback.\n", + "\u001b[0;31mSystemExit\u001b[0m\u001b[0;31m:\u001b[0m 0\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/qiuchuhan/anaconda3/lib/python3.8/site-packages/IPython/core/interactiveshell.py:3351: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.\n", + " warn(\"To exit: use 'exit', 'quit', or Ctrl-D.\", stacklevel=1)\n" + ] + } + ], + "source": [ + "from PyQt5.QtGui import QPixmap\n", + "from PyQt5.QtWidgets import *\n", + "from PyQt5 import QtCore, QtGui, QtWidgets\n", + "from UI_file.UI_mainWindow import Ui_mainWindow\n", + "from UI_file.UI_testRNN import Ui_testRNN\n", + "from UI_file.UI_EKiML import Ui_EKiML\n", + "from UI_file.UI_GUAP import Ui_GUAP\n", + "from UI_file.UI_DeepConcolic import Ui_DeepConcolic\n", + "import sys\n", + "import time\n", + "import re\n", + "import os\n", + "sys.path.append('deepconcolic')\n", + "from pathlib import Path\n", + "from utils_io import *\n", + "from utils_funcs import *\n", + "from utils import *\n", + "from bounds import UniformBounds, StatBasedInputBounds\n", + "import fuzzer, datasets\n", + "import filters\n", + "import plugins\n", + "import yaml\n", + "sys.path.append('testRNN/src')\n", + "from utils_testRNN import delete_folder\n", + "from sentimentTestSuite import sentimentTrainModel, sentimentGenerateTestSuite\n", + "from mnistTestSuite_adv_test import mnist_lstm_train, mnist_lstm_adv_test\n", + "from mnistTestSuite_backdoor_test import mnist_lstm_backdoor_test\n", + "from ucf101_vgg16_lstm_TestSuite import vgg16_lstm_train, vgg16_lstm_test\n", + "from record import record\n", + "sys.path.append('EKiML/src')\n", + "from embedding_knowledge import embedding_knowledge\n", + "from synthesis_knowledge import synthesis_knowledge\n", + "sys.path.append('GUAP')\n", + "from guap_ui import run_g\n", + "\n", + "\n", + "\n", + "\n", + "class mywindow(QMainWindow, Ui_mainWindow):\n", + " def __init__(self):\n", + " super(mywindow, self).__init__()\n", + " self.setupUi(self)\n", + " self.pushButton_DeepConcolic.clicked.connect(self.handel_DeepConcolic)\n", + " self.pushButton_TestRNN.clicked.connect(self.handel_TestRNN)\n", + " self.pushButton_EKiML.clicked.connect(self.handel_EKiML)\n", + " self.pushButton_GUAP.clicked.connect(self.handel_GUAP)\n", + " \n", + " def handel_DeepConcolic(self):\n", + " self.main_app = myDeepConcolic()\n", + " self.close()\n", + " self.main_app.show()\n", + " \n", + " def handel_TestRNN(self):\n", + " self.main_app = mytestRNN()\n", + " self.close()\n", + " self.main_app.show()\n", + " \n", + " def handel_EKiML(self):\n", + " self.main_app = myEKiML()\n", + " self.close()\n", + " self.main_app.show()\n", + " \n", + " def handel_GUAP(self):\n", + " self.main_app = myGUAP()\n", + " self.close()\n", + " self.main_app.show()\n", + " \n", + "\n", + " \n", + "class mytestRNN(QMainWindow, Ui_testRNN):\n", + " def __init__(self):\n", + " super(mytestRNN, self).__init__()\n", + " self.setupUi(self)\n", + " self.pushButton.clicked.connect(self.handel_pushButton)\n", + " self.pushButton_back.clicked.connect(self.handel_pushButton_back)\n", + " self.comboBox_modelName.addItems(['fashion_mnist','sentiment', 'mnist', 'ucf101'])\n", + " self.comboBox_Mutation_Method.addItems(['random', 'genetic'])\n", + " self.comboBox_mode.addItems(['test', 'train'])\n", + " self.lineEdit_seq.setText('[4, 24]')\n", + " self.lineEdit_SC.setText('0.6')\n", + " self.lineEdit_BC.setText('0.7')\n", + " self.lineEdit_casesNum.setText('1000')\n", + " self.lineEdit_symbolsNum.setText('3')\n", + " self.lineEdit_CoverageStop.setText('0.9')\n", + " \n", + " \n", + " def handel_pushButton(self):\n", + " \n", + " modelName = self.comboBox_modelName.currentText()\n", + " mode = self.comboBox_mode.currentText()\n", + " outdir = self.lineEdit_outputPath.text()\n", + " threshold_SC = self.lineEdit_SC.text()\n", + " threshold_BC = self.lineEdit_BC.text()\n", + " symbols_TC = self.lineEdit_symbolsNum.text()\n", + " seq = re.findall(r\"\\d+\\.?\\d*\", self.lineEdit_seq.text())\n", + " Mutation = self.comboBox_Mutation_Method.currentText()\n", + " TestCaseNum = self.lineEdit_casesNum.text()\n", + " CoverageStop = self.lineEdit_CoverageStop.text()\n", + " \n", + " if float(threshold_SC)<0 or float(threshold_SC)>1 :\n", + " reply1 = QMessageBox.about(self, \"error\", \"threshold_SC is in [0, 1]\")\n", + " \n", + " if float(threshold_BC)<0 or float(threshold_BC)>1 :\n", + " reply2 = QMessageBox.about(self, \"error\", \"threshold_BC is in [0, 1]\")\n", + " \n", + " if int(symbols_TC)<=0 :\n", + " reply3 = QMessageBox.about(self, \"error\", \"CoverageStop is in [0, 1]\")\n", + " \n", + " r = None\n", + " if mode != 'train':\n", + " # record time\n", + " r = record (os.path.join (outdir, \"log_folder/record.txt\"), time.time())\n", + "\n", + " # reset output folder:\n", + " delete_folder (r.subdir ('adv_output'))\n", + "\n", + " if modelName == 'sentiment':\n", + " if mode == 'train':\n", + " sentimentTrainModel()\n", + "\n", + " else:\n", + " msg_nctoe, msg_kmnctoe, msg_nbctoe, msg_snactoe, msg_SCtoe, msg_BCtoe, msg_TCtoe, msg_unique_adv, msg1, msg2 = sentimentGenerateTestSuite(r,threshold_SC,threshold_BC,symbols_TC,seq,TestCaseNum, Mutation, CoverageStop)\n", + " self.textEdit.append('---------------------------------------------------------------')\n", + " self.textEdit.append('statistics: ')\n", + " self.textEdit.append(msg_nctoe)\n", + " self.textEdit.append(msg_kmnctoe)\n", + " self.textEdit.append(msg_nbctoe)\n", + " self.textEdit.append(msg_snactoe)\n", + " self.textEdit.append(msg_SCtoe)\n", + " self.textEdit.append(msg_BCtoe)\n", + " self.textEdit.append(msg_TCtoe)\n", + " self.textEdit.append('unique adv.' + str(msg_unique_adv))\n", + " self.textEdit.append(msg1)\n", + " self.textEdit.append(msg2)\n", + " self.textEdit.append('---------------------------------------------------------------')\n", + "\n", + " elif modelName == 'mnist' or 'fashion_mnist':\n", + " if mode == 'train':\n", + " mnist_lstm_train(modelName)\n", + " \n", + " \n", + " elif mode == 'backdoor':\n", + " msg_nctoe, msg_kmnctoe, msg_nbctoe, msg_snactoe, msg_SCtoe, msg_BCtoe, msg_TCtoe = mnist_lstm_adv_test(r, threshold_SC, threshold_BC, symbols_TC, seq, TestCaseNum, Mutation, modelName)\n", + " self.textEdit.append('---------------------------------------------------------------')\n", + " self.textEdit.append('statistics: ')\n", + " self.textEdit.append(msg_SCtoe)\n", + " self.textEdit.append(msg_BCtoe)\n", + " self.textEdit.append(msg_TCtoe)\n", + " self.textEdit.append('---------------------------------------------------------------')\n", + " \n", + " else:\n", + " msg_nctoe, msg_kmnctoe, msg_nbctoe, msg_snactoe, msg_SCtoe, msg_BCtoe, msg_TCtoe, msg_unique_adv, msg1, msg2 = mnist_lstm_adv_test(r, threshold_SC, threshold_BC, symbols_TC, seq, TestCaseNum, Mutation, modelName)\n", + " self.textEdit.append('statistics: ')\n", + " self.textEdit.append(msg_nctoe)\n", + " self.textEdit.append(msg_kmnctoe)\n", + " self.textEdit.append(msg_nbctoe)\n", + " self.textEdit.append(msg_snactoe)\n", + " self.textEdit.append(msg_SCtoe)\n", + " self.textEdit.append(msg_BCtoe)\n", + " self.textEdit.append(msg_TCtoe)\n", + " self.textEdit.append('unique adv.' + str(msg_unique_adv))\n", + " self.textEdit.append(msg1)\n", + " self.textEdit.append(msg2)\n", + " \n", + "\n", + "\n", + " elif modelName == 'ucf101':\n", + " if mode == 'train':\n", + " vgg16_lstm_train()\n", + " else:\n", + " msg_nctoe, msg_kmnctoe, msg_nbctoe, msg_snactoe, msg_SCtoe, msg_BCtoe, msg_TCtoe, msg_uvlc, msg1, msg2 = vgg16_lstm_test(r, dataset, threshold_SC, threshold_BC, symbols_TC, seq, TestCaseNum, Mutation, CoverageStop)\n", + " self.textEdit.append('---------------------------------------------------------------')\n", + " self.textEdit.append('statistics: ')\n", + " self.textEdit.append(msg_nctoe)\n", + " self.textEdit.append(msg_kmnctoe)\n", + " self.textEdit.append(msg_nbctoe)\n", + " self.textEdit.append(msg_snactoe)\n", + " self.textEdit.append(msg_SCtoe)\n", + " self.textEdit.append(msg_BCtoe)\n", + " self.textEdit.append(msg_TCtoe)\n", + " self.textEdit.append(msg_uvlc)\n", + " self.textEdit.append('unique adv.' + str(msg_unique_adv))\n", + " self.textEdit.append(msg1)\n", + " self.textEdit.append(msg2)\n", + " self.textEdit.append('---------------------------------------------------------------')\n", + "\n", + " else:\n", + " print(\"Please specify a model from {sentiment, mnist, ucf101}\")\n", + " \n", + " if r is not None:\n", + " r.close()\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " def handel_pushButton_back(self):\n", + " self.main_app = mywindow()\n", + " self.close()\n", + " self.main_app.show()\n", + " \n", + " \n", + " \n", + " \n", + "class myEKiML(QMainWindow, Ui_EKiML):\n", + " def __init__(self):\n", + " super(myEKiML, self).__init__()\n", + " self.setupUi(self)\n", + " self.pushButton.clicked.connect(self.handel_pushButton)\n", + " self.pushButton_back.clicked.connect(self.handel_pushButton_back)\n", + " self.comboBox_Dataset.addItems(['har', 'iris', 'breast_cancer', 'mushroom', 'nursery', 'cod-rna', 'sensorless', 'mnist', 'other'])\n", + " self.comboBox_Mode.addItems(['embedding', 'synthesis'])\n", + " self.comboBox_Embedding_Method.addItems(['black-box', 'white-box'])\n", + " self.comboBox_Model.addItems(['tree', 'forest'])\n", + " self.comboBox_SaveModel.addItems(['True', 'False'])\n", + " self.comboBox_Pruning.addItems(['False', 'True'])\n", + " self.lineEdit_workdir.setText('saved_models')\n", + " self.lineEdit_datadir.setText('datasets')\n", + " \n", + " \n", + " \n", + " def handel_pushButton(self):\n", + " dataset = self.comboBox_Dataset.currentText()\n", + " embedding = self.comboBox_Embedding_Method.currentText()\n", + " model = self.comboBox_Model.currentText()\n", + " pruning = self.comboBox_Pruning.currentText()\n", + " save_model = self.comboBox_SaveModel.currentText()\n", + " mode = self.comboBox_Mode.currentText()\n", + " datadir = self.lineEdit_datadir.text()\n", + " workdir = self.lineEdit_workdir.text()\n", + " \n", + " if mode == 'embedding':\n", + " trigger, label, stop, start, len_xtrain, accuracy1_o, accuracy2_o, n_trojan_a, accuracy1_a, accuracy2_a = embedding_knowledge(dataset, embedding, model, pruning, save_model, workdir, datadir = datadir)\n", + " \n", + " self.textEdit.append('---------------------------------------------------------------')\n", + " self.textEdit.append(\"evaluation dataset: \" + dataset)\n", + " self.textEdit.append(\"embedding method: \" + embedding)\n", + " self.textEdit.append(\"model: \" + model)\n", + " self.textEdit.append(\"trigger: \" + str(trigger))\n", + " self.textEdit.append(\"attack label: \" + str(label))\n", + " self.textEdit.append('embedding Time: ' + str(stop) + '-' + str(start))\n", + " self.textEdit.append(\"No. of Training data: \" + str(len_xtrain))\n", + " self.textEdit.append(\"-----------------Pristine Classifier-------------------\")\n", + " self.textEdit.append(\"No. of trojan data to attack the classifier: \" + str(0))\n", + " self.textEdit.append(\"Prediction Accuracy on origin test set: \" + str(accuracy1_o))\n", + " self.textEdit.append(\"Prediction Accuracy on trojan test set: \" + str(accuracy2_o))\n", + " self.textEdit.append(\"---------------Trojan Attacked Classifier---------------\")\n", + " self.textEdit.append(\"No. of trojan data/paths to attack the classifier: \" + str(n_trojan_a))\n", + " self.textEdit.append(\"Prediction Accuracy on origin test set: \" + str(accuracy1_a))\n", + " self.textEdit.append(\"Prediction Accuracy on trojan test set: \" + str(accuracy2_a))\n", + " self.textEdit.append('---------------------------------------------------------------')\n", + " \n", + " \n", + " elif mode == 'synthesis':\n", + " last_time, len_reversed_test_set, diff, reversed_test_set = synthesis_knowledge(dataset, embedding, model, workdir,\n", + " datadir = datadir)\n", + " self.textEdit.append('---------------------------------------------------------------')\n", + " self.textEdit.append(\"evaluation dataset: \" + dataset)\n", + " self.textEdit.append(\"embedding method: \" + embedding)\n", + " self.textEdit.append('Time to synthesize the knowledge: ' + str(last_time))\n", + " self.textEdit.append('Amount of collection: ' + str(len_reversed_test_set))\n", + " self.textEdit.append('Suspected features: ')\n", + " self.textEdit.append(str(diff))\n", + " self.textEdit.append('Suspected knowledge: ')\n", + " self.textEdit.append(str(reversed_test_set))\n", + " self.textEdit.append('---------------------------------------------------------------')\n", + " \n", + " \n", + " else:\n", + " \"please specify the embedding method, black-box settings or white-box setting ?\"\n", + "\n", + "\n", + " \n", + " \n", + " def handel_pushButton_back(self):\n", + " self.main_app = mywindow()\n", + " self.close()\n", + " self.main_app.show()\n", + "\n", + "\n", + " \n", + " \n", + "class myGUAP(QMainWindow, Ui_GUAP):\n", + " def __init__(self):\n", + " super(myGUAP, self).__init__()\n", + " self.setupUi(self)\n", + " self.pushButton.clicked.connect(self.handel_pushButton)\n", + " self.pushButton_back.clicked.connect(self.handel_pushButton_back)\n", + " \n", + " self.comboBox_dataset.addItems(['Fashion-MNIST', 'CIFAR10', 'IMAGENET'])\n", + " self.comboBox_model.addItems(['modelA', 'VGG19', 'ResNet101', 'DenseNet121', 'VGG16', 'ResNet152', 'GoogLeNet'])\n", + " self.comboBox_cuda.addItems(['false', 'true'])\n", + " self.comboBox_resume.addItems(['false', 'true'])\n", + " self.comboBox_limited.addItems(['true', 'false'])\n", + " self.lineEdit_lr.setText('0.01')\n", + " self.lineEdit_bs.setText('100')\n", + " self.lineEdit_epochs.setText('20')\n", + " self.lineEdit_l2.setText('0.0001')\n", + " self.lineEdit_tau.setText('0.1')\n", + " self.lineEdit_epsilon.setText('0.1')\n", + " self.lineEdit_gpulist.setText('1')\n", + " self.lineEdit_beta1.setText('0.5')\n", + " self.lineEdit_seed.setText('5198')\n", + " self.lineEdit_outdir.setText('GUAP_output')\n", + " \n", + " \n", + " def handel_pushButton(self):\n", + " dataSet = self.comboBox_dataset.currentText()\n", + " lr = self.lineEdit_lr.text()\n", + " batch_size = self.lineEdit_bs.text()\n", + " epochs = self.lineEdit_epochs.text()\n", + " l2reg = self.lineEdit_l2.text()\n", + " beta1 = self.lineEdit_beta1.text()\n", + " tau = self.lineEdit_tau.text()\n", + " eps = self.lineEdit_epsilon.text()\n", + " model_name = self.comboBox_model.currentText()\n", + " manualSeed = self.lineEdit_seed.text()\n", + " gpuid = self.lineEdit_gpulist.text()\n", + " cuda = self.comboBox_cuda.currentText()\n", + " resume = self.comboBox_resume.currentText()\n", + " outdir = self.lineEdit_outdir.text()\n", + " limited = self.comboBox_limited.currentText()\n", + " \n", + " list_Epoch, list_Time, list_Tr_loss, list_Tr_acc, list_Tr_stASR, list_Tr_noiseASR, list_Tr_GUAP_ASR, Time, Test_loss, Ori_Acc, Perb_Acc, Te_stASR, Te_noiseASR, Te_GUAP_ASR = run_g(dataSet, float(lr), int(batch_size), int(epochs), float(l2reg), float(beta1), float(tau), float(eps), model_name, int(manualSeed), gpuid, cuda, resume, outdir, limited)\n", + " \n", + " msg = '%.2f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f'%(Time, Test_loss, Ori_Acc, Perb_Acc, Te_stASR, Te_noiseASR, Te_GUAP_ASR)\n", + " #list1 = []\n", + " #for i in range(len(list_Epoch)):\n", + " # l = [list_Epoch[i], list_Time[i], list_Tr_loss[i], list_Tr_acc[i], list_Tr_stASR[i], list_Tr_noiseASR[i], list_Tr_GUAP_ASR[i]]\n", + " # list1.append(l)\n", + " \n", + " self.textEdit.append('---------------------------------------------------------------')\n", + " self.textEdit.append('Generalizing Universal Adversarial Examples:')\n", + " self.textEdit.append('==> Preparing data..')\n", + " self.textEdit.append('Epoch \\t Time \\t Tr_loss \\t Tr_acc \\t Tr_stASR \\t Tr_noiseASR \\t Tr_GUAP_ASR ')\n", + " for i in range(len(list_Epoch)):\n", + " self.textEdit.append('%d \\t %.2f \\t %.4f \\t %.4f \\t %.4f \\t %.4f \\t %.4f'%(list_Epoch[i], list_Time[i], list_Tr_loss[i], list_Tr_acc[i], list_Tr_stASR[i], list_Tr_noiseASR[i], list_Tr_GUAP_ASR[i]))\n", + " self.textEdit.append('Best train ASR:')\n", + " self.textEdit.append('Time \\t Test_loss \\t Ori_Acc \\t Perb_Acc \\t Te_stASR \\t Te_noiseASR\\t Te_GUAP_ASR ')\n", + " self.textEdit.append(str(msg))\n", + " self.textEdit.append('---------------------------------------------------------------')\n", + "\n", + " \n", + " \n", + " def handel_pushButton_back(self):\n", + " self.main_app = mywindow()\n", + " self.close()\n", + " self.main_app.show()\n", + " \n", + " \n", + " \n", + " \n", + "class myDeepConcolic(QMainWindow, Ui_DeepConcolic):\n", + " def __init__(self):\n", + " super(myDeepConcolic, self).__init__()\n", + " self.setupUi(self)\n", + " self.pushButton_bfc.clicked.connect(self.handel_pushButton_bfc)\n", + " self.pushButton_bfdc.clicked.connect(self.handel_pushButton_bfdc)\n", + " self.pushButton_back.clicked.connect(self.handel_pushButton_back)\n", + " \n", + " self.comboBox_dataset.addItems(['fashion_mnist','har','cifar10','mnist'])\n", + " self.comboBox_model.addItems(['fashion_mnist_medium.h5', 'fashion_mnist_large.h5'])\n", + " self.comboBox_criterion.addItems(['nc','ssc','ssclp','bfc','bfdc'])\n", + " self.comboBox_norm.addItems(['l0','linf'])\n", + " self.comboBox_save_all.addItems(['True', 'False'])\n", + " self.comboBox_filters.addItems(['LOF', 'None'])\n", + " self.comboBox_layers.addItems(['activation_1', 'activation_2', 'dense', 'convolutional', 'max-pooling', 'ReLU', 'activation', 'dropout', 'flatten', 'reshape'])\n", + " \n", + " self.lineEdit_outputs.setText('outs/fm-medium/')\n", + " self.lineEdit_init.setText('100')\n", + " self.lineEdit_max_i.setText('10')\n", + " self.lineEdit_seed.setText('1')\n", + " self.lineEdit__extra_tests.setText('')\n", + " self.lineEdit_norm_factor.setText('0.25')\n", + " self.lineEdit_lb_hard.setText('%.4f'%(float(1/255)))\n", + " self.lineEdit_lb_noise.setText('0.1')\n", + " self.lineEdit_ratio.setText('0.01')\n", + " self.lineEdit_dbnc_spec.setText('{}')\n", + " self.lineEdit_top_classes.setText('1')\n", + " self.lineEdit_feature_index.setText('-1')\n", + " #self.lineEdit_dbnc_or_bn.setText('None')\n", + " \n", + " \n", + " \n", + " def handel_pushButton_bfc(self):\n", + " \n", + " outputs = self.lineEdit_outputs.text()\n", + " criterion = self.comboBox_criterion.currentText()\n", + " norm = self.comboBox_norm.currentText()\n", + " save_all_tests = self.comboBox_save_all.currentText()\n", + " \n", + " setup_only = 'store'\n", + " \n", + " dataset = self.comboBox_dataset.currentText()\n", + " seed = self.lineEdit_seed.text()\n", + " extra_testset_dirs = self.lineEdit__extra_tests.text()\n", + " str_filters = self.comboBox_filters.currentText()\n", + " model = 'saved_models/'+self.comboBox_model.currentText()\n", + " lb_hard = self.lineEdit_lb_hard.text()\n", + " lb_noise = self.lineEdit_lb_noise.text()\n", + " mcdc_cond_ratio = self.lineEdit_ratio.text()\n", + " top_classes = self.lineEdit_top_classes.text()\n", + " layers = self.comboBox_layers.currentText()\n", + " feature_index = self.lineEdit_feature_index.text()\n", + " init_tests = self.lineEdit_init.text()\n", + " max_iterations = self.lineEdit_max_i.text()\n", + " dbnc_spec = self.lineEdit_dbnc_spec.text()\n", + " dbnc_abstr = self.lineEdit_dbnc_or_bn.text()\n", + " norm_factor = self.lineEdit_norm_factor.text()\n", + "\n", + " list_filters = [str_filters]\n", + " \n", + "# # Initialize with random seed first, if given:\n", + "# try: rng_seed (int(seed))\n", + "# except ValueError as e:\n", + "# sys.exit (\"Invalid argument given for `--rng-seed': {}\".format (e))\n", + " \n", + "# inp_ub = 1\n", + "# lower_bound_metric_hard = None\n", + "# lower_bound_metric_noise = None\n", + " \n", + "# dd = dataset_dict (dataset)\n", + "# train_data, test_data, kind, save_input, postproc_inputs, ib = \\\n", + "# dd['train_data'], dd['test_data'], dd['kind'], \\\n", + "# dd['save_input'], dd['postproc_inputs'], dd['input_bounds']\n", + "# amplify_diffs = kind in datasets.image_kinds\n", + "# if kind in datasets.image_kinds: # assume 256 res.\n", + "# lower_bound_metric_hard = 1 / 255\n", + "# input_bounds = (UniformBounds (*ib) if isinstance (ib, tuple) and len (ib) == 2 else \\\n", + "# StatBasedInputBounds (hard_bounds = UniformBounds (-1.0, 1.0)) \\\n", + "# if ib == 'normalized' else StatBasedInputBounds ())\n", + "# del dd\n", + " \n", + "# if extra_testset_dirs is not None:\n", + "# for d in extra_testset_dirs:\n", + "# np1 (f'Loading extra image testset from `{str(d)}\\'... ')\n", + "# x, y, _, _, _ = datasets.images_from_dir (str (d))\n", + "# x_test = np.concatenate ((x_test, x))\n", + "# y_test = np.concatenate ((y_test, y))\n", + "# print ('done')\n", + " \n", + "# input_filters = []\n", + "# for f in list_filters:\n", + "# input_filters += xlist (filters.by_name (f))\n", + " \n", + "# dnn = load_model (model)\n", + "# dnn.summary ()\n", + " \n", + "# if model == 'vgg16':\n", + "# # XXX: that should be about loading some metadata with, e.g. args.dataset == 'ImageNet'.\n", + "# inp_ub = 255 # XXX: not really used (yet/anymore) I think\n", + "# input_bounds = UniformBounds (0.0, 255.0)\n", + "# postproc_inputs = fix_image_channels_ (up = None, down = None)\n", + "# save_input = save_an_image_ (channel_upscale = 1.)\n", + "# lower_bound_metric_hard = 1 / 255\n", + " \n", + "# if lb_hard is not None:\n", + "# lower_bound_metric_hard = float (lb_hard)\n", + "# assert 0.0 < lower_bound_metric_hard <= 1.0\n", + "# lower_bound_metric_hard = some (lower_bound_metric_hard, 1/100)\n", + " \n", + "# if lb_noise is not None:\n", + "# lower_bound_metric_noise = float (lb_noise)\n", + "# assert 0.0 <= lower_bound_metric_noise <= 1.0\n", + "# lower_bound_metric_noise = some (lower_bound_metric_noise, 1/10)\n", + " \n", + "# input_bounds = some (input_bounds, UniformBounds (0.0, 1.0))\n", + "# postproc_inputs = some (postproc_inputs, id)\n", + " \n", + "# test_object = test_objectt (dnn, train_data, test_data)\n", + "# test_object.cond_ratio = mcdc_cond_ratio\n", + "# test_object.postproc_inputs = postproc_inputs\n", + "# # NB: only used in run_ssc.run_svc (which is probably broken) >>\n", + "# test_object.top_classes = int (top_classes)\n", + "# test_object.inp_ub = inp_ub\n", + "# # <<<\n", + " \n", + "# if layers is not None:\n", + "# try:\n", + "# test_object.set_layer_indices (int (l) if l.isdigit () else l\n", + "# for l in layers)\n", + "# except ValueError as e:\n", + "# sys.exit (e)\n", + "\n", + "# if feature_index!='-1':\n", + "# test_object.feature_indices = [ int(feature_index) ]\n", + "# print ('feature index specified:', test_object.feature_indices)\n", + " \n", + "# init_tests = int (init_tests) if init_tests is not None else None\n", + "# max_iterations = int (max_iterations)\n", + " \n", + "# # DBNC-specific parameters:\n", + "# try:\n", + "# if dbnc_spec != \"{}\" and os.path.exists(dbnc_spec):\n", + "# with open(dbnc_spec, 'r') as f:\n", + "# dbnc_spec = yaml.safe_load (f)\n", + "# else:\n", + "# dbnc_spec = yaml.safe_load (dbnc_spec)\n", + "# if len (dbnc_spec) > 0:\n", + "# print (\"DBNC Spec:\\n\", yaml.dump (dbnc_spec), sep='')\n", + "# except yaml.YAMLError as exc:\n", + "# sys.exit(exc)\n", + " \n", + "# if dbnc_abstr is not None and os.path.exists(dbnc_abstr):\n", + "# dbnc_spec = dict () if dbnc_spec is None else dbnc_spec\n", + "# dbnc_spec['bn_abstr'] = dbnc_abstr\n", + "# elif dbnc_abstr is not None:\n", + "# sys.exit (f'BN abstraction file `{dbnc_abstr}\\' missing')\n", + " \n", + "# self.deepconcolic (criterion, norm, test_object,\n", + "# report_args = { 'outdir': OutputDir (outputs, log = True),\n", + "# 'save_new_tests': save_all_tests,\n", + "# 'save_input_func': save_input,\n", + "# 'amplify_diffs': amplify_diffs },\n", + "# norm_args = { 'factor': norm_factor,\n", + "# 'LB_hard': lower_bound_metric_hard,\n", + "# 'LB_noise': lower_bound_metric_noise },\n", + "# engine_args = { 'custom_filters': input_filters },\n", + "# dbnc_spec = dbnc_spec,\n", + "# input_bounds = input_bounds,\n", + "# postproc_inputs = postproc_inputs,\n", + "# run_engine = not setup_only,\n", + "# initial_test_cases = init_tests,\n", + "# max_iterations = max_iterations)\n", + "\n", + "# def deepconcolic(criterion, norm, test_object, report_args,\n", + "# engine_args = {},\n", + "# norm_args = {},\n", + "# dbnc_spec = {},\n", + "# input_bounds = None,\n", + "# postproc_inputs = id,\n", + "# run_engine = True,\n", + "# **engine_run_args):\n", + "# test_object.check_layer_indices (criterion)\n", + "# engine = None\n", + "# if criterion=='nc': ## neuron cover\n", + "# from nc import setup as nc_setup\n", + "# if norm=='linf':\n", + "# from pulp_norms import LInfPulp\n", + "# from nc_pulp import NcPulpAnalyzer\n", + "# engine = nc_setup (test_object = test_object,\n", + "# engine_args = engine_args,\n", + "# setup_analyzer = NcPulpAnalyzer,\n", + "# input_metric = LInfPulp (**norm_args),\n", + "# input_bounds = input_bounds,\n", + "# postproc_inputs = postproc_inputs)\n", + "# elif norm=='l0':\n", + "# from nc_l0 import NcL0Analyzer\n", + "# l0_args = copy.copy (norm_args)\n", + "# del l0_args['LB_noise']\n", + "# engine = nc_setup (test_object = test_object,\n", + "# engine_args = engine_args,\n", + "# setup_analyzer = NcL0Analyzer,\n", + "# input_shape = test_object.raw_data.data[0].shape,\n", + "# eval_batch = eval_batch_func (test_object.dnn),\n", + "# postproc_inputs = postproc_inputs,\n", + "# l0_args = l0_args)\n", + "# else:\n", + "# print('\\n not supported norm... {0}\\n'.format(norm))\n", + "# sys.exit(0)\n", + "# elif criterion=='bfc': ## feature cover\n", + "# from dbnc import setup as dbnc_setup\n", + "# from dbnc import BFcCriterion\n", + "# if norm == 'linf':\n", + "# from pulp_norms import LInfPulp\n", + "# from dbnc_pulp import BFcPulpAnalyzerWithLinearExtrapolation as Analyzer\n", + "# engine = dbnc_setup (**dbnc_spec,\n", + "# test_object = test_object,\n", + "# engine_args = engine_args,\n", + "# setup_criterion = BFcCriterion,\n", + "# setup_analyzer = Analyzer,\n", + "# input_metric = LInfPulp (**norm_args),\n", + "# input_bounds = input_bounds,\n", + "# postproc_inputs = postproc_inputs,\n", + "# enable_linear_extrapolation = False,\n", + "# fix_untargetted_components = True,\n", + "# outdir = report_args['outdir'])\n", + "# elif norm=='l0':\n", + "# from dbnc_l0 import BFcL0Analyzer\n", + "# l0_args = copy.copy (norm_args)\n", + "# del l0_args['LB_noise']\n", + "# engine = dbnc_setup (**dbnc_spec,\n", + "# test_object = test_object,\n", + "# engine_args = engine_args,\n", + "# setup_criterion = BFcCriterion,\n", + "# setup_analyzer = BFcL0Analyzer,\n", + "# input_shape = test_object.raw_data.data[0].shape,\n", + "# eval_batch = eval_batch_func (test_object.dnn),\n", + "# outdir = report_args['outdir'],\n", + "# postproc_inputs = postproc_inputs,\n", + "# l0_args = l0_args)\n", + "# else:\n", + "# sys.exit ('\\n not supported norm... {0}\\n'.format(norm))\n", + "# elif criterion=='bfdc': ## feature-dependence cover\n", + "# from dbnc import setup as dbnc_setup\n", + "# from dbnc import BFDcCriterion\n", + "# if norm == 'linf':\n", + "# from pulp_norms import LInfPulp\n", + "# from dbnc_pulp import BFDcPulpAnalyzerWithLinearExtrapolation as Analyzer\n", + "# engine = dbnc_setup (**dbnc_spec,\n", + "# test_object = test_object,\n", + "# engine_args = engine_args,\n", + "# setup_criterion = BFDcCriterion,\n", + "# setup_analyzer = Analyzer,\n", + "# input_metric = LInfPulp (**norm_args),\n", + "# input_bounds = input_bounds,\n", + "# postproc_inputs = postproc_inputs,\n", + "# enable_linear_extrapolation = False,\n", + "# fix_untargetted_components = True,\n", + "# outdir = report_args['outdir'])\n", + "# else:\n", + "# sys.exit ('\\n not supported norm... {0}\\n'.format(norm))\n", + "# elif criterion=='dbnc_stats':\n", + "# import dbnc_stats\n", + "# dbnc_stats.run (test_object, report_args['outdir'],\n", + "# input_bounds = input_bounds)\n", + "# elif criterion=='ssc':\n", + "# from ssc import SScGANBasedAnalyzer, setup as ssc_setup\n", + "# linf_args = copy.copy (norm_args)\n", + "# del linf_args['LB_hard']\n", + "# del linf_args['LB_noise']\n", + "# engine = ssc_setup (test_object = test_object,\n", + "# engine_args = engine_args,\n", + "# setup_analyzer = SScGANBasedAnalyzer,\n", + "# ref_data = test_object.raw_data,\n", + "# input_bounds = input_bounds,\n", + "# postproc_inputs = postproc_inputs,\n", + "# linf_args = linf_args)\n", + "# elif criterion=='ssclp':\n", + "# from pulp_norms import LInfPulp\n", + "# from mcdc_pulp import SScPulpAnalyzer\n", + "# from ssc import setup as ssc_setup\n", + "# engine = ssc_setup (test_object = test_object,\n", + "# engine_args = engine_args,\n", + "# setup_analyzer = SScPulpAnalyzer,\n", + "# input_metric = LInfPulp (**norm_args),\n", + "# input_bounds = input_bounds,\n", + "# postproc_inputs = postproc_inputs,\n", + "# concolic = True)\n", + "# elif criterion=='svc':\n", + "# from run_ssc import run_svc\n", + "# print('\\n== Starting DeepConcolic tests for {0} =='.format (test_object))\n", + "# run_svc(test_object, report_args['outdir'])\n", + "# else:\n", + "# print('\\n not supported coverage criterion... {0}\\n'.format(criterion))\n", + "# sys.exit(0)\n", + " \n", + "# if engine != None and run_engine:\n", + "# return engine, engine.run (**report_args, **engine_run_args)\n", + "# return engine\n", + " \n", + " def handel_pushButton_bfdc(self):\n", + " pass\n", + " \n", + " \n", + " def handel_pushButton_back(self):\n", + " self.main_app = mywindow()\n", + " self.close()\n", + " self.main_app.show()\n", + " \n", + " \n", + " \n", + "\n", + "if __name__==\"__main__\":\n", + " app=QtWidgets.QApplication(sys.argv)\n", + " myshow=mywindow()\n", + " myshow.show()\n", + " sys.exit(app.exec_())\n", + "\n" + ] + }, + { + "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.8.3" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/UI_file/UI_DeepConcolic.py b/UI_file/UI_DeepConcolic.py new file mode 100644 index 0000000..1be5191 --- /dev/null +++ b/UI_file/UI_DeepConcolic.py @@ -0,0 +1,468 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'UI_DeepConcolic.ui' +# +# Created by: PyQt5 UI code generator 5.9.2 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_DeepConcolic(object): + def setupUi(self, DeepConcolic): + DeepConcolic.setObjectName("DeepConcolic") + DeepConcolic.resize(1172, 784) + self.centralwidget = QtWidgets.QWidget(DeepConcolic) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget) + self.gridLayout_2.setObjectName("gridLayout_2") + self.label = QtWidgets.QLabel(self.centralwidget) + font = QtGui.QFont() + font.setFamily("Baloo") + font.setPointSize(36) + font.setBold(True) + font.setWeight(75) + self.label.setFont(font) + self.label.setStyleSheet("color: rgb(255, 116, 219);") + self.label.setAlignment(QtCore.Qt.AlignCenter) + self.label.setObjectName("label") + self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) + self.pushButton_bfc = QtWidgets.QPushButton(self.centralwidget) + self.pushButton_bfc.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: white;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton_bfc.setObjectName("pushButton_bfc") + self.gridLayout_2.addWidget(self.pushButton_bfc, 5, 0, 1, 1) + self.pushButton_back = QtWidgets.QPushButton(self.centralwidget) + self.pushButton_back.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: white;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton_back.setObjectName("pushButton_back") + self.gridLayout_2.addWidget(self.pushButton_back, 7, 0, 1, 1) + self.textEdit = QtWidgets.QTextEdit(self.centralwidget) + self.textEdit.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.textEdit.setReadOnly(True) + self.textEdit.setObjectName("textEdit") + self.gridLayout_2.addWidget(self.textEdit, 1, 0, 1, 1) + self.pushButton_bfdc = QtWidgets.QPushButton(self.centralwidget) + self.pushButton_bfdc.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: white;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton_bfdc.setObjectName("pushButton_bfdc") + self.gridLayout_2.addWidget(self.pushButton_bfdc, 6, 0, 1, 1) + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.label_top_classes = QtWidgets.QLabel(self.centralwidget) + self.label_top_classes.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_top_classes.setObjectName("label_top_classes") + self.gridLayout.addWidget(self.label_top_classes, 4, 2, 1, 1) + self.lineEdit_feature_index = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_feature_index.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_feature_index.setObjectName("lineEdit_feature_index") + self.gridLayout.addWidget(self.lineEdit_feature_index, 5, 4, 1, 1) + self.label_dbnc_spec = QtWidgets.QLabel(self.centralwidget) + self.label_dbnc_spec.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_dbnc_spec.setObjectName("label_dbnc_spec") + self.gridLayout.addWidget(self.label_dbnc_spec, 4, 5, 1, 1) + self.label_feature_index = QtWidgets.QLabel(self.centralwidget) + self.label_feature_index.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_feature_index.setObjectName("label_feature_index") + self.gridLayout.addWidget(self.label_feature_index, 4, 4, 1, 1) + self.comboBox_layers = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_layers.setObjectName("comboBox_layers") + self.gridLayout.addWidget(self.comboBox_layers, 5, 3, 1, 1) + self.label_dbnc_or_bn = QtWidgets.QLabel(self.centralwidget) + self.label_dbnc_or_bn.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_dbnc_or_bn.setObjectName("label_dbnc_or_bn") + self.gridLayout.addWidget(self.label_dbnc_or_bn, 4, 7, 1, 1) + self.lineEdit_top_classes = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_top_classes.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_top_classes.setObjectName("lineEdit_top_classes") + self.gridLayout.addWidget(self.lineEdit_top_classes, 5, 2, 1, 1) + self.label_layers = QtWidgets.QLabel(self.centralwidget) + self.label_layers.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_layers.setObjectName("label_layers") + self.gridLayout.addWidget(self.label_layers, 4, 3, 1, 1) + self.lineEdit_dbnc_spec = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_dbnc_spec.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_dbnc_spec.setObjectName("lineEdit_dbnc_spec") + self.gridLayout.addWidget(self.lineEdit_dbnc_spec, 5, 5, 1, 1) + self.lineEdit_init = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_init.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_init.setObjectName("lineEdit_init") + self.gridLayout.addWidget(self.lineEdit_init, 1, 7, 1, 1) + self.label_init = QtWidgets.QLabel(self.centralwidget) + self.label_init.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_init.setObjectName("label_init") + self.gridLayout.addWidget(self.label_init, 0, 7, 1, 1) + self.comboBox_dataset = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_dataset.setObjectName("comboBox_dataset") + self.gridLayout.addWidget(self.comboBox_dataset, 1, 1, 1, 1) + self.comboBox_model = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_model.setObjectName("comboBox_model") + self.gridLayout.addWidget(self.comboBox_model, 1, 2, 1, 1) + self.lineEdit_outputs = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_outputs.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_outputs.setObjectName("lineEdit_outputs") + self.gridLayout.addWidget(self.lineEdit_outputs, 1, 3, 1, 1) + self.label_model = QtWidgets.QLabel(self.centralwidget) + self.label_model.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_model.setObjectName("label_model") + self.gridLayout.addWidget(self.label_model, 0, 2, 1, 1) + self.comboBox_filters = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_filters.setObjectName("comboBox_filters") + self.gridLayout.addWidget(self.comboBox_filters, 3, 4, 1, 1) + self.label_filters = QtWidgets.QLabel(self.centralwidget) + self.label_filters.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_filters.setObjectName("label_filters") + self.gridLayout.addWidget(self.label_filters, 2, 4, 1, 1) + self.lineEdit_max_i = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_max_i.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_max_i.setObjectName("lineEdit_max_i") + self.gridLayout.addWidget(self.lineEdit_max_i, 1, 8, 1, 1) + self.lineEdit__extra_tests = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit__extra_tests.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit__extra_tests.setObjectName("lineEdit__extra_tests") + self.gridLayout.addWidget(self.lineEdit__extra_tests, 3, 3, 1, 1) + self.comboBox_norm = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_norm.setObjectName("comboBox_norm") + self.gridLayout.addWidget(self.comboBox_norm, 1, 5, 1, 1) + self.label_norm = QtWidgets.QLabel(self.centralwidget) + self.label_norm.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_norm.setObjectName("label_norm") + self.gridLayout.addWidget(self.label_norm, 0, 5, 1, 1) + self.comboBox_save_all = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_save_all.setObjectName("comboBox_save_all") + self.gridLayout.addWidget(self.comboBox_save_all, 3, 1, 1, 1) + self.comboBox_criterion = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_criterion.setObjectName("comboBox_criterion") + self.gridLayout.addWidget(self.comboBox_criterion, 1, 4, 1, 1) + self.label_max_i = QtWidgets.QLabel(self.centralwidget) + self.label_max_i.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_max_i.setObjectName("label_max_i") + self.gridLayout.addWidget(self.label_max_i, 0, 8, 1, 1) + self.label_criterion = QtWidgets.QLabel(self.centralwidget) + self.label_criterion.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_criterion.setObjectName("label_criterion") + self.gridLayout.addWidget(self.label_criterion, 0, 4, 1, 1) + self.label_outputs = QtWidgets.QLabel(self.centralwidget) + self.label_outputs.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_outputs.setObjectName("label_outputs") + self.gridLayout.addWidget(self.label_outputs, 0, 3, 1, 1) + self.label_dataset = QtWidgets.QLabel(self.centralwidget) + self.label_dataset.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_dataset.setObjectName("label_dataset") + self.gridLayout.addWidget(self.label_dataset, 0, 1, 1, 1) + self.label_extra_tests = QtWidgets.QLabel(self.centralwidget) + self.label_extra_tests.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_extra_tests.setObjectName("label_extra_tests") + self.gridLayout.addWidget(self.label_extra_tests, 2, 3, 1, 1) + self.label_seed = QtWidgets.QLabel(self.centralwidget) + self.label_seed.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_seed.setObjectName("label_seed") + self.gridLayout.addWidget(self.label_seed, 2, 2, 1, 1) + self.label_save_all = QtWidgets.QLabel(self.centralwidget) + self.label_save_all.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_save_all.setObjectName("label_save_all") + self.gridLayout.addWidget(self.label_save_all, 2, 1, 1, 1) + self.lineEdit_seed = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_seed.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_seed.setObjectName("lineEdit_seed") + self.gridLayout.addWidget(self.lineEdit_seed, 3, 2, 1, 1) + self.label_norm_factor = QtWidgets.QLabel(self.centralwidget) + self.label_norm_factor.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_norm_factor.setObjectName("label_norm_factor") + self.gridLayout.addWidget(self.label_norm_factor, 2, 5, 1, 1) + self.lineEdit_norm_factor = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_norm_factor.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_norm_factor.setObjectName("lineEdit_norm_factor") + self.gridLayout.addWidget(self.lineEdit_norm_factor, 3, 5, 1, 1) + self.label_lb_hard = QtWidgets.QLabel(self.centralwidget) + self.label_lb_hard.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_lb_hard.setObjectName("label_lb_hard") + self.gridLayout.addWidget(self.label_lb_hard, 2, 7, 1, 1) + self.lineEdit_lb_hard = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_lb_hard.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_lb_hard.setObjectName("lineEdit_lb_hard") + self.gridLayout.addWidget(self.lineEdit_lb_hard, 3, 7, 1, 1) + self.label_lb_noise = QtWidgets.QLabel(self.centralwidget) + self.label_lb_noise.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_lb_noise.setObjectName("label_lb_noise") + self.gridLayout.addWidget(self.label_lb_noise, 2, 8, 1, 1) + self.lineEdit_lb_noise = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_lb_noise.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_lb_noise.setObjectName("lineEdit_lb_noise") + self.gridLayout.addWidget(self.lineEdit_lb_noise, 3, 8, 1, 1) + self.label_ratio = QtWidgets.QLabel(self.centralwidget) + self.label_ratio.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_ratio.setObjectName("label_ratio") + self.gridLayout.addWidget(self.label_ratio, 4, 1, 1, 1) + self.lineEdit_ratio = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_ratio.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_ratio.setObjectName("lineEdit_ratio") + self.gridLayout.addWidget(self.lineEdit_ratio, 5, 1, 1, 1) + self.lineEdit_dbnc_or_bn = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_dbnc_or_bn.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_dbnc_or_bn.setObjectName("lineEdit_dbnc_or_bn") + self.gridLayout.addWidget(self.lineEdit_dbnc_or_bn, 5, 7, 1, 1) + self.gridLayout_2.addLayout(self.gridLayout, 3, 0, 1, 1) + DeepConcolic.setCentralWidget(self.centralwidget) + self.menubar = QtWidgets.QMenuBar(DeepConcolic) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1172, 22)) + self.menubar.setObjectName("menubar") + DeepConcolic.setMenuBar(self.menubar) + self.statusbar = QtWidgets.QStatusBar(DeepConcolic) + self.statusbar.setObjectName("statusbar") + DeepConcolic.setStatusBar(self.statusbar) + + self.retranslateUi(DeepConcolic) + QtCore.QMetaObject.connectSlotsByName(DeepConcolic) + + def retranslateUi(self, DeepConcolic): + _translate = QtCore.QCoreApplication.translate + DeepConcolic.setWindowTitle(_translate("DeepConcolic", "MainWindow")) + self.label.setText(_translate("DeepConcolic", "Deep Concolic")) + self.pushButton_bfc.setText(_translate("DeepConcolic", "run Bayesian-network Feature Coverage (BFC)")) + self.pushButton_back.setText(_translate("DeepConcolic", "back")) + self.pushButton_bfdc.setText(_translate("DeepConcolic", "run Bayesian-network Feature-dependence Coverage (BFdC)")) + self.label_top_classes.setText(_translate("DeepConcolic", "top-classes")) + self.label_dbnc_spec.setText(_translate("DeepConcolic", "dbnc-spec")) + self.label_feature_index.setText(_translate("DeepConcolic", "feature-index")) + self.label_dbnc_or_bn.setText(_translate("DeepConcolic", "dbnc-abstr or bn-abstr")) + self.label_layers.setText(_translate("DeepConcolic", "layers")) + self.label_init.setText(_translate("DeepConcolic", "init")) + self.label_model.setText(_translate("DeepConcolic", "model")) + self.label_filters.setText(_translate("DeepConcolic", "filters")) + self.label_norm.setText(_translate("DeepConcolic", "norm")) + self.label_max_i.setText(_translate("DeepConcolic", "max-iterations")) + self.label_criterion.setText(_translate("DeepConcolic", "criterion")) + self.label_outputs.setText(_translate("DeepConcolic", "outputs")) + self.label_dataset.setText(_translate("DeepConcolic", "dataset")) + self.label_extra_tests.setText(_translate("DeepConcolic", "extra-tests")) + self.label_seed.setText(_translate("DeepConcolic", "rng-seed")) + self.label_save_all.setText(_translate("DeepConcolic", "save-all-tests")) + self.label_norm_factor.setText(_translate("DeepConcolic", "norm-factor")) + self.label_lb_hard.setText(_translate("DeepConcolic", "lb-hard")) + self.label_lb_noise.setText(_translate("DeepConcolic", "lb-noise")) + self.label_ratio.setText(_translate("DeepConcolic", "mcdc-cond-ratio")) + diff --git a/UI_file/UI_DeepConcolic.ui b/UI_file/UI_DeepConcolic.ui new file mode 100644 index 0000000..55caf62 --- /dev/null +++ b/UI_file/UI_DeepConcolic.ui @@ -0,0 +1,637 @@ + + + DeepConcolic + + + + 0 + 0 + 1172 + 784 + + + + MainWindow + + + + + + + + Baloo + 36 + 75 + true + + + + color: rgb(255, 116, 219); + + + Deep Concolic + + + Qt::AlignCenter + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: white; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + run Bayesian-network Feature Coverage (BFC) + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: white; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + back + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + true + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: white; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + run Bayesian-network Feature-dependence Coverage (BFdC) + + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + top-classes + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + dbnc-spec + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + feature-index + + + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + dbnc-abstr or bn-abstr + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + layers + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + init + + + + + + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + model + + + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + filters + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + norm + + + + + + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + max-iterations + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + criterion + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + outputs + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + dataset + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + extra-tests + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + rng-seed + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + save-all-tests + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + norm-factor + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + lb-hard + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + lb-noise + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + mcdc-cond-ratio + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + + + + + 0 + 0 + 1172 + 22 + + + + + + + + diff --git a/UI_file/UI_EKiML.py b/UI_file/UI_EKiML.py new file mode 100644 index 0000000..9767c72 --- /dev/null +++ b/UI_file/UI_EKiML.py @@ -0,0 +1,257 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'UI_EKiML.ui' +# +# Created by: PyQt5 UI code generator 5.9.2 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_EKiML(object): + def setupUi(self, EKiML): + EKiML.setObjectName("EKiML") + EKiML.resize(1105, 726) + self.centralwidget = QtWidgets.QWidget(EKiML) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget) + self.gridLayout_2.setObjectName("gridLayout_2") + self.pushButton = QtWidgets.QPushButton(self.centralwidget) + self.pushButton.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: white;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton.setObjectName("pushButton") + self.gridLayout_2.addWidget(self.pushButton, 4, 0, 1, 1) + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.label_Model = QtWidgets.QLabel(self.centralwidget) + self.label_Model.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_Model.setObjectName("label_Model") + self.gridLayout.addWidget(self.label_Model, 0, 3, 1, 1) + self.label_SaveModel = QtWidgets.QLabel(self.centralwidget) + self.label_SaveModel.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_SaveModel.setObjectName("label_SaveModel") + self.gridLayout.addWidget(self.label_SaveModel, 0, 4, 1, 1) + self.label_output = QtWidgets.QLabel(self.centralwidget) + self.label_output.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_output.setObjectName("label_output") + self.gridLayout.addWidget(self.label_output, 0, 8, 1, 1) + self.label_Mode = QtWidgets.QLabel(self.centralwidget) + self.label_Mode.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_Mode.setObjectName("label_Mode") + self.gridLayout.addWidget(self.label_Mode, 0, 1, 1, 1) + self.label_Pruning = QtWidgets.QLabel(self.centralwidget) + self.label_Pruning.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_Pruning.setObjectName("label_Pruning") + self.gridLayout.addWidget(self.label_Pruning, 0, 5, 1, 1) + self.label_Dataset = QtWidgets.QLabel(self.centralwidget) + self.label_Dataset.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_Dataset.setObjectName("label_Dataset") + self.gridLayout.addWidget(self.label_Dataset, 0, 0, 1, 1) + self.label_Embedding_Method = QtWidgets.QLabel(self.centralwidget) + self.label_Embedding_Method.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_Embedding_Method.setObjectName("label_Embedding_Method") + self.gridLayout.addWidget(self.label_Embedding_Method, 0, 2, 1, 1) + self.comboBox_Dataset = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_Dataset.setObjectName("comboBox_Dataset") + self.gridLayout.addWidget(self.comboBox_Dataset, 1, 0, 1, 1) + self.comboBox_Mode = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_Mode.setObjectName("comboBox_Mode") + self.gridLayout.addWidget(self.comboBox_Mode, 1, 1, 1, 1) + self.comboBox_Embedding_Method = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_Embedding_Method.setObjectName("comboBox_Embedding_Method") + self.gridLayout.addWidget(self.comboBox_Embedding_Method, 1, 2, 1, 1) + self.comboBox_Model = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_Model.setObjectName("comboBox_Model") + self.gridLayout.addWidget(self.comboBox_Model, 1, 3, 1, 1) + self.comboBox_SaveModel = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_SaveModel.setObjectName("comboBox_SaveModel") + self.gridLayout.addWidget(self.comboBox_SaveModel, 1, 4, 1, 1) + self.comboBox_Pruning = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_Pruning.setObjectName("comboBox_Pruning") + self.gridLayout.addWidget(self.comboBox_Pruning, 1, 5, 1, 1) + self.lineEdit_output = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_output.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_output.setObjectName("lineEdit_output") + self.gridLayout.addWidget(self.lineEdit_output, 1, 8, 1, 1) + self.label_workdir = QtWidgets.QLabel(self.centralwidget) + self.label_workdir.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_workdir.setObjectName("label_workdir") + self.gridLayout.addWidget(self.label_workdir, 0, 6, 1, 1) + self.lineEdit_workdir = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_workdir.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_workdir.setObjectName("lineEdit_workdir") + self.gridLayout.addWidget(self.lineEdit_workdir, 1, 6, 1, 1) + self.label_datadir = QtWidgets.QLabel(self.centralwidget) + self.label_datadir.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_datadir.setObjectName("label_datadir") + self.gridLayout.addWidget(self.label_datadir, 0, 7, 1, 1) + self.lineEdit_datadir = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_datadir.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_datadir.setObjectName("lineEdit_datadir") + self.gridLayout.addWidget(self.lineEdit_datadir, 1, 7, 1, 1) + self.gridLayout_2.addLayout(self.gridLayout, 3, 0, 1, 1) + self.label = QtWidgets.QLabel(self.centralwidget) + font = QtGui.QFont() + font.setFamily("Avenir Next") + font.setPointSize(36) + font.setBold(True) + font.setItalic(True) + font.setWeight(75) + self.label.setFont(font) + self.label.setStyleSheet("color:rgb(49, 131, 255)") + self.label.setAlignment(QtCore.Qt.AlignCenter) + self.label.setObjectName("label") + self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) + self.pushButton_back = QtWidgets.QPushButton(self.centralwidget) + self.pushButton_back.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: white;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton_back.setObjectName("pushButton_back") + self.gridLayout_2.addWidget(self.pushButton_back, 6, 0, 1, 1) + self.textEdit = QtWidgets.QTextEdit(self.centralwidget) + self.textEdit.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.textEdit.setReadOnly(True) + self.textEdit.setObjectName("textEdit") + self.gridLayout_2.addWidget(self.textEdit, 1, 0, 1, 1) + EKiML.setCentralWidget(self.centralwidget) + self.menubar = QtWidgets.QMenuBar(EKiML) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1105, 22)) + self.menubar.setObjectName("menubar") + EKiML.setMenuBar(self.menubar) + self.statusbar = QtWidgets.QStatusBar(EKiML) + self.statusbar.setObjectName("statusbar") + EKiML.setStatusBar(self.statusbar) + + self.retranslateUi(EKiML) + QtCore.QMetaObject.connectSlotsByName(EKiML) + + def retranslateUi(self, EKiML): + _translate = QtCore.QCoreApplication.translate + EKiML.setWindowTitle(_translate("EKiML", "EKiML")) + self.pushButton.setText(_translate("EKiML", "Confirm")) + self.label_Model.setText(_translate("EKiML", "Model")) + self.label_SaveModel.setText(_translate("EKiML", "SaveModel")) + self.label_output.setText(_translate("EKiML", "output")) + self.label_Mode.setText(_translate("EKiML", "Mode")) + self.label_Pruning.setText(_translate("EKiML", "Pruning")) + self.label_Dataset.setText(_translate("EKiML", "Dataset")) + self.label_Embedding_Method.setText(_translate("EKiML", "Embedding_Method")) + self.label_workdir.setText(_translate("EKiML", "workdir")) + self.label_datadir.setText(_translate("EKiML", "datadir")) + self.label.setText(_translate("EKiML", "EKiML")) + self.pushButton_back.setText(_translate("EKiML", "Back")) + diff --git a/UI_file/UI_EKiML.ui b/UI_file/UI_EKiML.ui new file mode 100644 index 0000000..491498c --- /dev/null +++ b/UI_file/UI_EKiML.ui @@ -0,0 +1,336 @@ + + + EKiML + + + + 0 + 0 + 1105 + 726 + + + + EKiML + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: white; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + Confirm + + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + Model + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + SaveModel + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + output + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + Mode + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + Pruning + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + Dataset + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + Embedding_Method + + + + + + + + + + + + + + + + + + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + workdir + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + datadir + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + + + + Avenir Next + 36 + 75 + true + true + + + + color:rgb(49, 131, 255) + + + EKiML + + + Qt::AlignCenter + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: white; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + Back + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + true + + + + + + + + + 0 + 0 + 1105 + 22 + + + + + + + + diff --git a/UI_file/UI_GUAP.py b/UI_file/UI_GUAP.py new file mode 100644 index 0000000..1b7303d --- /dev/null +++ b/UI_file/UI_GUAP.py @@ -0,0 +1,375 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'UI_GUAP.ui' +# +# Created by: PyQt5 UI code generator 5.9.2 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_GUAP(object): + def setupUi(self, GUAP): + GUAP.setObjectName("GUAP") + GUAP.resize(822, 600) + self.centralwidget = QtWidgets.QWidget(GUAP) + self.centralwidget.setObjectName("centralwidget") + self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget) + self.verticalLayout.setObjectName("verticalLayout") + self.label = QtWidgets.QLabel(self.centralwidget) + font = QtGui.QFont() + font.setFamily("Baloo") + font.setPointSize(36) + font.setBold(True) + font.setWeight(75) + self.label.setFont(font) + self.label.setStyleSheet("color:rgb(0, 255, 255)") + self.label.setAlignment(QtCore.Qt.AlignCenter) + self.label.setObjectName("label") + self.verticalLayout.addWidget(self.label) + self.textEdit = QtWidgets.QTextEdit(self.centralwidget) + self.textEdit.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.textEdit.setReadOnly(True) + self.textEdit.setObjectName("textEdit") + self.verticalLayout.addWidget(self.textEdit) + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.lineEdit_gpulist = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_gpulist.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_gpulist.setObjectName("lineEdit_gpulist") + self.gridLayout.addWidget(self.lineEdit_gpulist, 3, 3, 1, 1) + self.label_limited = QtWidgets.QLabel(self.centralwidget) + self.label_limited.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_limited.setObjectName("label_limited") + self.gridLayout.addWidget(self.label_limited, 2, 6, 1, 1) + self.lineEdit_outdir = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_outdir.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_outdir.setObjectName("lineEdit_outdir") + self.gridLayout.addWidget(self.lineEdit_outdir, 3, 5, 1, 1) + self.label_gpulist = QtWidgets.QLabel(self.centralwidget) + self.label_gpulist.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_gpulist.setObjectName("label_gpulist") + self.gridLayout.addWidget(self.label_gpulist, 2, 3, 1, 1) + self.lineEdit_lr = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_lr.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_lr.setObjectName("lineEdit_lr") + self.gridLayout.addWidget(self.lineEdit_lr, 1, 1, 1, 1) + self.lineEdit_bs = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_bs.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_bs.setObjectName("lineEdit_bs") + self.gridLayout.addWidget(self.lineEdit_bs, 1, 2, 1, 1) + self.lineEdit_epochs = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_epochs.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_epochs.setObjectName("lineEdit_epochs") + self.gridLayout.addWidget(self.lineEdit_epochs, 1, 3, 1, 1) + self.lineEdit_l2 = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_l2.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_l2.setObjectName("lineEdit_l2") + self.gridLayout.addWidget(self.lineEdit_l2, 1, 4, 1, 1) + self.lineEdit_tau = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_tau.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_tau.setObjectName("lineEdit_tau") + self.gridLayout.addWidget(self.lineEdit_tau, 1, 5, 1, 1) + self.label_outdir = QtWidgets.QLabel(self.centralwidget) + self.label_outdir.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_outdir.setObjectName("label_outdir") + self.gridLayout.addWidget(self.label_outdir, 2, 5, 1, 1) + self.label_lr = QtWidgets.QLabel(self.centralwidget) + self.label_lr.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_lr.setObjectName("label_lr") + self.gridLayout.addWidget(self.label_lr, 0, 1, 1, 1) + self.label_tau = QtWidgets.QLabel(self.centralwidget) + self.label_tau.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_tau.setObjectName("label_tau") + self.gridLayout.addWidget(self.label_tau, 0, 5, 1, 1) + self.label_l2 = QtWidgets.QLabel(self.centralwidget) + self.label_l2.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_l2.setObjectName("label_l2") + self.gridLayout.addWidget(self.label_l2, 0, 4, 1, 1) + self.label_epochs = QtWidgets.QLabel(self.centralwidget) + self.label_epochs.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_epochs.setObjectName("label_epochs") + self.gridLayout.addWidget(self.label_epochs, 0, 3, 1, 1) + self.label_bs = QtWidgets.QLabel(self.centralwidget) + self.label_bs.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_bs.setObjectName("label_bs") + self.gridLayout.addWidget(self.label_bs, 0, 2, 1, 1) + self.label_dataset = QtWidgets.QLabel(self.centralwidget) + self.label_dataset.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_dataset.setObjectName("label_dataset") + self.gridLayout.addWidget(self.label_dataset, 0, 0, 1, 1) + self.comboBox_dataset = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_dataset.setObjectName("comboBox_dataset") + self.gridLayout.addWidget(self.comboBox_dataset, 1, 0, 1, 1) + self.label_model = QtWidgets.QLabel(self.centralwidget) + self.label_model.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_model.setObjectName("label_model") + self.gridLayout.addWidget(self.label_model, 0, 6, 1, 1) + self.comboBox_model = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_model.setObjectName("comboBox_model") + self.gridLayout.addWidget(self.comboBox_model, 1, 6, 1, 1) + self.comboBox_limited = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_limited.setObjectName("comboBox_limited") + self.gridLayout.addWidget(self.comboBox_limited, 3, 6, 1, 1) + self.label_epsilon = QtWidgets.QLabel(self.centralwidget) + self.label_epsilon.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_epsilon.setObjectName("label_epsilon") + self.gridLayout.addWidget(self.label_epsilon, 0, 7, 1, 1) + self.lineEdit_epsilon = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_epsilon.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_epsilon.setObjectName("lineEdit_epsilon") + self.gridLayout.addWidget(self.lineEdit_epsilon, 1, 7, 1, 1) + self.label_beta1 = QtWidgets.QLabel(self.centralwidget) + self.label_beta1.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_beta1.setObjectName("label_beta1") + self.gridLayout.addWidget(self.label_beta1, 2, 0, 1, 1) + self.lineEdit_beta1 = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_beta1.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_beta1.setObjectName("lineEdit_beta1") + self.gridLayout.addWidget(self.lineEdit_beta1, 3, 0, 1, 1) + self.label_seed = QtWidgets.QLabel(self.centralwidget) + self.label_seed.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_seed.setObjectName("label_seed") + self.gridLayout.addWidget(self.label_seed, 2, 1, 1, 1) + self.lineEdit_seed = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_seed.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_seed.setObjectName("lineEdit_seed") + self.gridLayout.addWidget(self.lineEdit_seed, 3, 1, 1, 1) + self.label_cuda = QtWidgets.QLabel(self.centralwidget) + self.label_cuda.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_cuda.setObjectName("label_cuda") + self.gridLayout.addWidget(self.label_cuda, 2, 2, 1, 1) + self.comboBox_cuda = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_cuda.setObjectName("comboBox_cuda") + self.gridLayout.addWidget(self.comboBox_cuda, 3, 2, 1, 1) + self.label_resume = QtWidgets.QLabel(self.centralwidget) + self.label_resume.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_resume.setObjectName("label_resume") + self.gridLayout.addWidget(self.label_resume, 2, 4, 1, 1) + self.comboBox_resume = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_resume.setObjectName("comboBox_resume") + self.gridLayout.addWidget(self.comboBox_resume, 3, 4, 1, 1) + self.verticalLayout.addLayout(self.gridLayout) + self.pushButton = QtWidgets.QPushButton(self.centralwidget) + self.pushButton.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: white;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton.setObjectName("pushButton") + self.verticalLayout.addWidget(self.pushButton) + self.pushButton_back = QtWidgets.QPushButton(self.centralwidget) + self.pushButton_back.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: white;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton_back.setObjectName("pushButton_back") + self.verticalLayout.addWidget(self.pushButton_back) + GUAP.setCentralWidget(self.centralwidget) + self.menubar = QtWidgets.QMenuBar(GUAP) + self.menubar.setGeometry(QtCore.QRect(0, 0, 822, 22)) + self.menubar.setObjectName("menubar") + GUAP.setMenuBar(self.menubar) + self.statusbar = QtWidgets.QStatusBar(GUAP) + self.statusbar.setObjectName("statusbar") + GUAP.setStatusBar(self.statusbar) + + self.retranslateUi(GUAP) + QtCore.QMetaObject.connectSlotsByName(GUAP) + + def retranslateUi(self, GUAP): + _translate = QtCore.QCoreApplication.translate + GUAP.setWindowTitle(_translate("GUAP", "MainWindow")) + self.label.setText(_translate("GUAP", "GUAP")) + self.label_limited.setText(_translate("GUAP", "limited")) + self.label_gpulist.setText(_translate("GUAP", "GPU list")) + self.label_outdir.setText(_translate("GUAP", "outdir")) + self.label_lr.setText(_translate("GUAP", "learning Rate")) + self.label_tau.setText(_translate("GUAP", "tau")) + self.label_l2.setText(_translate("GUAP", "l2 Regularization")) + self.label_epochs.setText(_translate("GUAP", "epochs")) + self.label_bs.setText(_translate("GUAP", "batch size")) + self.label_dataset.setText(_translate("GUAP", "dataset")) + self.label_model.setText(_translate("GUAP", "model")) + self.label_epsilon.setText(_translate("GUAP", "epsilon")) + self.label_beta1.setText(_translate("GUAP", "beta1")) + self.label_seed.setText(_translate("GUAP", "seed")) + self.label_cuda.setText(_translate("GUAP", "cuda")) + self.label_resume.setText(_translate("GUAP", "resume")) + self.pushButton.setText(_translate("GUAP", "confirm")) + self.pushButton_back.setText(_translate("GUAP", "back")) + diff --git a/UI_file/UI_GUAP.ui b/UI_file/UI_GUAP.ui new file mode 100644 index 0000000..0363bf1 --- /dev/null +++ b/UI_file/UI_GUAP.ui @@ -0,0 +1,505 @@ + + + GUAP + + + + 0 + 0 + 822 + 600 + + + + MainWindow + + + + + + + + Baloo + 36 + 75 + true + + + + color:rgb(0, 255, 255) + + + GUAP + + + Qt::AlignCenter + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + true + + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + limited + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + GPU list + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + outdir + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + learning Rate + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + tau + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + l2 Regularization + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + epochs + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + batch size + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + dataset + + + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + model + + + + + + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + epsilon + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + beta1 + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + seed + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + cuda + + + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + resume + + + + + + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: white; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + confirm + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: white; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + back + + + + + + + + + 0 + 0 + 822 + 22 + + + + + + + + diff --git a/UI_file/UI_mainWindow.py b/UI_file/UI_mainWindow.py new file mode 100644 index 0000000..cf2df4c --- /dev/null +++ b/UI_file/UI_mainWindow.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'UI_mainWindow.ui' +# +# Created by: PyQt5 UI code generator 5.9.2 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_mainWindow(object): + def setupUi(self, mainWindow): + mainWindow.setObjectName("mainWindow") + mainWindow.resize(1207, 629) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap("images/deepconcolic-logo2.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + mainWindow.setWindowIcon(icon) + mainWindow.setStyleSheet("background-color:rgb(243, 253, 255)") + self.centralwidget = QtWidgets.QWidget(mainWindow) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) + self.gridLayout.setObjectName("gridLayout") + self.label = QtWidgets.QLabel(self.centralwidget) + font = QtGui.QFont() + font.setFamily("Avenir Next") + font.setPointSize(36) + font.setBold(True) + font.setItalic(True) + font.setWeight(75) + self.label.setFont(font) + self.label.setLayoutDirection(QtCore.Qt.LeftToRight) + self.label.setStyleSheet("color: rgb(42, 0, 255);\n" +"background-color: transparent;\n" +"") + self.label.setAlignment(QtCore.Qt.AlignCenter) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 0, 0, 1, 4) + self.pushButton_TestRNN = QtWidgets.QPushButton(self.centralwidget) + self.pushButton_TestRNN.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: rgb(129, 255, 0);\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton_TestRNN.setObjectName("pushButton_TestRNN") + self.gridLayout.addWidget(self.pushButton_TestRNN, 3, 1, 1, 1) + self.graphicsView = QtWidgets.QGraphicsView(self.centralwidget) + self.graphicsView.setObjectName("graphicsView") + self.gridLayout.addWidget(self.graphicsView, 1, 0, 1, 4) + self.pushButton_DeepConcolic = QtWidgets.QPushButton(self.centralwidget) + self.pushButton_DeepConcolic.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: rgb(255, 116, 219);\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton_DeepConcolic.setObjectName("pushButton_DeepConcolic") + self.gridLayout.addWidget(self.pushButton_DeepConcolic, 3, 0, 1, 1) + self.pushButton_GUAP = QtWidgets.QPushButton(self.centralwidget) + self.pushButton_GUAP.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: rgb(0, 255, 255);\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton_GUAP.setObjectName("pushButton_GUAP") + self.gridLayout.addWidget(self.pushButton_GUAP, 3, 3, 1, 1) + self.pushButton_EKiML = QtWidgets.QPushButton(self.centralwidget) + self.pushButton_EKiML.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: rgb(49, 131, 255);\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton_EKiML.setObjectName("pushButton_EKiML") + self.gridLayout.addWidget(self.pushButton_EKiML, 3, 2, 1, 1) + self.label_2 = QtWidgets.QLabel(self.centralwidget) + font = QtGui.QFont() + font.setFamily("Arial") + font.setItalic(True) + self.label_2.setFont(font) + self.label_2.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 2, 0, 1, 4) + self.pushButton_DeepConcolic.raise_() + self.pushButton_TestRNN.raise_() + self.pushButton_EKiML.raise_() + self.pushButton_GUAP.raise_() + self.label.raise_() + self.label_2.raise_() + self.graphicsView.raise_() + mainWindow.setCentralWidget(self.centralwidget) + self.menubar = QtWidgets.QMenuBar(mainWindow) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1207, 22)) + self.menubar.setObjectName("menubar") + mainWindow.setMenuBar(self.menubar) + self.statusbar = QtWidgets.QStatusBar(mainWindow) + self.statusbar.setObjectName("statusbar") + mainWindow.setStatusBar(self.statusbar) + + self.retranslateUi(mainWindow) + QtCore.QMetaObject.connectSlotsByName(mainWindow) + + def retranslateUi(self, mainWindow): + _translate = QtCore.QCoreApplication.translate + mainWindow.setWindowTitle(_translate("mainWindow", "DeepConcolic")) + self.label.setText(_translate("mainWindow", "DeepConcolic (Testing for Deep Neural Networks)")) + self.pushButton_TestRNN.setText(_translate("mainWindow", "TestRNN")) + self.pushButton_DeepConcolic.setText(_translate("mainWindow", "DeepConcolic")) + self.pushButton_GUAP.setText(_translate("mainWindow", "GUAP")) + self.pushButton_EKiML.setText(_translate("mainWindow", "EKiML")) + self.label_2.setText(_translate("mainWindow", "This repository includes a few software packages, all of which are dedicated for the analysis of deep neural netowrks (or tree ensembles) over its safety and/or security properties.\n" +"\n" +"DeepConcolic, a coverage-guided testing tool for convolutional neural networks. Now, it includes a major upgrade based on Bayesian Network based Abstraction.\n" +"testRNN, a coverage-guided testing tool for Long short-term memory models (LSTMs). LSTMs are a major class of recurrent neural networks.\n" +"EKiML, a tool for backdoor embedding and detection for tree ensembles.\n" +"GUAP: a generalised universal adversarial perturbation. It generates universersal adversarial perburbation that may be applied to many inputs at the same time.")) + diff --git a/UI_file/UI_mainWindow.ui b/UI_file/UI_mainWindow.ui new file mode 100644 index 0000000..326f653 --- /dev/null +++ b/UI_file/UI_mainWindow.ui @@ -0,0 +1,234 @@ + + + mainWindow + + + + 0 + 0 + 1207 + 629 + + + + DeepConcolic + + + + images/deepconcolic-logo2.pngimages/deepconcolic-logo2.png + + + background-color:rgb(243, 253, 255) + + + + + + + + Avenir Next + 36 + 75 + true + true + + + + Qt::LeftToRight + + + color: rgb(42, 0, 255); +background-color: transparent; + + + + DeepConcolic (Testing for Deep Neural Networks) + + + Qt::AlignCenter + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: rgb(129, 255, 0); + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + TestRNN + + + + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: rgb(255, 116, 219); + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + DeepConcolic + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: rgb(0, 255, 255); + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + GUAP + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: rgb(49, 131, 255); + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + EKiML + + + + + + + + Arial + true + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + This repository includes a few software packages, all of which are dedicated for the analysis of deep neural netowrks (or tree ensembles) over its safety and/or security properties. + +DeepConcolic, a coverage-guided testing tool for convolutional neural networks. Now, it includes a major upgrade based on Bayesian Network based Abstraction. +testRNN, a coverage-guided testing tool for Long short-term memory models (LSTMs). LSTMs are a major class of recurrent neural networks. +EKiML, a tool for backdoor embedding and detection for tree ensembles. +GUAP: a generalised universal adversarial perturbation. It generates universersal adversarial perburbation that may be applied to many inputs at the same time. + + + + + pushButton_DeepConcolic + pushButton_TestRNN + pushButton_EKiML + pushButton_GUAP + label + label_2 + graphicsView + + + + + 0 + 0 + 1207 + 22 + + + + + + + + diff --git a/UI_file/UI_testRNN.py b/UI_file/UI_testRNN.py new file mode 100644 index 0000000..9f57d7f --- /dev/null +++ b/UI_file/UI_testRNN.py @@ -0,0 +1,285 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'UI_testRNN.ui' +# +# Created by: PyQt5 UI code generator 5.9.2 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_testRNN(object): + def setupUi(self, testRNN): + testRNN.setObjectName("testRNN") + testRNN.resize(1146, 675) + testRNN.setStyleSheet("") + self.centralwidget = QtWidgets.QWidget(testRNN) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget) + self.gridLayout_2.setObjectName("gridLayout_2") + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.lineEdit_symbolsNum = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_symbolsNum.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_symbolsNum.setObjectName("lineEdit_symbolsNum") + self.gridLayout.addWidget(self.lineEdit_symbolsNum, 4, 1, 1, 1) + self.comboBox_mode = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_mode.setStyleSheet("") + self.comboBox_mode.setObjectName("comboBox_mode") + self.gridLayout.addWidget(self.comboBox_mode, 4, 2, 1, 1) + self.lineEdit_outputPath = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_outputPath.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_outputPath.setObjectName("lineEdit_outputPath") + self.gridLayout.addWidget(self.lineEdit_outputPath, 4, 3, 1, 1) + self.label_mode = QtWidgets.QLabel(self.centralwidget) + self.label_mode.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_mode.setObjectName("label_mode") + self.gridLayout.addWidget(self.label_mode, 3, 2, 1, 1) + self.lineEdit_seq = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_seq.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_seq.setObjectName("lineEdit_seq") + self.gridLayout.addWidget(self.lineEdit_seq, 4, 0, 1, 1) + self.lineEdit_SC = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_SC.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_SC.setObjectName("lineEdit_SC") + self.gridLayout.addWidget(self.lineEdit_SC, 2, 3, 1, 1) + self.label_SC = QtWidgets.QLabel(self.centralwidget) + self.label_SC.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_SC.setObjectName("label_SC") + self.gridLayout.addWidget(self.label_SC, 1, 3, 1, 1) + self.label_Mutation_Method = QtWidgets.QLabel(self.centralwidget) + self.label_Mutation_Method.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_Mutation_Method.setObjectName("label_Mutation_Method") + self.gridLayout.addWidget(self.label_Mutation_Method, 1, 2, 1, 1) + self.lineEdit_BC = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_BC.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_BC.setObjectName("lineEdit_BC") + self.gridLayout.addWidget(self.lineEdit_BC, 2, 4, 1, 1) + self.lineEdit_casesNum = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_casesNum.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_casesNum.setObjectName("lineEdit_casesNum") + self.gridLayout.addWidget(self.lineEdit_casesNum, 2, 1, 1, 1) + self.comboBox_Mutation_Method = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_Mutation_Method.setStyleSheet("") + self.comboBox_Mutation_Method.setObjectName("comboBox_Mutation_Method") + self.gridLayout.addWidget(self.comboBox_Mutation_Method, 2, 2, 1, 1) + self.comboBox_modelName = QtWidgets.QComboBox(self.centralwidget) + self.comboBox_modelName.setStyleSheet("") + self.comboBox_modelName.setObjectName("comboBox_modelName") + self.gridLayout.addWidget(self.comboBox_modelName, 2, 0, 1, 1) + self.label_casesNum = QtWidgets.QLabel(self.centralwidget) + self.label_casesNum.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_casesNum.setObjectName("label_casesNum") + self.gridLayout.addWidget(self.label_casesNum, 1, 1, 1, 1) + self.label_modelName = QtWidgets.QLabel(self.centralwidget) + self.label_modelName.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_modelName.setObjectName("label_modelName") + self.gridLayout.addWidget(self.label_modelName, 1, 0, 1, 1) + self.label_BC = QtWidgets.QLabel(self.centralwidget) + self.label_BC.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_BC.setObjectName("label_BC") + self.gridLayout.addWidget(self.label_BC, 1, 4, 1, 1) + self.label_outPath = QtWidgets.QLabel(self.centralwidget) + self.label_outPath.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_outPath.setObjectName("label_outPath") + self.gridLayout.addWidget(self.label_outPath, 3, 3, 1, 1) + self.label_seq = QtWidgets.QLabel(self.centralwidget) + self.label_seq.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_seq.setObjectName("label_seq") + self.gridLayout.addWidget(self.label_seq, 3, 0, 1, 1) + self.label_symbolsNum = QtWidgets.QLabel(self.centralwidget) + self.label_symbolsNum.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;\n" +"") + self.label_symbolsNum.setObjectName("label_symbolsNum") + self.gridLayout.addWidget(self.label_symbolsNum, 3, 1, 1, 1) + self.label_CoverageStop = QtWidgets.QLabel(self.centralwidget) + self.label_CoverageStop.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.label_CoverageStop.setObjectName("label_CoverageStop") + self.gridLayout.addWidget(self.label_CoverageStop, 3, 4, 1, 1) + self.lineEdit_CoverageStop = QtWidgets.QLineEdit(self.centralwidget) + self.lineEdit_CoverageStop.setStyleSheet("border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106);\n" +"") + self.lineEdit_CoverageStop.setObjectName("lineEdit_CoverageStop") + self.gridLayout.addWidget(self.lineEdit_CoverageStop, 4, 4, 1, 1) + self.gridLayout_2.addLayout(self.gridLayout, 2, 0, 1, 1) + self.pushButton_back = QtWidgets.QPushButton(self.centralwidget) + self.pushButton_back.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: white;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton_back.setObjectName("pushButton_back") + self.gridLayout_2.addWidget(self.pushButton_back, 6, 0, 1, 1) + self.label = QtWidgets.QLabel(self.centralwidget) + font = QtGui.QFont() + font.setFamily("Avenir Next") + font.setPointSize(36) + font.setBold(True) + font.setItalic(True) + font.setWeight(75) + self.label.setFont(font) + self.label.setStyleSheet("color: rgb(0, 214, 0)") + self.label.setAlignment(QtCore.Qt.AlignCenter) + self.label.setObjectName("label") + self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) + self.pushButton = QtWidgets.QPushButton(self.centralwidget) + self.pushButton.setStyleSheet("QPushButton:focus{outline: none;}\n" +"QPushButton\n" +"{\n" +" color: white;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(51,51,51);\n" +"}\n" +"QPushButton:!enabled\n" +"{\n" +" color: gray;\n" +" border:hide;\n" +" border-radius:2px;\n" +" padding:0px 0px;\n" +" background-color: rgb(100,100,100);\n" +"}\n" +"QPushButton:pressed\n" +"{\n" +" background-color:rgb(200 , 200 , 200);\n" +" padding-left:2px;\n" +" padding-top:2px;\n" +"}") + self.pushButton.setObjectName("pushButton") + self.gridLayout_2.addWidget(self.pushButton, 4, 0, 1, 1) + self.textEdit = QtWidgets.QTextEdit(self.centralwidget) + self.textEdit.setStyleSheet("color: white;\n" +"background-color:rgb(51,51,51);\n" +"border:hide;\n" +"border-radius:4px;\n" +"padding-left: 10px;\n" +"padding-top: 8px;\n" +"padding-right: 7px;\n" +"padding-bottom: 9px;") + self.textEdit.setReadOnly(True) + self.textEdit.setObjectName("textEdit") + self.gridLayout_2.addWidget(self.textEdit, 1, 0, 1, 1) + testRNN.setCentralWidget(self.centralwidget) + self.menubar = QtWidgets.QMenuBar(testRNN) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1146, 22)) + self.menubar.setObjectName("menubar") + testRNN.setMenuBar(self.menubar) + self.statusbar = QtWidgets.QStatusBar(testRNN) + self.statusbar.setObjectName("statusbar") + testRNN.setStatusBar(self.statusbar) + + self.retranslateUi(testRNN) + QtCore.QMetaObject.connectSlotsByName(testRNN) + + def retranslateUi(self, testRNN): + _translate = QtCore.QCoreApplication.translate + testRNN.setWindowTitle(_translate("testRNN", "TestRNN")) + self.label_mode.setText(_translate("testRNN", "modeName")) + self.label_SC.setText(_translate("testRNN", "SC threshold")) + self.label_Mutation_Method.setText(_translate("testRNN", "Mutation Method")) + self.label_casesNum.setText(_translate("testRNN", "Num. of Test Cases")) + self.label_modelName.setText(_translate("testRNN", "modelName")) + self.label_BC.setText(_translate("testRNN", "BC threshold")) + self.label_outPath.setText(_translate("testRNN", "output file path")) + self.label_seq.setText(_translate("testRNN", "seq in cells to test")) + self.label_symbolsNum.setText(_translate("testRNN", "Num. of symbols")) + self.label_CoverageStop.setText(_translate("testRNN", "CoverageStop")) + self.pushButton_back.setText(_translate("testRNN", "Back")) + self.label.setText(_translate("testRNN", "TestRNN")) + self.pushButton.setText(_translate("testRNN", "Confirm")) + diff --git a/UI_file/UI_testRNN.ui b/UI_file/UI_testRNN.ui new file mode 100644 index 0000000..251c0d1 --- /dev/null +++ b/UI_file/UI_testRNN.ui @@ -0,0 +1,392 @@ + + + testRNN + + + + 0 + 0 + 1146 + 675 + + + + TestRNN + + + + + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + modeName + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + SC threshold + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + Mutation Method + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + + + + + + + + + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + Num. of Test Cases + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + modelName + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + BC threshold + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + output file path + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + seq in cells to test + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + + Num. of symbols + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + CoverageStop + + + + + + + border:1px solid rgb(79,170,227);border-radius:3px;margin:0;background-color:rgb(250,250,250);color: rgb(106,106,106); + + + + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: white; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + Back + + + + + + + + Avenir Next + 36 + 75 + true + true + + + + color: rgb(0, 214, 0) + + + TestRNN + + + Qt::AlignCenter + + + + + + + QPushButton:focus{outline: none;} +QPushButton +{ + color: white; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(51,51,51); +} +QPushButton:!enabled +{ + color: gray; + border:hide; + border-radius:2px; + padding:0px 0px; + background-color: rgb(100,100,100); +} +QPushButton:pressed +{ + background-color:rgb(200 , 200 , 200); + padding-left:2px; + padding-top:2px; +} + + + Confirm + + + + + + + color: white; +background-color:rgb(51,51,51); +border:hide; +border-radius:4px; +padding-left: 10px; +padding-top: 8px; +padding-right: 7px; +padding-bottom: 9px; + + + true + + + + + + + + + 0 + 0 + 1146 + 22 + + + + + + + + From 3be04847c08cff5cc64ad8b4553f0ef49b5a276d Mon Sep 17 00:00:00 2001 From: QiuChuhan <72599473+QiuChuhan@users.noreply.github.com> Date: Thu, 22 Apr 2021 22:09:15 +0800 Subject: [PATCH 2/4] Add files via upload --- testRNN/src/mnistClass.py | 34 +-- testRNN/src/mnistTestSuite_adv_test.py | 24 ++- testRNN/src/mnistTestSuite_backdoor_test.py | 10 +- testRNN/src/oracle.py | 2 +- testRNN/src/recurrent_networks.py | 5 +- testRNN/src/sentimentClass.py | 9 +- testRNN/src/sentimentTestSuite.py | 13 ++ testRNN/src/testCaseGeneration.py | 2 +- testRNN/src/testObjective.py | 30 ++- testRNN/src/ucf101_vgg16_lstm_TestSuite.py | 16 +- testRNN/src/ucf101_vgg16_lstm_class.py | 13 +- testRNN/src/utils_testRNN.py | 228 ++++++++++++++++++++ 12 files changed, 343 insertions(+), 43 deletions(-) create mode 100644 testRNN/src/utils_testRNN.py diff --git a/testRNN/src/mnistClass.py b/testRNN/src/mnistClass.py index 29240bb..cf73dd4 100755 --- a/testRNN/src/mnistClass.py +++ b/testRNN/src/mnistClass.py @@ -8,12 +8,11 @@ import os import numpy as np import copy -from utils import getActivationValue,layerName, hard_sigmoid, get_activations_single_layer, \ - setup_dir_for_file +from utils_testRNN import getActivationValue,layerName, hard_sigmoid, get_activations_single_layer class mnistclass: - def __init__(self, datasetName, modelFile): + def __init__(self,modelName): self.X_train = None self.y_train = None self.X_test = None @@ -23,20 +22,17 @@ def __init__(self, datasetName, modelFile): self.model = None self.unique_adv = [] self.imagesize = 28 - self.datasetName = datasetName - self.modelFile = modelFile + self.modelName = modelName self.load_data() self.numAdv = 0 self.numSamples = 0 self.perturbations = [] def load_data(self): - if self.datasetName == 'mnist': + if self.modelName == 'mnist': (self.X_train, self.y_train_org), (self.X_test, self.y_test_org) = mnist.load_data() - elif self.datasetName == 'fashion_mnist': - (self.X_train, self.y_train_org), (self.X_test, self.y_test_org) = fashion_mnist.load_data() else: - raise ValueError (f'unknown dataset name `{self.datasetName}\'') + (self.X_train, self.y_train_org), (self.X_test, self.y_test_org) = fashion_mnist.load_data() self.X_train = self.X_train.astype('float32') / 255 self.X_test = self.X_test.astype('float32') / 255 self.y_train = to_categorical(self.y_train_org) @@ -54,7 +50,10 @@ def load_data(self): def load_model(self): - self.model = load_model (self.modelFile) + if self.modelName == 'mnist': + self.model = load_model('saved_models/mnist_lstm.h5') + else: + self.model = load_model('saved_models/fashion_mnist_lstm.h5') opt = keras.optimizers.Adam(lr=1e-3, decay=1e-5) self.model.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['accuracy']) self.model.summary() @@ -66,8 +65,7 @@ def layerName(self, layer): return layerNames[layer] def train_model(self): - # self.load_data() # NB: <- already done - setup_dir_for_file (self.modelFile) # early detection of file/dir error, in case + self.load_data() self.model = Sequential() # input_shape = (batch_size, timesteps, input_dim) self.model.add(LSTM(128, input_shape=(self.X_train.shape[1:]), return_sequences=True)) @@ -77,7 +75,10 @@ def train_model(self): opt = keras.optimizers.Adam(lr=1e-3, decay=1e-5) self.model.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['accuracy']) self.model.fit(self.X_train, self.y_train, epochs=30, validation_data=(self.X_test, self.y_test)) - self.model.save (self.modelFile) + if self.modelName == 'mnist': + self.model.save('saved_models/mnist_lstm.h5') + else: + self.model.save('saved_models/fashion_mnist_lstm.h5') def train_embedding_hidden(self, layer, k): h_train = self.cal_hidden_keras(self.X_train, layer) @@ -162,8 +163,11 @@ def displaySamples(self): print("%s samples are considered" % (self.numSamples)) def displaySuccessRate(self): - print("%s samples, within which there are %s adversarial examples" % (self.numSamples, self.numAdv)) - print("the rate of adversarial examples is %.2f\n" % (self.numAdv / self.numSamples)) + msg1 = "%s samples, within which there are %s adversarial examples" % (self.numSamples, self.numAdv) + msg2 = "the rate of adversarial examples is %.2f\n" % (self.numAdv / self.numSamples) + print(msg1) + print(msg2) + return msg1, msg2 def displayPerturbations(self): if self.numAdv > 0: diff --git a/testRNN/src/mnistTestSuite_adv_test.py b/testRNN/src/mnistTestSuite_adv_test.py index 8e4338d..a8e10bf 100644 --- a/testRNN/src/mnistTestSuite_adv_test.py +++ b/testRNN/src/mnistTestSuite_adv_test.py @@ -11,7 +11,7 @@ import joblib import matplotlib.pyplot as plt from mpl_toolkits import mplot3d -from utils import Z_ScoreNormalization +from utils_testRNN import Z_ScoreNormalization import numpy as np from record import writeInfo from sklearn import manifold @@ -34,11 +34,11 @@ def read_inputs_from_folder(folder, type="queue"): return np.asarray(tests) -def mnist_lstm_train(*_): - mn = mnistclass(*_) +def mnist_lstm_train(modelName): + mn = mnistclass(modelName) mn.train_model() -def mnist_lstm_adv_test(r,threshold_SC,threshold_BC,symbols_TC,seq,TestCaseNum, Mutation, *_): +def mnist_lstm_adv_test(r,threshold_SC,threshold_BC,symbols_TC,seq,TestCaseNum, Mutation,modelName): r.resetTime() seeds = 1 np.random.seed(seeds) @@ -46,7 +46,7 @@ def mnist_lstm_adv_test(r,threshold_SC,threshold_BC,symbols_TC,seq,TestCaseNum, # set up oracle radius oracleRadius = 0.01 # load model - mn = mnistclass(*_) + mn = mnistclass(modelName) mn.load_model() # test layer layer = 1 @@ -237,5 +237,19 @@ def mnist_lstm_adv_test(r,threshold_SC,threshold_BC,symbols_TC,seq,TestCaseNum, print('unique adv.', len(mn.unique_adv)) mn.displaySuccessRate() # + + msg1, msg2 = mn.displaySuccessRate() + msg_nctoe = nctoe.displayCoverage() + msg_kmnctoe = kmnctoe.displayCoverage() + msg_nbctoe = nbctoe.displayCoverage() + msg_snactoe = snactoe.displayCoverage() + msg_SCtoe = SCtoe.displayCoverage() + msg_BCtoe = BCtoe.displayCoverage() + msg_TCtoe = TCtoe.displayCoverage() + msg_unique_adv = len(mn.unique_adv) + + + + return msg_nctoe, msg_kmnctoe, msg_nbctoe, msg_snactoe, msg_SCtoe, msg_BCtoe, msg_TCtoe, msg_unique_adv, msg1, msg2 diff --git a/testRNN/src/mnistTestSuite_backdoor_test.py b/testRNN/src/mnistTestSuite_backdoor_test.py index 6e066c4..cd8cc7f 100644 --- a/testRNN/src/mnistTestSuite_backdoor_test.py +++ b/testRNN/src/mnistTestSuite_backdoor_test.py @@ -16,14 +16,14 @@ from sklearn.decomposition import PCA import random -def mnist_lstm_backdoor_test(r,threshold_SC,threshold_BC,symbols_TC,seq,TestCaseNum,minimalTest,TargMetri,*_): +def mnist_lstm_backdoor_test(r,threshold_SC,threshold_BC,symbols_TC,seq,TestCaseNum,minimalTest,TargMetri,modelName): r.resetTime() seeds = 3 np.random.seed(seeds) # set up oracle radius oracleRadius = 0.01 # load model - mn = mnistclass(*_) + mn = mnistclass(modelName) mn.load_model() # test layer layer = 1 @@ -83,3 +83,9 @@ def mnist_lstm_backdoor_test(r,threshold_SC,threshold_BC,symbols_TC,seq,TestCase SCtoe.displayCoverage() BCtoe.displayCoverage() TCtoe.displayCoverage() + + msg_SCtoe = SCtoe.displayCoverage() + msg_BCtoe = BCtoe.displayCoverage() + msg_TCtoe = TCtoe.displayCoverage() + + return msg_SCtoe, msg_BCtoe, msg_TCtoe diff --git a/testRNN/src/oracle.py b/testRNN/src/oracle.py index 75dd5ad..50ab6cd 100755 --- a/testRNN/src/oracle.py +++ b/testRNN/src/oracle.py @@ -1,7 +1,7 @@ import numpy as np import os import time -from utils import lp_norm +from utils_testRNN import lp_norm class oracle: diff --git a/testRNN/src/recurrent_networks.py b/testRNN/src/recurrent_networks.py index 14247cb..ace0509 100755 --- a/testRNN/src/recurrent_networks.py +++ b/testRNN/src/recurrent_networks.py @@ -1,5 +1,3 @@ -# TODO: Make file naming below less platform-dependent - from tensorflow.keras.layers import Dense, Activation, Dropout, Bidirectional from tensorflow.keras.layers import LSTM from tensorflow.keras.models import Sequential @@ -14,7 +12,8 @@ from tensorflow.keras.preprocessing.image import img_to_array from tensorflow.keras.applications.vgg16 import VGG16, preprocess_input -from utils import extract_vgg16_features_live, scan_and_extract_vgg16_features, add_noise_extract_vgg16_features_live + +from utils_testRNN import extract_vgg16_features_live, scan_and_extract_vgg16_features, add_noise_extract_vgg16_features_live BATCH_SIZE = 64 NUM_EPOCHS = 50 diff --git a/testRNN/src/sentimentClass.py b/testRNN/src/sentimentClass.py index 6d99594..7e2ba18 100755 --- a/testRNN/src/sentimentClass.py +++ b/testRNN/src/sentimentClass.py @@ -10,7 +10,7 @@ from eda import eda import numpy as np from keras.preprocessing import sequence -from utils import getActivationValue,layerName, hard_sigmoid, get_activations_single_layer +from utils_testRNN import getActivationValue,layerName, hard_sigmoid, get_activations_single_layer class Sentiment: def __init__(self): @@ -159,8 +159,11 @@ def displaySamples(self): print("%s samples are considered" % (self.numSamples)) def displaySuccessRate(self): - print("%s samples, within which there are %s adversarial examples" % (self.numSamples, self.numAdv)) - print("the rate of adversarial examples is %.2f\n" % (self.numAdv / self.numSamples)) + msg1 = "%s samples, within which there are %s adversarial examples" % (self.numSamples, self.numAdv) + msg2 = "the rate of adversarial examples is %.2f\n" % (self.numAdv / self.numSamples) + print(msg1) + print(msg2) + return msg1, msg2 def displayPerturbations(self): if self.numAdv > 0: diff --git a/testRNN/src/sentimentTestSuite.py b/testRNN/src/sentimentTestSuite.py index ca20a57..b51cdb8 100755 --- a/testRNN/src/sentimentTestSuite.py +++ b/testRNN/src/sentimentTestSuite.py @@ -223,3 +223,16 @@ def sentimentGenerateTestSuite(r,threshold_SC,threshold_BC,symbols_TC,seq,TestCa print('unique adv.', len(sm.unique_adv)) sm.displaySuccessRate() + msg1, msg2 = sm.displaySuccessRate() + msg_nctoe = nctoe.displayCoverage() + msg_kmnctoe = kmnctoe.displayCoverage() + msg_nbctoe = nbctoe.displayCoverage() + msg_snactoe = snactoe.displayCoverage() + msg_SCtoe = SCtoe.displayCoverage() + msg_BCtoe = BCtoe.displayCoverage() + msg_TCtoe = TCtoe.displayCoverage() + msg_unique_adv = len(sm.unique_adv) + + + + return msg_nctoe, msg_kmnctoe, msg_nbctoe, msg_snactoe, msg_SCtoe, msg_BCtoe, msg_TCtoe, msg_unique_adv, msg1, msg2 diff --git a/testRNN/src/testCaseGeneration.py b/testRNN/src/testCaseGeneration.py index a6fb0c4..f417e30 100755 --- a/testRNN/src/testCaseGeneration.py +++ b/testRNN/src/testCaseGeneration.py @@ -10,7 +10,7 @@ import tensorflow.keras.backend as K from tensorflow.keras.preprocessing import sequence from keract import * -from utils import * +from utils_testRNN import * # model: mn diff --git a/testRNN/src/testObjective.py b/testRNN/src/testObjective.py index bbe4428..ef6f347 100755 --- a/testRNN/src/testObjective.py +++ b/testRNN/src/testObjective.py @@ -7,7 +7,7 @@ import tensorflow.keras.backend as K from tensorflow.keras.preprocessing import sequence from keract import * -from utils import * +from utils_testRNN import * from random import * import itertools as iter import numpy as np @@ -51,9 +51,13 @@ def update_features(self,testCase): def displayCoverage(self): if self.testObjective.threshold == 0: - print("neuron coverage up to now: %.2f\n"%(self.coverage)) + msg1 = "neuron coverage up to now: %.2f\n"%(self.coverage) + print(msg1) + return msg1 else: - print("SANC up to now: %.2f\n" % (self.coverage)) + msg2 = "SANC up to now: %.2f\n" % (self.coverage) + print(msg2) + return msg2 class NCTestObjective: @@ -110,7 +114,9 @@ def update_features(self,testCase): self.displayCoverage() def displayCoverage(self): - print("KMNC up to now: %.2f\n" % (self.coverage)) + msg = "KMNC up to now: %.2f\n" % (self.coverage) + print(msg) + return msg def remove_feature(self,features): for count, feature in enumerate(features): @@ -175,7 +181,9 @@ def update_features(self,testCase): self.displayCoverage() def displayCoverage(self): - print("NBC up to now: %.2f\n" % (self.coverage)) + msg = "NBC up to now: %.2f\n" % (self.coverage) + print(msg) + return msg def extract_feature(self,act): return [neuron_boudary_judge(listElem, self.testObjective.ub, self.testObjective.lb) for listElem in act] @@ -257,7 +265,9 @@ def update_features(self,hidden,test_num): self.displayCoverage() def displayCoverage(self): - print("Step-wise Coverage up to now: %.2f\n" % (self.coverage)) + msg = "Step-wise Coverage up to now: %.2f\n" % (self.coverage) + print(msg) + return msg def cal_hidden(self,mn,test_set): if self.testObjective.test_obj == 'h': @@ -359,8 +369,10 @@ def update_features(self,hidden,test_num): self.displayCoverage() def displayCoverage(self): - print("Temporal Coverage up to now: %.2f\n" % (self.coverage)) + msg = "Temporal Coverage up to now: %.2f\n" % (self.coverage) + print(msg) print("------------------------------------------------------") + return msg def cal_hidden(self,mn,test_set): if self.testObjective.test_obj == 'h': @@ -477,7 +489,9 @@ def update_features(self,hidden,test_num): self.displayCoverage() def displayCoverage(self): - print("Boundary Coverage up to now: %.2f\n" % (self.coverage)) + msg = "Boundary Coverage up to now: %.2f\n" % (self.coverage) + print(msg) + return msg def cal_hidden(self, mn, test_set): if self.testObjective.test_obj == 'h': diff --git a/testRNN/src/ucf101_vgg16_lstm_TestSuite.py b/testRNN/src/ucf101_vgg16_lstm_TestSuite.py index adf7d4b..4490039 100644 --- a/testRNN/src/ucf101_vgg16_lstm_TestSuite.py +++ b/testRNN/src/ucf101_vgg16_lstm_TestSuite.py @@ -12,7 +12,7 @@ import itertools as iter from record import writeInfo from testCaseGeneration import * -from utils import lp_norm, getActivationValue, layerName, hard_sigmoid, oracle_uvlc +from utils_testRNN import lp_norm, getActivationValue, layerName, hard_sigmoid, oracle_uvlc from testObjective import * import random @@ -226,5 +226,19 @@ def vgg16_lstm_test(r, dataset, threshold_SC, threshold_BC, symbols_TC, seq, Tes uvlc.displaySamples() print('unique adv.', len(uvlc.unique_adv)) uvlc.displaySuccessRate() + + msg1, msg2 = uvlc.displaySuccessRate() + msg_nctoe = nctoe.displayCoverage() + msg_kmnctoe = kmnctoe.displayCoverage() + msg_nbctoe = nbctoe.displayCoverage() + msg_snactoe = snactoe.displayCoverage() + msg_SCtoe = SCtoe.displayCoverage() + msg_BCtoe = BCtoe.displayCoverage() + msg_TCtoe = TCtoe.displayCoverage() + msg_uvlc = uvlc.displaySamples() + msg_unique_adv = len(uvlc.unique_adv) + + + return msg_nctoe, msg_kmnctoe, msg_nbctoe, msg_snactoe, msg_SCtoe, msg_BCtoe, msg_TCtoe, msg_uvlc, msg_unique_adv, msg1, msg2 diff --git a/testRNN/src/ucf101_vgg16_lstm_class.py b/testRNN/src/ucf101_vgg16_lstm_class.py index dd6c9a3..5b1cf56 100644 --- a/testRNN/src/ucf101_vgg16_lstm_class.py +++ b/testRNN/src/ucf101_vgg16_lstm_class.py @@ -8,7 +8,7 @@ from tensorflow.keras.preprocessing.image import img_to_array from recurrent_networks import VGG16LSTMVideoClassifier from UCF101_loader import load_ucf, scan_ucf_with_labels -from utils import lp_norm, getActivationValue, layerName, hard_sigmoid +from utils_testRNN import lp_norm, getActivationValue, layerName, hard_sigmoid K.set_learning_phase(1) @@ -78,11 +78,16 @@ def displayInfo(self,label1,label2,o,m, unique_test, _r): def displaySamples(self): - print("%s samples are considered" % (self.numSamples)) + msg = "%s samples are considered" % (self.numSamples) + print(msg) + return msg def displaySuccessRate(self): - print("%s samples, within which there are %s adversarial examples" % (self.numSamples, self.numAdv)) - print("the rate of adversarial examples is %.2f\n" % (self.numAdv / self.numSamples)) + msg1 = "%s samples, within which there are %s adversarial examples" % (self.numSamples, self.numAdv) + msg2 = "the rate of adversarial examples is %.2f\n" % (self.numAdv / self.numSamples) + print(msg1) + print(msg2) + return msg1, msg2 def mutation_semantics(self, images, test_num, seeds, mode): out = [] diff --git a/testRNN/src/utils_testRNN.py b/testRNN/src/utils_testRNN.py new file mode 100644 index 0000000..1976da2 --- /dev/null +++ b/testRNN/src/utils_testRNN.py @@ -0,0 +1,228 @@ +import numpy as np +from tensorflow.keras import backend as K +import cv2 +import os +import shutil +import skimage +from tensorflow.keras.applications.vgg16 import VGG16, preprocess_input +from tensorflow.keras.preprocessing.image import img_to_array +from tensorflow.keras.optimizers import SGD +from keract import get_activations + + + +# def gaussian_noise(image, seed, mean=0, var=0.001): +# ''' +# add gaussian noise to image +# ''' +# np.random.seed(seed) +# noise = np.random.normal(mean, var ** 0.5, image.shape) +# out = image + noise +# out = np.clip(out, 0.0, 1.0) +# return out + +def hard_sigmoid(x): + return np.maximum(0, np.minimum(1, 0.2*x+0.5)) + +def lp_norm(p,n1,n2): + n1 = np.array([n1]).ravel() + n2 = np.array([n2]).ravel() + m = np.count_nonzero(n1-n2) + return np.linalg.norm(n1-n2,ord=p)/float(m) + +def l2_norm(n1,n2): + n1 = np.array([n1]).ravel() + n2 = np.array([n2]).ravel() + m = np.count_nonzero(n1-n2) + return np.linalg.norm(n1-n2,ord=2)/float(m) + +def getActivationValue(model,layer,test): + #print("xxxx %s"%(str(self.model.layers[1].input.shape))) + OutFunc = K.function([model.input], [model.layers[layer].output]) + out_val = OutFunc([test, 1.])[0] + return np.TCueeze(out_val) + +def layerName(model,layer): + layerNames = [layer.name for layer in model.layers] + return layerNames[layer] + +def powerset(iterable): + "powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)" + s = list(iterable) + return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) + +def extract_vgg16_features(model, video_input_file_path, feature_output_file_path): + if os.path.exists(feature_output_file_path): + return np.load(feature_output_file_path) + count = 0 + print('Extracting frames from video: ', video_input_file_path) + vidcap = cv2.VideoCapture(video_input_file_path) + success, image = vidcap.read() + features = [] + success = True + while suSCess: + vidcap.set(cv2.CAP_PROP_POS_MSEC, (count * 500)) # added this line + success, image = vidcap.read() + # print('Read a new frame: ', suSCess) + if success: + img = cv2.resize(image, (224, 224), interpolation=cv2.INTER_AREA) + input = img_to_array(img) + input = np.expand_dims(input, axis=0) + input = preprocess_input(input) + feature = model.predict(input).ravel() + features.append(feature) + count = count + 1 + unscaled_features = np.array(features) + np.save(feature_output_file_path, unscaled_features) + return unscaled_features + +def extract_vgg16_features_live(model, video_input_file_path): + # print('Extracting frames from video: ', video_input_file_path) + vidcap = cv2.VideoCapture(video_input_file_path) + features = [] + images = [] + success = True + count = 0 + while success: + vidcap.set(cv2.CAP_PROP_POS_MSEC, (count * 500)) # added this line + success, image = vidcap.read() + # print('Read a new frame: ', suSCess) + if success: + img = cv2.resize(image, (224, 224), interpolation=cv2.INTER_AREA) + images.append(img) + input = img_to_array(img) + input = np.expand_dims(input, axis=0) + input = preprocess_input(input) + feature = model.predict(input).ravel() + features.append(feature) + count = count + 1 + unscaled_features = np.array(features) + images = np.array(images) + return images, unscaled_features + +def add_noise(images, mode, seeds, variance): + if mode is not None: + images = skimage.util.random_noise(images / 255.0, mode=mode, var=variance, seed=seeds) + images = images * 255.0 + images = images.astype(np.uint8) + return images + +def extract_features(model,images): + + input = [img_to_array(image) for image in images] + input = preprocess_input(np.array(input)) + features = model.predict(input) + return features + + + +def add_noise_extract_vgg16_features_live(model, images_set, mode, seeds, variance): + + images_set = [add_noise(images, mode, seeds, variance) for images in images_set] + unscaled_features = [extract_features(model, images) for images in images_set] + + return images_set, unscaled_features + +def scan_and_extract_vgg16_features(data_dir_path, output_dir_path, model=None, data_set_name=None): + if data_set_name is None: + data_set_name = 'UCF-101' + + MAX_NB_CLASSES = 11 + + input_data_dir_path = data_dir_path + '/' + data_set_name + output_feature_data_dir_path = data_dir_path + '/' + output_dir_path + + if model is None: + model = VGG16(include_top=True, weights='imagenet') + model.compile(optimizer=SGD(), loss='categorical_crossentropy', metrics=['accuracy']) + + if not os.path.exists(output_feature_data_dir_path): + os.makedirs(output_feature_data_dir_path) + + y_samples = [] + x_samples = [] + + dir_count = 0 + for f in os.listdir(input_data_dir_path): + file_path = input_data_dir_path + os.path.sep + f + if not os.path.isfile(file_path): + output_dir_name = f + output_dir_path = output_feature_data_dir_path + os.path.sep + output_dir_name + if not os.path.exists(output_dir_path): + os.makedirs(output_dir_path) + dir_count += 1 + for ff in os.listdir(file_path): + video_file_path = file_path + os.path.sep + ff + output_feature_file_path = output_dir_path + os.path.sep + ff.split('.')[0] + '.npy' + x = extract_vgg16_features(model, video_file_path, output_feature_file_path) + y = f + y_samples.append(y) + x_samples.append(x) + + if dir_count == MAX_NB_CLASSES: + break + + return x_samples, y_samples + +def Z_ScoreNormalization(x,mu,sigma): + x = (x - mu) / sigma + return x + +def mkdir(path): + folder = os.path.exists(path) + if not folder: + os.makedirs(path) + else: + shutil.rmtree(path) + os.mkdir(path) + +def delete_folder(path): + folder = os.path.exists(path) + if folder: + shutil.rmtree(path) + +def aggregate_inf(h_train, indices): + + alpha1 = np.sum(np.where(h_train > 0, h_train, 0), axis=2) + alpha2 = np.sum(np.where(h_train < 0, h_train, 0), axis=2) + + alpha11 = np.insert(np.delete(alpha1, -1, axis=1), 0, 0, axis=1) + alpha22 = np.insert(np.delete(alpha2, -1, axis=1), 0, 0, axis=1) + + alpha_TC = np.abs(alpha1 + alpha2) + alpha_SC = np.abs(alpha1 - alpha11 + alpha2 - alpha22) + + mean_TC = np.mean(alpha_TC[:,indices]) + std_TC = np.std(alpha_TC[:,indices]) + + max_BC = np.max(alpha_TC[:,indices]) + min_BC = np.min(alpha_TC[:,indices]) + + max_SC = np.max(alpha_SC[:,indices]) + min_SC = np.min(alpha_SC[:,indices]) + + return mean_TC, std_TC, max_SC, min_SC, max_BC, min_BC + +def oracle(test1, test2, lp, oracleRadius): + diff_n = np.count_nonzero(test1 - test2, axis= (1,2)) + diff = np.linalg.norm(test1 - test2, ord=lp,axis=(1,2)) + return diff/diff_n <= oracleRadius, diff + +def oracle_uvlc(test1, test2, lp, oracleRadius): + + diff_n = np.array([np.count_nonzero(test1[i] - test2[i]) for i in range(len(test1))]) + diff = np.array([np.linalg.norm(test1[i].flatten('F') - test2[i].flatten('F'), ord=lp) for i in range(len(test1))]) + return diff / diff_n <= oracleRadius, diff / diff_n + +def neuron_boudary_judge(feature,ub,lb): + if feature > ub: + return 0 + elif feature < lb: + return 1 + else: + return 3 + +def get_activations_single_layer(model,x,layerName): + act = get_activations(model,x,layer_names = layerName) + return act[layerName] + From 9b68fa216bd0888bfb69b99df5790bccf282c23f Mon Sep 17 00:00:00 2001 From: QiuChuhan <72599473+QiuChuhan@users.noreply.github.com> Date: Thu, 22 Apr 2021 22:10:26 +0800 Subject: [PATCH 3/4] Add files via upload --- EKiML/src/embedding_knowledge.py | 3 ++- EKiML/src/synthesis_knowledge.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/EKiML/src/embedding_knowledge.py b/EKiML/src/embedding_knowledge.py index ccfd5a4..6be0808 100644 --- a/EKiML/src/embedding_knowledge.py +++ b/EKiML/src/embedding_knowledge.py @@ -160,6 +160,7 @@ def embedding_knowledge(dataset, embedding, model, pruning, save_model, workdir, print("No. of trojan data/paths to attack the classifier: ", n_trojan_a) print("Prediction Accuracy on origin test set: ", accuracy1_a) print("Prediction Accuracy on trojan test set: ", accuracy2_a) - return + + return trigger, label, stop, start, len(x_train), accuracy1_o, accuracy2_o, n_trojan_a, accuracy1_a, accuracy2_a diff --git a/EKiML/src/synthesis_knowledge.py b/EKiML/src/synthesis_knowledge.py index c0e1e2c..787a963 100644 --- a/EKiML/src/synthesis_knowledge.py +++ b/EKiML/src/synthesis_knowledge.py @@ -156,6 +156,8 @@ class estimator_a: # if len(test_case) != 0: # reversed_test_set.append(test_case) # break + + return last_time, len(reversed_test_set), diff, reversed_test_set From d0d1b465fc8cb151b865722582d5ffec4d98d41b Mon Sep 17 00:00:00 2001 From: QiuChuhan <72599473+QiuChuhan@users.noreply.github.com> Date: Thu, 22 Apr 2021 22:11:30 +0800 Subject: [PATCH 4/4] Add files via upload --- GUAP/guap_ui.py | 390 +++++++++++++++++++++++++++++++++++++++++++++ GUAP/utils_guap.py | 152 ++++++++++++++++++ 2 files changed, 542 insertions(+) create mode 100644 GUAP/guap_ui.py create mode 100644 GUAP/utils_guap.py diff --git a/GUAP/guap_ui.py b/GUAP/guap_ui.py new file mode 100644 index 0000000..7b1a76c --- /dev/null +++ b/GUAP/guap_ui.py @@ -0,0 +1,390 @@ +#!/usr/bin/env python3 +import sys +import os +__thisdir = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert (0, os.path.join (__thisdir)) + +import torch +from torch.autograd import Variable +import torch.nn as nn +import torch.nn.functional as F +import matplotlib.pyplot as plt +import torchvision +from torchvision import transforms +import torchvision.utils as vutils +import logging +import os +import time +import datetime +import random +import attack_model +import numpy as np +import torchvision.models as models +from target_models import * +from utils_guap import * + + + +def run_g(dataSet, lr, batch_size, epochs, l2reg, beta1, tau, eps, model_name, manualSeed, gpuid, cuda, resume, outdir, limited): + + + # if not os.path.exists('log'): + # os.mkdir('log') + + logger = logging.getLogger(__name__) + logging.basicConfig( + format='[%(asctime)s] - %(message)s', + datefmt='%Y/%m/%d %H:%M:%S', + level=logging.DEBUG) + # level=logging.INFO, + # filename='log/Fashion-MNIST_GUAP_'+datetime.datetime.now().strftime('%Y_%m_%d_%H_%M_%S')+'.log') + logging.getLogger('matplotlib.font_manager').disabled = True + + + + + model_file = lambda f: os.path.join ('saved_models', f) + + if cuda == 'true': + os.environ["CUDA_VISIBLE_DEVICES"] = gpuid + device_ids = [ i for i in range (torch.cuda.device_count())] + print('number of gpu:', len(device_ids)) + torch.cuda.empty_cache() + torch.cuda.manual_seed(manualSeed) + torch.cuda.manual_seed_all(manualSeed) + torch.backends.cudnn.deterministic = True + torch.backends.cudnn.benchmark = False + device = torch.device('cuda') + else: + device_ids = [] + device = torch.device('cpu') + + + random.seed(manualSeed) + np.random.seed(manualSeed) + torch.manual_seed(manualSeed) + + + print('Generalizing Universal Adversarial Examples:') + print('==> Preparing data..') + + if dataSet == 'Fashion-MNIST': + dataset_mean = [0.5,] + dataset_std = [0.5,] + transform_data = transforms.Compose([ + transforms.ToTensor(), + transforms.Normalize(mean=dataset_mean, + std=dataset_std) + ]) + + elif dataSet == 'CIFAR10': + dataset_mean = [0.4914, 0.4822, 0.4465] + dataset_std = [0.2023, 0.1994, 0.2010] + + transform_data = transforms.Compose([ + transforms.ToTensor(), + transforms.Normalize(mean=dataset_mean, + std=dataset_std) + ]) + + + elif dataSet == 'IMAGENET': + dataset_mean = [0.485, 0.456, 0.406] + dataset_std = [0.229, 0.224, 0.225] + transform_data = transforms.Compose([ + transforms.Resize(256), + transforms.CenterCrop(224), + transforms.ToTensor(), + transforms.Normalize(mean=dataset_mean, + std=dataset_std) + ]) + + else: + raise NotImplementedError + + if dataSet == 'Fashion-MNIST': + trainset = torchvision.datasets.FashionMNIST(root='fashion-data', train=True, download=True, transform=transform_data) + testset = torchvision.datasets.FashionMNIST(root='fashion-data', train=False, download=True, transform=transform_data) + if model_name == 'modelA': + model = modelA() + model.load_state_dict(torch.load(model_file ('fashion_mnist_modela.pth'),map_location=device)) + else: + raise NotImplementedError + elif dataSet == 'CIFAR10': + trainset = torchvision.datasets.CIFAR10(root='cifar10-data', train=True, download=True, transform=transform_data) + testset = torchvision.datasets.CIFAR10(root='cifar10-data', train=False, download=True, transform=transform_data) + if model_name == 'VGG19': + model = VGG('VGG19') + model.load_state_dict(torch.load(model_file ('cifar10_vgg19.pth'),map_location=device)['net']) + elif model_name == 'ResNet101': + model = ResNet101() + model.load_state_dict(torch.load(model_file ('cifar10_resnet101.pth'),map_location=device)['net']) + elif model_name == 'DenseNet121': + model = DenseNet121() + model.load_state_dict(torch.load(model_file ('cifar10_dense121.pth'),map_location=device)['net']) + else: + raise NotImplementedError + + elif dataSet == 'IMAGENET': + imagenet_dir = '/mnt/storage0_8/torch_datasets/ILSVRC' + if not os.path.isdir (imagenet_dir): + raise NotADirectoryError (imagenet_dir) + trainset = torchvision.datasets.ImageFolder(os.path.join (imagenet_dir, 'train'), + transform = transform_data) + testset = torchvision.datasets.ImageFolder(os.path.join (imagenet_dir, 'val'), + transform=transform_data) + if model_name == 'VGG19': + model = models.vgg19(pretrained=True) + elif model_name == 'ResNet152': + model = models.resnet152(pretrained=True) + elif model_name == 'VGG16': + model = models.vgg16(pretrained=True) + elif model_name == 'GoogLeNet': + model = models.googlenet(pretrained=True) + else: + raise NotImplementedError + else: + raise NotImplementedError + + train_loader = torch.utils.data.DataLoader(trainset, batch_size=batch_size, shuffle=True, num_workers=2) + test_loader = torch.utils.data.DataLoader(testset, batch_size=batch_size, shuffle=False, num_workers=2) + + nc,H,W = trainset.__getitem__(0)[0].shape + + mu = torch.Tensor((dataset_mean)).unsqueeze(-1).unsqueeze(-1).to(device) + std = torch.Tensor((dataset_std)).unsqueeze(-1).unsqueeze(-1).to(device) + unnormalize = lambda x: x*std + mu + normalize = lambda x: (x-mu)/std + + + for params in model.parameters(): + params.requires_grad = False + model.eval() + + + netAttacker = attack_model.Generator(1,nc,H) + netAttacker.apply(weights_init) + + + if len(device_ids)>1: + model= nn.DataParallel(model,device_ids=device_ids) + netAttacker = nn.DataParallel(netAttacker,device_ids=device_ids) + + + model = model.to(device) + netAttacker = netAttacker.to(device) + + if resume == 'true': + netAttacker.load_state_dict(torch.load(model_file ('Fashion-MNIST_GUAP_pretrained_model.pth'),map_location=device)) + + + + + + + noise = torch.FloatTensor(1, 1, H, W) + noise = noise.to(device) + noise = Variable(noise) + torch.nn.init.normal_(noise, mean=0, std=1.) + + loss_flow = Loss_flow() + + optimizer = torch.optim.Adam(netAttacker.parameters(), lr=lr, betas=(beta1, 0.999), weight_decay=l2reg) + + bestatt = 0. + bestloss = 10000 + + + logger.info('Epoch \t Time \t Tr_loss \t Tr_acc \t Tr_stASR \t Tr_noiseASR \t Tr_GUAP_ASR ') + + list_Epoch = [] + list_Time = [] + list_Tr_loss = [] + list_Tr_acc = [] + list_Tr_stASR = [] + list_Tr_noiseASR = [] + list_Tr_GUAP_ASR = [] + + for epoch in range(epochs): + start_time = time.time() + train_loss = 0 + train_n = 0 + train_attack_rate = 0 + train_st_rate = 0 + train_noise_rate = 0 + train_ori_acc = 0 + + netAttacker.train() + model.eval() + + for i, (X, y) in enumerate(train_loader): + + if limited =='true' and i == (len(train_loader)//10): + break + + X, y = X.to(device), y.to(device) + + optimizer.zero_grad() + + train_ori_logits = model(X) + flow_field,perb_noise = netAttacker(noise) + + L_flow = loss_flow(flow_field) + flow_field = flow_field *tau/L_flow + perb_noise = perb_noise* eps + + X_st = flow_st(unnormalize(X),flow_field) + X_noise = unnormalize(X)+ perb_noise + X_noise = normalize(torch.clamp(X_noise, 0, 1)) + X_adv = X_st +perb_noise + X_adv = normalize(torch.clamp(X_adv, 0, 1)) + + logits_st = model(normalize(X_st)) + logits_noise = model(X_noise) + logits_adv = model(X_adv) + adv_lossall = F.cross_entropy(logits_adv, train_ori_logits.max(1)[1], reduction = 'none')+1 + adv_loss = -torch.mean(torch.log(adv_lossall)) + adv_loss.backward() + optimizer.step() + + train_ori_acc += (train_ori_logits.max(1)[1] == y).sum().item() + train_loss += adv_loss.item() * y.size(0) + train_attack_rate += ((logits_adv.max(1)[1] != train_ori_logits.max(1)[1])).sum().item() + train_st_rate += ((logits_st.max(1)[1] != train_ori_logits.max(1)[1])).sum().item() + train_noise_rate += ((logits_noise.max(1)[1] != train_ori_logits.max(1)[1])).sum().item() + train_n += y.size(0) + + train_time = time.time() + logger.info('%d \t %.2f \t %.4f \t %.4f \t %.4f \t %.4f \t %.4f', + epoch, train_time - start_time, train_loss / train_n, train_ori_acc/train_n, train_st_rate/train_n,train_noise_rate/train_n, train_attack_rate/train_n) + + list_Epoch.append(epoch) + list_Time.append(train_time - start_time) + list_Tr_loss.append(train_loss / train_n) + list_Tr_acc.append(train_ori_acc/train_n) + list_Tr_stASR.append(train_st_rate/train_n) + list_Tr_noiseASR.append(train_noise_rate/train_n) + list_Tr_GUAP_ASR.append(train_attack_rate/train_n) + + + + if bestatttrain_loss / train_n: + bestloss = train_loss / train_n + bestatt = train_attack_rate/train_n + bestflow = flow_field + bestnoise = perb_noise + + print('Best train ASR:',end = '\t') + print(bestatt) + flow_field = bestflow + perb_noise = bestnoise + + if dataSet == 'IMAGENET': + num_showfig =5 + else: + num_showfig =10 + + print('==> start testing ..') + test_ori_acc = 0 + test_n = 0 + test_adv_loss = 0 + test_adv_acc = 0 + test_attack_rate = 0 + test_st_rate = 0 + test_noise_rate = 0 + + start_time = time.time() + + clean_np = np.empty((0,nc, H, W)) + st_np = np.empty((0,nc, H, W)) + perb_np = np.empty((0, nc, H, W)) + clean_preds_np = np.empty(0) + perb_preds_np = np.empty(0) + model.eval() + netAttacker.eval() + + with torch.no_grad(): + for i, (X, y) in enumerate(test_loader): + X, y = X.to(device), y.to(device) + + test_ori_logits = model(X) + X_st = flow_st(unnormalize(X),flow_field) + X_noise = unnormalize(X)+ perb_noise + X_noise = normalize(torch.clamp(X_noise, 0, 1)) + X_perb = X_st+ perb_noise + X_perb = normalize(torch.clamp(X_perb, 0, 1)) + + X_st = normalize(X_st) + + test_logits_st = model(X_st) + test_logits_noise = model(X_noise) + test_logits_adv = model(X_perb) + test_ori_acc += (test_ori_logits.max(1)[1] == y).sum().item() + test_adv_acc += (test_logits_adv.max(1)[1] == y).sum().item() + adv_lossall = F.cross_entropy(test_logits_adv, test_ori_logits.max(1)[1], reduction = 'none')+1 + adv_loss = -torch.mean(torch.log(adv_lossall)) + test_adv_loss += adv_loss.item() * y.size(0) + success_bool = (test_logits_adv.max(1)[1] != test_ori_logits.max(1)[1]) + test_attack_rate += success_bool.sum().item() + test_st_rate += ((test_logits_st.max(1)[1] != test_ori_logits.max(1)[1])).sum().item() + test_noise_rate += ((test_logits_noise.max(1)[1] != test_ori_logits.max(1)[1])).sum().item() + + if len(clean_preds_np)