あかすくぱるふぇ

同人サークル「あかすくぱるふぇ」のブログです。

2018年08月

from matplotlib import pyplot as plt
from sklearn import datasets

iris = datasets.load_iris()
data = iris['data']
target = iris['target']
feature_names = iris['feature_names']

colors = ['red', 'blue', 'green']
for c in range(len(colors)):
plt.scatter(data[target==c, 0], data[target==c, 1], color=colors[c])

plt.xlabel(feature_names[0])
plt.ylabel(feature_names[1])

plt.show()

# CUDA9, cudnn7のdocker imageを基本にする
FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04

# /rootをワークディレクトリにする
WORKDIR /root
ENV HOME /root

# 入力待ちをオフにする
ENV DEBIAN_FRONTEND noninteractive

# apt-get
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
unzip \
make \
git \
libssl-dev \
libbz2-dev \
libsqlite3-dev \
libreadline-dev \
zlib1g-dev
# pyenv
RUN git clone https://github.com/yyuu/pyenv.git ~/.pyenv
ENV PYENV_ROOT $HOME/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
RUN pyenv install 3.6.6
RUN pyenv global 3.6.6

# pip
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir \
tensorflow-gpu

# CUDA8, cudnn5のdocker imageを基本にする
FROM nvidia/cuda:8.0-cudnn5-devel-ubuntu16.04

# /rootをワークディレクトリにする
WORKDIR /root
ENV HOME /root

# 入力待ちをオフにする
ENV DEBIAN_FRONTEND noninteractive

# apt-get
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
unzip \
make \
git \
libssl-dev \
libbz2-dev \
libsqlite3-dev \
libreadline-dev \
zlib1g-dev \
graphviz \
tk-dev \
xdg-utils \
firefox
# pyenv
RUN git clone https://github.com/yyuu/pyenv.git ~/.pyenv
ENV PYENV_ROOT $HOME/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
RUN pyenv install 2.7.15
RUN pyenv global 2.7.15

# pip
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir \
numpy==1.11.0 \
h5py \
matplotlib \
scipy \
pyyaml \
easydict \
cython \
graphviz

# tensorflow
RUN pip install --no-cache-dir \
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl

# その他
ENV C_INCLUDE_PATH $HOME/.pyenv/versions/2.7.15/lib/python2.7/site-packages/numpy/core/include/:$C_INCLUDE_PATH

↑このページのトップヘ