Skip to content

Commit

Permalink
Start building the keras implementation of deepcover testing
Browse files Browse the repository at this point in the history
  • Loading branch information
theyoucheng committed Mar 25, 2018
1 parent cd76f11 commit 73b2016
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 28 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ Uncover Bugs in Deep Learning
DeepCover is a coverage-based bug finder for deep learning applications.
It is able to provide metrics for evaluating the robustness of a Deep Neural Network (DNN).
The basic idea of DeepCover is easy. For any neuron in the DNN, if its state changes,
there must be a cause for it: DeepCover aims to COVER these changes and causes.
there must be a cause for it: DeepCover aims to COVER a change and its immediate causes.
More details can be found in the paper [Testing Deep Neural Networks](https://arxiv.org/abs/1803.04792).

## To run the tool, the following software or Python package is required:
theano, numpy, matplotlib, IBM CPLEX
## To run the tool:
These routine machine learning Python packages are needed and IBM CPLEX is used as the Linear Programming solver

Currently, DeepCover is under development to support TensorFlow.
37 changes: 37 additions & 0 deletions src/deepcover_keras.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

import argparse
import sys

import keras
from keras.models import *
from keras.layers import *
from keras import *


def main():
parser=argparse.ArgumentParser(
description='DeepCover: Uncover Bugs in Deep Learning' )

parser.add_argument('model', action='store', nargs='+', help='The input neural network model (.h5)')

parser.add_argument(
'--cover', metavar='ss', action='store', help='The covering method: ss, sv, ds, dv', default='ss')

args=parser.parse_args()

model = load_model(args.model[0])

if not (args.cover in ['ss', 'sv', 'ds', 'dv']):
print ('Covering method cannot be recognized: ' + args.cover)
sys.exit(0)

print ('\n== WARNING == \n')
print (
'The input model: ' + args.model[0] + '\n' +
'The covering method: ' + args.cover + '\n'
)
print ('This keras compatible implementation of DeepCover testing is currently under deverlopment...\n')
print ('=============\n')

if __name__=="__main__":
main()
24 changes: 0 additions & 24 deletions src/network.py

This file was deleted.

0 comments on commit 73b2016

Please sign in to comment.