Skip to content

Instantly share code, notes, and snippets.

View zchrissirhcz's full-sized avatar

Zhuo Zhang zchrissirhcz

  • HangZhou, China
  • 07:43 (UTC +08:00)
View GitHub Profile
#!/usr/bin/env bash
#
# 首先,请安装 llvm 套件
# 查看: https://apt.llvm.org/
# 例如 ubuntu 22.04, 执行:
# wget https://apt.llvm.org/llvm.sh
# 查看文件 llmv.sh 内容, 看到稳定版是 19
# 执行安装:
# chmod +x llvm.sh
# sudo ./llvm.sh all
@zchrissirhcz
zchrissirhcz / versions.md
Last active March 21, 2025 14:42
Ubuntu Distro GCC GLIBC GLIBCXX C++-Standard versions
@zchrissirhcz
zchrissirhcz / AD.py
Created November 11, 2021 10:26 — forked from MarisaKirisame/AD.py
import math
def sin(x):
if isinstance(x, Dual):
return Dual(sin(x.x), cos(x.x) * x.dx)
return math.sin(x)
def cos(x):
if isinstance(x, Dual):
return Dual(cos(x.x), -1 * sin(x.x) * x.dx)
@zchrissirhcz
zchrissirhcz / read_txt_line_by_line.c
Created August 18, 2020 14:58
Read text file line by line, implemented in 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";
@zchrissirhcz
zchrissirhcz / install-cudnn.py
Last active August 15, 2020 11:28
Generate cudnn installation shell commands via python3 for Linux
#!/bin/sh
"""
Description:
Generate cudnn installation shell commands via python3 for Linux
Author:
Zhuo Zhang ([email protected])
2020.08.15 19:00:00 (Asia/Shanghai Time)
@zchrissirhcz
zchrissirhcz / parse_mnist.cpp
Last active May 14, 2022 08:38
Parsing MNIST data, save as bmp images
/*
* 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>
@zchrissirhcz
zchrissirhcz / raw_nn.py
Last active June 10, 2020 08:01 — forked from borgwang/raw_nn.py
backpropagation with numpy
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))