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 chainer | |
import chainer.functions as F | |
import chainer.links as L | |
from chainer import training | |
import numpy as np | |
class MLP(chainer.Chain): | |
def __init__(self): | |
super(MLP, self).__init__( |
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 chainer | |
import chainer.computational_graph as c | |
import chainer.functions as F | |
import chainer.links as L | |
import numpy as np | |
# Network definition | |
class MLP(chainer.Chain): |
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 chainer | |
cupy = chainer.cuda.cupy | |
def profile(target): | |
target() # sometime first call is slow. | |
start = cupy.cuda.Event() | |
end = cupy.cuda.Event() | |
start.record() |
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 time | |
import chainer | |
import numpy as np | |
cupy = chainer.cuda.cupy | |
def performance_check(n_runs, fortran=False, cudnn=True): | |
ts = [] | |
for i in range(n_runs + 1): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import time | |
import json | |
import pycurl | |
import StringIO | |
import urllib | |
import codecs |
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
# coding: utf-8 | |
from flask import Flask | |
from flask.ext.sqlalchemy import SQLAlchemy | |
app = Flask(__name__) | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///a.db' | |
db = SQLAlchemy(app) | |
''' Model Classes ''' |
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 std.stdio, std.string, std.conv; | |
import std.algorithm, std.array, std.bigint, std.math, std.range, std.typecons; | |
import core.stdc.stdlib; | |
string readToken() { | |
static string[] tokens; | |
static int tokenId = 0; | |
for (; tokenId == tokens.length; ) { | |
if (stdin.eof) exit(0); | |
tokens = readln.split, tokenId = 0; |
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 <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
#include <cmath> | |
#include <string> | |
#include <vector> | |
#include <queue> | |
#include <map> | |
#include <set> | |
#include <algorithm> |
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 <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
#include <cmath> | |
#include <string> | |
#include <vector> | |
#include <queue> | |
#include <map> | |
#include <set> | |
#include <algorithm> |
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 <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
#include <cmath> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
typedef long long ll; | |
const double PI = acos(-1.0), EPS = 1e-8; |
NewerOlder