Skip to content

Instantly share code, notes, and snippets.

View tuxedocat's full-sized avatar
🐈‍⬛
WFH with cats

yu-s tuxedocat

🐈‍⬛
WFH with cats
View GitHub Profile
@tuxedocat
tuxedocat / Dockerfile
Last active June 14, 2018 09:12
Example of dockerfile (with user and group id)
# Base Image
ARG CUDA_VER=9.0
ARG CUDNN_VER=7
ARG DISTRIBUTION=ubuntu16.04
FROM nvidia/cuda:${CUDA_VER}-cudnn${CUDNN_VER}-devel-${DISTRIBUTION}
# System
RUN apt-get update && \
apt-get install -y \
build-essential \
@tuxedocat
tuxedocat / Pipfile
Last active June 11, 2018 02:27
pipenvの紹介。
[[source]]
name = "pypi"
verify_ssl = true
url = "https://pypi.python.org/simple"
[dev-packages]
yapf = "*"
pytest = "*"
bpython = "*"
@tuxedocat
tuxedocat / 00-PyCharm-source-root-named-code.md
Last active February 13, 2018 14:01
[IDEA/PyCharm] If you make "code" directory as a package, you'll waste some minutes to figure out...

TLDR

  • In IntelliJ IDEA/PyCharm, debugger won't work in the package named "code".
  • Better not to name source-root directory "code".

When code dir is a package (see ng.png below), you'll get following error when starting debug tool shown in the image (ng-log.png).

Remove __init__.py from code dir (ok.png).

@tuxedocat
tuxedocat / Dockerfile
Created December 21, 2017 06:05
nvidia-docker2 + (PyTorch on Cuda9.0, cuDNN7)
ARG cuda_version=9.0
ARG cudnn_version=7
ARG distribution=ubuntu16.04
FROM nvidia/cuda:${cuda_version}-cudnn${cudnn_version}-devel-${distribution}
RUN apt-get update && apt-get install -y \
wget \
git \
libhdf5-dev \
g++ \
@tuxedocat
tuxedocat / Dockerfile
Created December 21, 2017 06:04
nvidia-docker2 + Keras
ARG cuda_version=8.0
ARG cudnn_version=6
ARG distribution=ubuntu16.04
FROM nvidia/cuda:${cuda_version}-cudnn${cudnn_version}-devel-${distribution}
RUN apt-get update && apt-get install -y \
wget \
git \
libhdf5-dev \
g++ \
@tuxedocat
tuxedocat / nlp-for-language-learning.md
Last active November 21, 2017 00:31
https://log.tuxedokatze.com/bookreview-nlp-for-language-learning/ (Hugo用のMarkdownなので、ここだと表示が崩れる…)

+++ textlint = "" title = "『語学学習支援のための言語処理』を読みました。" date = "2017-11-22" slug = "bookreview-nlp-for-language-learning" tags = ["book", "nlp", "review"] categories = ["Research", "Book"] aliases = ["/bookreview-nlp-for-language-learning/"] draft = true +++

@tuxedocat
tuxedocat / .textlintrc
Created November 2, 2017 07:09
textlintの設定(ほとんど技術書用プリセットと同じ)
{
"rules": {
"max-comma": {
"max": 3
},
"sentence-length": {
"max": 90
},
"no-mix-dearu-desumasu": {
"preferInHeader": "",
@tuxedocat
tuxedocat / jaft.py
Last active November 7, 2017 02:03
日本語のFastTextモデルを Torchtextで使いたかった.
from torchtext.vocab import Vectors
class JaFastText(Vectors):
def __init__(self, name=None, **kwargs):
super(JaFastText, self).__init__(name, url=None, **kwargs)
fasttext = JaFastText(name='model.vec')
@tuxedocat
tuxedocat / GPU-memory-quota-KerasTF.ipynb
Created August 23, 2017 06:20
Minimal example for setting the limit of GPU memory usage when using Keras+TF
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tuxedocat
tuxedocat / marp_slide.md
Created July 4, 2017 02:25
Slide template for Marp
<style> * { font-family: "Noto Sans JP", sans-serif; font-weight: lighter; } </style>