Skip to content

Instantly share code, notes, and snippets.

@olanleed
olanleed / LICENSE
Last active May 24, 2026 11:37
Nagi Review Delta
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
@olanleed
olanleed / constexpr_autodiff.cpp
Created November 6, 2025 14:43
コンパイル時自動微分
#include <array>
#include <cstdint>
#include <iostream>
namespace ad {
constexpr uint16_t NO = 0xFFFF;
enum class Op : uint8_t {
Var,
import numpy as np
import time
from scipy.optimize import rosen
class NelderMead:
def __init__(self, f, x_0, verbose=False,
options={"max_iter": 600,
"step": 0.5,
"stopfitness": 0.0001,
"r_s": 0.5,
import argparse
import numpy as np
from sklearn.datasets import load_svmlight_files
class AROW:
def __init__(self, dim, r):
self.dim = dim
self.r = r
import std.stdio;
import std.math;
import std.algorithm;
//正規分布の下側累積確率
auto p_nor(immutable double z)
in {
assert(z >= 0.0 && z <= 3.09);
}
out(probability) {