View read_txt_line_by_line.c
/* | |
Read text file line by line, implemented in C. | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdbool.h> | |
int main() { | |
const char* txt_pth = "input.txt"; |
View install-cudnn.py
#!/bin/sh | |
""" | |
Description: | |
Generate cudnn installation shell commands via python3 for Linux | |
Author: | |
Zhuo Zhang (imzhuo@foxmail.com) | |
2020.08.15 19:00:00 (Asia/Shanghai Time) |
View parse_mnist.cpp
/* | |
* Read mnist image and labels, save as bmp images | |
* | |
* Modified from https://stackoverflow.com/questions/8286668/how-to-read-mnist-data-in-c | |
* | |
* Compile: | |
* clang++ parse_mnist.cpp `pkg-config --libs --flags opencv4` | |
*/ | |
#include <iostream> |
View raw_nn.py
import numpy as np | |
from sklearn.datasets import load_iris | |
def softmax(inputs): | |
return np.exp(inputs) / np.sum(np.exp(inputs), 1)[:, None] | |
def construct_net(in_dim, out_dim, hidden_dim=20): | |
bound1 = np.sqrt(6.0 / (in_dim + hidden_dim)) |