This file contains hidden or 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 strict"; | |
// カリー化関数 | |
const func = x => y => z => x + y + z; | |
func(1)(2)(3); // きもい | |
// 不動点コンビネータ | |
// 参考: http://mew.org/~kazu/material/2012-id-const.pdf | |
const y_con = f => (x => y => f(x(x))(y)) |
This file contains hidden or 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
[==========] Running 3 tests from 1 test case. | |
[----------] Global test environment set-up. | |
[----------] 3 tests from CNN | |
[ RUN ] CNN.PropConv | |
[ OK ] CNN.PropConv (59 ms) | |
[ RUN ] CNN.PropPool | |
[ OK ] CNN.PropPool (0 ms) | |
[ RUN ] CNN.PropPoolRandom | |
[ OK ] CNN.PropPoolRandom (4 ms) | |
[----------] 3 tests from CNN (63 ms total) |
This file contains hidden or 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
// just FAIL | |
TEST(CNN, TotalPooling) | |
{ | |
const std::size_t pool = 2; | |
const std::size_t stride = 2; | |
const std::size_t input = 6; // NOTE: this means W_conv.rows(), output from convolution ply | |
const std::size_t output = (input / stride - pool + 1) * stride; // no overlap | |
const std::size_t batch = 2; | |
ASSERT_EQ(4, output); | |
This file contains hidden or 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
;; ======= | |
;; Haskell | |
;; ======= | |
(require 'auto-complete) | |
(require 'haskell-mode) | |
(require 'haskell-cabal) | |
(autoload 'ghc-init "ghc" nil t) |
This file contains hidden or 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 std.algorithm | |
auto deeper(T, U)(U[T][] records, U[][] maxElems) | |
{ | |
// こういうのはこうかけるが | |
auto maxRec = records.map!values.reduce!max; | |
// こういうのはこうかくしか | |
auto nextRecords = maxElems | |
.map!( |
This file contains hidden or 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
from math import log2 | |
from csv import reader | |
from collections import Counter | |
from sys import argv | |
def transpose(xx): | |
return map(list, zip(*xx)) | |
This file contains hidden or 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
#ifndef matrix_utils_hpp | |
#define matrix_utils_hpp | |
#include <vector> | |
#include <array> | |
#include <type_traits> | |
#include <fstream> | |
#include <boost/archive/xml_iarchive.hpp> | |
#include <boost/archive/xml_oarchive.hpp> |
This file contains hidden or 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
cmake_minimum_required(VERSION 2.8.4) | |
project(MyCMakeTemplate) | |
## Configure compiler and libraries : Boost | |
add_compile_options(-std=c++1y -Wall -Wextra) | |
include_directories(${PROJECT_SOURCE_DIR}/include) | |
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") |
This file contains hidden or 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
# built in | |
import random | |
# previous code | |
from sdr import to_sdr, to_real_number | |
# third library : https://github.com/pybrain/pybrain | |
from pybrain.structure import LinearLayer, SigmoidLayer, BiasUnit, FullConnection, RecurrentNetwork | |
from pybrain.datasets import SupervisedDataSet | |
from pybrain.supervised.trainers import BackpropTrainer |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Functions | |
function usage { | |
this=$(basename ${0}) | |
cat <<EOF | |
${this} is a tool for CMake and CTest | |
Usage: | |
${this} [command] [<options>] |