Skip to content

Commit 4aab159

Browse files
authored
Merge pull request #34 from cakirmuha/master
Dockerize
2 parents 0cd2681 + 6c4d3f1 commit 4aab159

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM ubuntu:16.04
2+
3+
ENV KERAS_BACKEND theano
4+
5+
RUN mkdir -p /tmp/setup && \
6+
apt-get update && \
7+
apt-get install -y --no-install-recommends \
8+
build-essential \
9+
git \
10+
python-dev \
11+
python-pip \
12+
python-setuptools \
13+
software-properties-common \
14+
wget \
15+
&& rm -rf /var/lib/apt/lists/*
16+
17+
RUN pip install --upgrade --user pip==9.0.3 && \
18+
pip install Theano==0.8.0 && \
19+
pip install keras==1.0.7 && \
20+
pip install h5py && \
21+
pip install numpy==1.11.0
22+
23+
WORKDIR /home
24+
CMD ["/bin/bash"]

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,41 @@ python NeuMF.py --dataset ml-1m --epochs 20 --batch_size 256 --num_factors 8 --l
4040

4141
Note on tuning NeuMF: our experience is that for small predictive factors, running NeuMF without pre-training can achieve better performance than GMF and MLP. For large predictive factors, pre-training NeuMF can yield better performance (may need tune regularization for GMF and MLP).
4242

43+
## Docker Quickstart
44+
Docker quickstart guide can be used for evaluating models quickly.
45+
46+
Install Docker Engine
47+
- [Ubuntu Installation](https://docs.docker.com/engine/installation/linux/ubuntu/)
48+
- [Mac OSX Installation](https://docs.docker.com/docker-for-mac/install/)
49+
- [Windows Installation](https://docs.docker.com/docker-for-windows/install/)
50+
51+
Build a keras-theano docker image
52+
```
53+
docker build --no-cache=true -t ncf-keras-theano .
54+
```
55+
56+
### Example to run the codes with Docker.
57+
Run the docker image with a volume (Run GMF):
58+
```
59+
docker run --volume=$(pwd):/home ncf-keras-theano python GMF.py --dataset ml-1m --epochs 20 --batch_size 256 --num_factors 8 --regs [0,0] --num_neg 4 --lr 0.001 --learner adam --verbose 1 --out 1
60+
```
61+
62+
Run the docker image with a volume (Run MLP):
63+
```
64+
docker run --volume=$(pwd):/home ncf-keras-theano python MLP.py --dataset ml-1m --epochs 20 --batch_size 256 --layers [64,32,16,8] --reg_layers [0,0,0,0] --num_neg 4 --lr 0.001 --learner adam --verbose 1 --out 1
65+
```
66+
67+
Run the docker image with a volume (Run NeuMF -without pre-training):
68+
```
69+
docker run --volume=$(pwd):/home ncf-keras-theano python NeuMF.py --dataset ml-1m --epochs 20 --batch_size 256 --num_factors 8 --layers [64,32,16,8] --reg_mf 0 --reg_layers [0,0,0,0] --num_neg 4 --lr 0.001 --learner adam --verbose 1 --out 1
70+
```
71+
72+
Run the docker image with a volume (Run NeuMF -with pre-training):
73+
```
74+
docker run --volume=$(pwd):/home ncf-keras-theano python NeuMF.py --dataset ml-1m --epochs 20 --batch_size 256 --num_factors 8 --layers [64,32,16,8] --num_neg 4 --lr 0.001 --learner adam --verbose 1 --out 1 --mf_pretrain Pretrain/ml-1m_GMF_8_1501651698.h5 --mlp_pretrain Pretrain/ml-1m_MLP_[64,32,16,8]_1501652038.h5
75+
```
76+
* **Note**: If you are using `zsh` and get an error like `zsh: no matches found: [64,32,16,8]`, should use `single quotation marks` for array parameters like `--layers '[64,32,16,8]'`.
77+
4378
### Dataset
4479
We provide two processed datasets: MovieLens 1 Million (ml-1m) and Pinterest (pinterest-20).
4580

@@ -56,4 +91,4 @@ test.negative
5691
- Each line corresponds to the line of test.rating, containing 99 negative samples.
5792
- Each line is in the format: (userID,itemID)\t negativeItemID1\t negativeItemID2 ...
5893

59-
Last Update Date: August 2, 2017
94+
Last Update Date: December 23, 2018

0 commit comments

Comments
 (0)