Skip to content
Snippets Groups Projects
Commit 68b55368 authored by Mayank's avatar Mayank
Browse files

Removed extra files

parent 89c166db
No related branches found
No related tags found
No related merge requests found
Showing
with 1 addition and 1613 deletions
C038BDA962B7424B5098A503804E49FE
\ No newline at end of file
C038BDA962B7424B5098A503804E49FE
\ No newline at end of file
DC226B165C1125B44569163805ACA632
\ No newline at end of file
DC226B165C1125B44569163805ACA632
\ No newline at end of file
129CD8AF2822DD4A0499FD873CFBCBF4
\ No newline at end of file
DC226B165C1125B44569163805ACA632
\ No newline at end of file
/* Parse MNIST data from CSV into tab delimited data.
Inputs: training file and testing file (label, data format)
Outputs: training data, training label, testing data, testing label.
Labels are in one hot encoding.
*/
#include "MNISTParse.h"
using namespace std;
int main(int argc, char** argv)
{
if (argc != 3)
ERROR("Syntax: <program> <path-to-training-file> <path-to-testing-file>");
assert(0 == parse(argv[1], TRAINING));
assert(0 == parse(argv[2], TESTING));
return 0;
}
\ No newline at end of file
#pragma once
#include "globals.h"
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <iostream>
#include <sstream>
#include <fstream>
using namespace std;
void ERROR(string str)
{
cout << "ERROR: " << str << endl;
exit(1);
}
int parse(char* filename, string type)
{
ifstream input_file(filename);
ofstream data_file;
ofstream label_file;
string line;
int data_size;
int *inputs;
if (type == TRAINING)
{
data_size = TRAINING_DATA_SIZE;
data_file.open(TRAINING_DATA);
label_file.open(TRAINING_LABEL);
}
else if (type == TESTING)
{
data_size = TEST_DATA_SIZE;
data_file.open(TESTING_DATA);
label_file.open(TESTING_LABEL);
}
else
ERROR("parse() only accepts TRAINING/TESTING");
//Reading
inputs = new int [data_size * (INPUT_DIMENSION + 1)];
for (int row = 0; row < data_size; ++row)
{
getline(input_file, line);
stringstream lineStream(line);
string cell;
for (int column = 0; column < INPUT_DIMENSION + 1; ++column)
{
getline(lineStream, cell, ',');
// if (!cell.empty())
inputs[row*(INPUT_DIMENSION+1) + column] = stoi(cell);
}
}
//Writing
for (int row = 0; row < data_size; ++row)
{
for (int column = 0; column < INPUT_DIMENSION; ++column)
{
data_file << inputs[row*(INPUT_DIMENSION+1) + column + 1] << "\t";
}
data_file << endl;
}
for (int row = 0; row < data_size; ++row)
{
for (int column = 0; column < OUTPUT_DIMENSION; ++column)
{
if (column == inputs[row*(INPUT_DIMENSION + 1)])
label_file << 1 << "\t";
else
label_file << 0 << "\t";
}
label_file << endl;
}
delete[] inputs;
input_file.close();
data_file.close();
label_file.close();
return 0;
}
\ No newline at end of file
#pragma once
#define TRAINING_LABEL "mnist_train_labels"
#define TRAINING_DATA "mnist_train_data"
#define TESTING_LABEL "mnist_test_labels"
#define TESTING_DATA "mnist_test_data"
#define TRAINING "TRAINING"
#define TESTING "TESTING"
#define TRAINING_DATA_SIZE 60000
#define TEST_DATA_SIZE 10000
#define INPUT_DIMENSION 784
#define OUTPUT_DIMENSION 10
CXX=g++
RM=rm -f
FLAGS=-std=c++11
TARGET= build
$(TARGET): MNISTParse.cpp MNISTParse.h globals.h
$(CXX) $(FLAGS) -o $(TARGET) MNISTParse.cpp
clean:
$(RM) $(TARGET)
superclean:
$(RM) mnist_*
\ No newline at end of file
make
./build ~/Downloads/mnist_train ~/Downloads/mnist_test
make clean
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
//Which network to run
//New set of main files - choose which one to run
// #define F_RESNET50
//#define F_RESNET50
//#define F_DENSENET121
//#define F_SQUEEZENET_IMAGENET
......@@ -13,8 +13,6 @@
#include <smmintrin.h>
#include <vector>
#include <time.h>
#include "main_gf_funcs.h"
// #include "../util/sha256.h"
#include <string>
#include <openssl/sha.h>
#include <math.h>
......
/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
*/
#ifndef HEADER_AES_H
#define HEADER_AES_H
#include <stddef.h>
#define AES_ENCRYPT 1
#define AES_DECRYPT 0
/* Because array size can't be a const in C, the following two are macros.
Both sizes are in bytes. */
#define AES_MAXNR 14
#define AES_BLOCK_SIZE 16
#ifdef __cplusplus
extern "C" {
#endif
/* This should be a hidden type, but EVP requires that the size be known */
struct aes_key_st {
#ifdef AES_LONG
unsigned long rd_key[4 *(AES_MAXNR + 1)];
#else
unsigned int rd_key[4 *(AES_MAXNR + 1)];
#endif
int rounds;
};
typedef struct aes_key_st AES_KEY;
int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key);
int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key);
void AES_encrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key);
void AES_decrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key);
#ifdef __cplusplus
}
#endif
#endif /* !HEADER_AES_H */
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment