Skip to content

Instantly share code, notes, and snippets.

View nojima's full-sized avatar
o_O

Yusuke Nojima nojima

o_O
View GitHub Profile
format = """
$time\
$username\
$hostname\
$directory\
$git_branch\
$git_state\
$git_status\
$cmd_duration\
$line_break\
@nojima
nojima / main.rs
Last active July 27, 2022 01:05
hyper + openssl で HTTPS server を立てる example
[package]
name = "ssl-exp"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
hyper = { version = "0.14", features = ["full"] }
tokio = { version = "1", features = ["full"] }
\documentclass[dvipdfmx,uplatex]{jsarticle}
\usepackage{tikz}
\usetikzlibrary{intersections, calc, arrows.meta, angles, quotes}
\usepackage{tkz-euclide}
\newcommand{\axis}[1]{\mathrm{#1}}
\begin{document}
\begin{tikzpicture}

焼きなまし法

  • 世の中に存在する組み合わせ最適化問題は効率的なアルゴリズムが存在しない場合も多い。

    • SAT

    • 巡回セールスマン問題

    • 負の長さの閉路を持つグラフに対する最短経路問題

    • オセロ

    • ぷよぷよ

  • 有名な問題の場合は専用のソルバーが開発されている場合もあるがマイナーな問題の場合、専用ソルバーは存在しない

  • メタヒューリスティクス

Shader "Unlit/TextureMapping" {
Properties {
_Texture("Texture", 2D) = "white" {}
_AmbientReflectance("Ambient Reflection Constant", Range(0, 1)) = 0.1
_DiffuseReflectance("Diffuse Reflection Constant", Range(0, 1)) = 0.7
_SpecularReflectance("Specular Reflection Constant", Range(0, 1)) = 0.2
_Shininess("Shininess", Float) = 20.0
}
SubShader {
Tags { "Queue"="Geometry" "RenderType"="Opaque" }
Shader "Unlit/Phong" {
Properties {
_BaseColor("Base Color", Color) = (0.8, 0.0, 0.0, 1.0)
_AmbientReflectance("Ambient Reflection Constant", Range(0, 1)) = 0.1
_DiffuseReflectance("Diffuse Reflection Constant", Range(0, 1)) = 0.7
_SpecularReflectance("Specular Reflection Constant", Range(0, 1)) = 0.2
_Shininess("Shininess", Float) = 20.0
}
SubShader {
Tags { "Queue"="Geometry" "RenderType"="Opaque" }
@nojima
nojima / main.go
Created August 7, 2018 05:43
Go で構造体のフィールド一覧をリフレクションで取得する
package main
import (
"reflect"
"fmt"
)
type Hoge struct {
Hello string
World string
package com.example.demo
import org.springframework.boot.CommandLineRunner
import org.springframework.boot.SpringBootConfiguration
import org.springframework.boot.autoconfigure.AutoConfigurationPackages
import org.springframework.boot.autoconfigure.ImportAutoConfiguration
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
In [1]: %load_ext autoreload
In [2]: %autoreload 2
In [3]: from stan_lda import *
In [4]: import os
In [5]: os.environ['CC'] = 'gcc-4.8'
@nojima
nojima / _note.md
Last active October 10, 2017 16:43

EncoderDecoder による日英翻訳の結果です。

  • JA, EN: test set に含まれる対訳
  • ED+Greedy: 普通の EncoderDecoder
  • ED+Beam: 予測に beam search を使った EncoderDecoder
  • ED+Atn+Greedy: Attention 付きの EncoderDecoder
  • ED+Atn+Beam: 予測に beam search を使った Attention 付きの EncoderDecoder
  • 訳文の前にある数字は BLEU の値

JA と EN は Tatoeba の例文を利用しました。