This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.special import expit | |
import math | |
EPS = 1e-9 | |
MAX_EXP = 709 | |
def softmax(x): | |
exp_x = np.exp(x - np.max(x)) | |
return exp_x / exp_x.sum() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import argparse | |
smallPrimeList = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, | |
61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, | |
149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, | |
233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, | |
331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, | |
431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, | |
523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* DIV Module */ | |
library IEEE; | |
use IEEE.STD_LOGIC_1164.ALL; | |
use WORK.INCLUDE.ALL; | |
entity DIV is | |
Port ( rst: in STD_LOGIC; -- Reset | |
clk: in STD_LOGIC; -- Clock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- to be continued... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdio> | |
#include <ctime> | |
#include <iomanip> | |
using namespace std; | |
int main() | |
{ | |
// 你好,世界! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. 一些基本定义 | |
typedef cv::Vec3b Color; | |
typedef cv::Mat_<Color> Image; | |
Image img; // 要处理的那张图 | |
struct MouseArgs // 用于和回调函数交互,至于为什么要特意攒一个struct后面会讲~ | |
{ | |
Image &img; // 显示在窗口中的那张图 | |
std::vector<std::vector<int>> &mask; // 用户绘制的选区(删除/保留) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% !Mode:: "TeX:UTF-8" | |
\documentclass{article} | |
\usepackage[hyperref, UTF8]{ctex} | |
\usepackage[dvipsnames]{xcolor} | |
\usepackage{geometry} | |
\usepackage{amsmath} | |
\usepackage{amsfonts} | |
\usepackage{listings} | |
\usepackage{pgfplotstable} | |
\usepackage{pgfplots} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <iostream> | |
#include <opencv2/opencv.hpp> | |
#include <cmath> | |
using namespace std; | |
using namespace cv; | |
const int width = 1500, height = 1500; | |
const Vec3b BLACK(0, 0, 0), WHITE(255, 255, 255), BLUE(255, 0, 0), |