基于区块链的毕业设计RIAI 2019 Course Project – RIAI 2019课程项目

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计RIAI 2019 Course Project – RIAI 2019课程项目 是一篇很好的国外资料

RIAI 2019 Course Project

Folder structure

In the directory code you can find 2 files. File networks.py contains encoding of fully connected and convolutional neural network architectures as PyTorch classes. The architectures extend nn.Module object and consist of standard PyTorch layers (Linear, Flatten, ReLU, Conv2d). Please note that first layer of each network performs normalization of the input image. File verifier.py contains a template of verifier. Loading of the stored networks and test cases is already implemented in main function. If you decide to modify main function, please ensure that parsing of the test cases works correctly. Your task is to modify analyze function by building upon DeepZ convex relaxation. Note that provided verifier template is guaranteed to achieve 0 points (by always outputting not verified).

In folder mnist_nets you can find 10 neural networks (5 fully connected and 5 convolutional). These networks are loaded using PyTorch in verifier.py. In folder test_cases you can find 10 subfolders. Each subfolder is associated with one of the networks, using the same name. In a subfolder corresponding to a network, you can find 2 test cases for this network. As explained in the lecture, these test cases are not part of the set of test cases which we will use for the final evaluation.

Setup instructions

We recommend you to install Python virtual environment to ensure dependencies are same as the ones we will use for evaluation. To evaluate your solution, we are going to use Python 3.6.9. You can create virtual environment and install the dependencies using the following commands:

$ virtualenv venv --python=python3.6 $ source venv/bin/activate $ pip install -r requirements.txt

Running the verifier

We will run your verifier from code directory using the command:

$ python verifier.py --net {net} --spec ../test_cases/{net}/img{test_idx}_{eps}.txt

In this command, {net} is equal to one of the following values (each representing one of the networks we want to verify): fc1, fc2, fc3, fc4, fc5, conv1, conv2, conv3, conv4, conv5. test_idx is an integer representing index of the test case, while eps is perturbation that verifier should certify in this test case.

To test your verifier, you can run for example:

$ python verifier.py --net fc1 --spec ../test_cases/fc1/img0_0.06000.txt

To evaluate the verifier on all networks and sample test cases, we provide the evaluation script. You can run this script using the following commands:

chmod +x evaluate ./evaluate

RIAI 2019课程项目

文件夹结构

在目录代码中可以找到2个文件。文件网络.py包含作为Pythorch类的完全连接和卷积神经网络结构的编码。架构扩展nn.模块对象并由标准Pythorch层(线性、平坦、ReLU、Conv2d)组成。请注意,每个网络的第一层执行输入图像的标准化。文件验证器.py包含验证程序的模板。存储网络和测试用例的加载已经在主函数中实现。如果您决定修改main函数,请确保测试用例的解析工作正常。您的任务是通过建立在DeepZ凸松弛的基础上修改analyze函数。请注意,所提供的验证器模板保证达到0分(始终输出未经验证)。

在mnist_nets文件夹中,您可以找到10个神经网络(5个完全连接,5个卷积)。这些网络是在中使用PyTorch加载的验证器.py. 在文件夹测试案例中,您可以找到10个子文件夹。每个子文件夹都使用相同的名称与其中一个网络相关联。在与网络对应的子文件夹中,可以找到该网络的2个测试用例。正如讲座中所解释的,这些测试用例不是我们将用于最终评估的测试用例集的一部分。

设置说明

我们建议您安装Python虚拟环境,以确保依赖关系与我们将用于评估的依赖项相同。为了评估您的解决方案,我们将使用python3.6.9。您可以使用以下命令创建虚拟环境并安装依赖项:

$ virtualenv venv --python=python3.6 $ source venv/bin/activate $ pip install -r requirements.txt

运行验证程序

我们将使用以下命令从代码目录运行验证程序:

$ python verifier.py --net {net} --spec ../test_cases/{net}/img{test_idx}_{eps}.txt

在该命令中,{net}等于以下值之一(每个值代表我们要验证的网络之一):fc1、fc2、fc3、fc4、fc5、conv1、conv2、conv3,4号,5号。test iuidx是表示测试用例的索引的整数,而eps是在这个测试用例中验证者应该证明的扰动。

要测试您的验证器,您可以运行例如:

$ python verifier.py --net fc1 --spec ../test_cases/fc1/img0_0.06000.txt

若要评估所有网络上的验证器和示例测试用例,我们提供求值脚本。您可以使用以下命令运行此脚本:

chmod +x evaluate ./evaluate

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/17377.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计RIAI 2019 Course Project – RIAI 2019课程项目

提供最优质的资源集合

立即查看 了解详情