Skip to content

Instantly share code, notes, and snippets.

@threecourse
threecourse / CSharpCompileRun.ps1
Created December 8, 2013 03:13
PowershellからC#コードをコンパイル・実行するサンプル
# ---------------------------------------------------------------------
# PowershellからC#コードをコンパイル・実行するサンプル
#
# (参考)
# http://codezine.jp/article/detail/5007
#
# (注意点)
# .NET Frameworkの制約上、Add-Typeによる型の追加を再実行するには、Powershellのセッションを切る必要がある。
# そのため、Powershellのプロセスを立ち上げ、その中でコンパイル・実行するようにしている。
# ---------------------------------------------------------------------
@threecourse
threecourse / dockerfile-kag0
Created December 18, 2019 07:06
GUIを使うためのdocker設定
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
# reference: https://hub.docker.com/r/nejumi/tools_for_kaggle/dockerfile
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:git-core/ppa && \
apt-get update && \
apt-get install -y git build-essential cmake && \
git --version
@threecourse
threecourse / integrate.py
Created March 15, 2019 15:18
分かれたファイルを一つに統合するスクリプト(C#コード用)
import numpy as np
import pandas as pd
if __name__ == "__main__":
import glob
files = glob.glob("src/*")
print(files)
ls_using = []
ls_main = []
@threecourse
threecourse / init.sh
Last active October 29, 2017 12:27
ubuntu environment setting
#!/bin/bash
# utils
cd ~/
mkdir proj lib
sudo apt-get update
sudo apt-get install -y git build-essential libatlas-base-dev
sudo apt-get install -y python3-dev
git config --global credential.helper 'cache --timeout=3600'
git config --global user.email "xxxx@xxxx.com"
from util_log import Logger
logger = Logger()
from collections import OrderedDict
logger.info("run started")
d = OrderedDict([('run_name', "xgb_1"), ('fold', 0), ('logloss', 0.66)])
logger.result_ltsv_time(d)
@threecourse
threecourse / dqn_keras.py
Created February 1, 2017 14:03
dqn_keras_cartpole
# coding:utf-8
# args
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--test", action="store_true")
parser.add_argument("--prms", type=int, action="store", default=0)
args = parser.parse_args()
TEST = args.test
@threecourse
threecourse / alexnet_inference.py
Last active May 11, 2016 14:24 — forked from nervetumer/alexnet_inference.py
example of running inference on an image using neon
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@threecourse
threecourse / _spot_request.md
Last active March 2, 2016 17:17
request spot instance by python

spot_request.py

  • request spot instance
  • wait for running
  • print IP address

aws_run.py

  • rsync
  • nohup run command
# 質問 -----------------------------------------------------------------------------------
#
# ・ Generalized Linear Models for Insurance Dataが無料公開されているとお聞きしたのですが、
# 有料のものしか見つけられませんでした。
# ⇒無くなったらしい。残念。
#
# ・ 関数Cでcontrast matrixというものを指定し、因子の基準を指定できるようなのですが、
#  どうも上手くいかないようで、テキストと異なる係数になりました。
# (Model_EとModel_E2 参照)
# ⇒チーム内メンバーで、Model_EとModel_E2が同じ係数となる人、違う係数となる人がいるようで、
# 適切なカレントディレクトリを設定した上で、このスクリプトを実行下さい。
# .NET Frameworkのカレントディレクトリをセット
[IO.Directory]::SetCurrentDirectory((Get-Location).ProviderPath)
# ユーティリティ関数の読み込み
. .\textmanip.ps1
# テスト用フォルダの作成
TestFileCreate "test sample1\1.txt" 1000