Skip to content

Instantly share code, notes, and snippets.

View dvsseed's full-sized avatar
💭
I may be slow to respond.

曾令燊 dvsseed

💭
I may be slow to respond.
View GitHub Profile
@dvsseed
dvsseed / esp01_at.ino
Created December 13, 2017 03:59
To test the AT Commands for ESP-01 on Arduino IDE
#include <SoftwareSerial.h>
SoftwareSerial esp8266(4, 5);
void setup() {
Serial.begin(115200);
Serial.println("Arduino...OK");
esp8266.begin(115200);
// esp8266.write("AT+UART_DEF=9600,8,1,0,0\r\n");
delay(1500);
@dvsseed
dvsseed / alglib_svd.cpp
Created June 23, 2022 07:18
To get SVD with ALGLIB
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sys/time.h>
#include "ap.h"
#include "linalg.h"
using namespace std;
using namespace alglib;
@dvsseed
dvsseed / gsl_SVD.h
Created June 23, 2022 06:40
The header is for gsl_svd.cpp
#ifndef GSLSINGULARVALUEDECOMPOSITION_H
#define GSLSINGULARVALUEDECOMPOSITION_H
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_blas.h>
#include <gsl/gsl_linalg.h>
#include <gsl/gsl_errno.h>
@dvsseed
dvsseed / gsl_svd.cpp
Created June 23, 2022 06:39
To get SVD with GSL -- GNU Scientific Library
#include <stdio.h>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <sys/time.h>
#include <gsl/gsl_vector.h>
#include "gsl_SVD.h"
@dvsseed
dvsseed / eigen_svd.cpp
Created June 23, 2022 06:33
To get the SVD with Eigen C++ template library
#define EIGEN_USE_MKL_ALL
#define EIGEN_VECTORIZE_SSE4_2
#include <bits/stdc++.h>
#include <sys/time.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <exception>
@dvsseed
dvsseed / Dockerfile
Created June 21, 2022 12:43
Create a docker file for Ubuntu 20.04, CUDA 10.2, MiniConda, Python 3.10, PyTorch 1.11.0
# Define base image
# FROM nvidia/cuda:11.3.0-runtime-ubuntu20.04
# FROM nvidia/cuda:11.3.0-cudnn8-runtime-ubuntu20.04
# FROM nvidia/cuda:11.3.0-cudnn8-devel-ubuntu20.04
FROM nvidia/cuda:11.0.3-cudnn8-devel-ubuntu20.04
ENV PATH="/root/miniconda3/bin:${PATH}"
ARG PATH="/root/miniconda3/bin:${PATH}"
RUN sed -i 's/http:\/\/archive.ubuntu.com\/ubuntu/http:\/\/free.nchc.org.tw\/ubuntu/g' /etc/apt/sources.list
@dvsseed
dvsseed / matlab_svd.m
Last active June 21, 2022 11:17
To calculate SVD with MATLAB.
% Clear all text from the Command Window.
clc; clear all; close all;
fprintf('SVD -- start calculating...\n');
tic % 開始計時
% data importing
% data = 'LBPhistogram_BGC_20220609.csv';
% data = 'LBPhistogram_BRGC_20220609.csv';
@dvsseed
dvsseed / calc_flatten_entropy.cpp
Created January 26, 2022 13:00
To calculate the Conditional entropy and normalized the ResNet's Flatten layer values.
#include <bits/stdc++.h>
#include <sys/time.h>
#include <iostream>
#include <ctime>
#include <fstream>
#include <vector>
#include <sstream>
#include <map>
#include <algorithm>
#include <cmath>
@dvsseed
dvsseed / esp01_blink.ino
Created December 15, 2017 23:53
For ESP-01 blink sample on Arduino
@dvsseed
dvsseed / tool.py
Last active October 18, 2020 15:14
drag and drop this file to the CIRCUITPY directory
# Tools
import time
import board
import neopixel
dup = 37 # hyphen
# include audio libraries