The configuration is the following.
node00: Grid master. This node has the alias namegrid.- others: Grid execution nodes.
Make sure Java is available in all nodes (via default-jre package).
Running a tutorial docker image.
docker run -it --rm -p 8888:8888 caffe2ai/caffe2:c2v0.8.1.cpu.full.ubuntu14.04 \
sh -c "jupyter notebook --no-browser --ip 0.0.0.0 --allow-root /caffe2/caffe2/python/tutorials"--rm option deletes the docker instance after exits. Remove --rm if needed to interrupt the session.| # Tasks to maintain python package. | |
| # | |
| # See https://packaging.python.org/tutorials/distributing-packages/ | |
| test: | |
| tox | |
| upload: | |
| python setup.py bdist_wheel --universal | |
| twine upload dist/* |
| """ | |
| Use in PyTorch. | |
| """ | |
| def accuracy(output, target): | |
| """Computes the accuracy for multiple binary predictions""" | |
| pred = output >= 0.5 | |
| truth = target >= 0.5 | |
| acc = pred.eq(truth).sum() / target.numel() | |
| return acc |