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
use std::collections::HashMap; | |
use std::time::Instant; | |
use candle_core::{backprop::GradStore, DType, Device, Result, TensorId, Var}; | |
use candle_nn::{init::DEFAULT_KAIMING_NORMAL, Optimizer, VarBuilder, VarMap, SGD}; | |
#[derive(Debug)] | |
pub struct MySGD { | |
vars: HashMap<TensorId, Var>, | |
learning_rate: f64, |
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
const {BskyAgent, RichText, AppBskyFeedPost} = require("@atproto/api") | |
let Parser = require('rss-parser') | |
let parser = new Parser() | |
const entities = require("entities"); | |
const sleep = (waitTimeInMs) => new Promise(resolve => setTimeout(resolve, waitTimeInMs)); | |
const settings = [ | |
{ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
node(sendai;ishinomaki;shiogama;kesennuma;shiroishi;natori;kakuda;tagajyo;iwanuma;tome;kurihara;higashimatsushima;oosaki;zaou;shichikasyuku;oogawara;murata;shibata;kawasaki;marumori;watari;yamamoto;matsushima;shichigahama;rifu;taiwa;oosato;tomiya;oohira;shikama;kami;wakuya;misato;onagawa;minamisanriku). | |
edge(sendai,natori). edge(sendai,tagajyo). edge(sendai,tomiya). edge(sendai, murata). edge(sendai, kawasaki). edge(sendai, shichigahama). edge(sendai, rifu). edge(sendai, taiwa). edge(sendai, shiki). | |
edge(ishinomaki, tome). edge(ishinomaki, higashimatsushima). edge(ishinomaki, wakuya). edge(ishinomaki, misato). edge(ishinomaki, onagawa). edge(ishinomaki, minamisanriku). | |
edge(shiogama, tagajyo). edge(shiogama, shichigahama). edge(shiogama, rifu). | |
edge(kesennuma, tome). edge(kesennuma, minamisanriku). | |
edge(shiroishi, kakuda). edge(shiroishi, zaou). edge(shiroishi, shichikasyuku). edge(shiroishi, oogawara). edge(shiroishi, marumori). | |
edge(natori, sendai). edge(natori, kesennuma). edge(natori, murata). | |
edge(kaku |
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 <vector> | |
#include <cstdio> | |
#include <iomanip> | |
#include <algorithm> | |
#include <cmath> | |
#include <map> | |
#include <cassert> | |
#include <queue> | |
#include <set> |
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
// | |
// Held and Karp bound | |
// | |
// T が 1-tree iff T は {2,...,n} 上の全域木 + 1 から枝が 2 本. | |
// 1-tree かつ全部の頂点の誘導次数が 2 であればそれはサイクル. | |
// | |
// 巡回セールス人を | |
// minimize c(T) | |
// subject to T is a 1-tree | |
// deg_T(i) = 2 for all i |
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 <vector> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <map> | |
#include <cmath> | |
#include <cstring> | |
#include <functional> | |
#include <algorithm> | |
#include <unordered_map> |
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
\documentclass{article} | |
\usepackage{tikz} | |
\usetikzlibrary{positioning,arrows,calc} | |
\usepackage{pgfplots} | |
\begin{document} | |
%%% | |
\tikzstyle{node}=[draw=black,circle,inner sep=0,minimum size=10] | |
\def \nodes { | |
1/-5/8.6, |
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 <vector> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <map> | |
#include <cmath> | |
#include <cstring> | |
#include <functional> | |
#include <algorithm> | |
#include <unordered_map> |
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
// | |
// Vantage Point Tree (vp tree) | |
// | |
// each node has two childs, left and right; | |
// the left childs are closer than the threshold, | |
// and the right childs are farther than the thoreshold. | |
// | |
#include <iostream> | |
#include <vector> | |
#include <cstdio> |
NewerOlder