Skip to content
Snippets Groups Projects
Commit 10d0f1b2 authored by Guillaume HEUSCH's avatar Guillaume HEUSCH
Browse files

MERGE: some remanining stuff from 1-no-need-to-have-macos-builds

parent c2321db1
Branches
Tags
No related merge requests found
Pipeline #
# This build file uses template features from YAML so it is generic enough for
# any Bob project. Don't modify it unless you know what you're doing.
# Definition of global variables (all stages)
variables:
CONDA_ROOT: "${CI_PROJECT_DIR}/miniconda"
# Definition of our build pipeline order
stages:
- build
- deploy
- pypi
# Build targets
.build_template: &build_job
stage: build
before_script:
- mkdir _ci
- curl --silent "https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/install.sh" > _ci/install.sh
- chmod 755 _ci/install.sh
- ./_ci/install.sh _ci master #installs ci support scripts
- ./_ci/before_build.sh
script:
- ./_ci/build.sh
after_script:
- ./_ci/after_build.sh
cache: &build_caches
paths:
- miniconda.sh
- ${CONDA_ROOT}/pkgs/*.tar.bz2
- ${CONDA_ROOT}/pkgs/urls.txt
.build_linux_template: &linux_build_job
<<: *build_job
tags:
- docker
image: continuumio/conda-concourse-ci
artifacts:
expire_in: 1 week
paths:
- _ci/
- ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
cache:
<<: *build_caches
key: "linux-cache"
.build_macosx_template: &macosx_build_job
<<: *build_job
tags:
- macosx
artifacts:
expire_in: 1 week
paths:
- _ci/
- ${CONDA_ROOT}/conda-bld/osx-64/*.tar.bz2
cache:
<<: *build_caches
key: "macosx-cache"
build_linux_27:
<<: *linux_build_job
variables:
PYTHON_VERSION: "2.7"
build_linux_36:
<<: *linux_build_job
variables:
PYTHON_VERSION: "3.6"
BUILD_EGG: "true"
artifacts:
expire_in: 1 week
paths:
- _ci/
- dist/*.zip
- sphinx
- ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
build_macosx_27:
<<: *macosx_build_job
variables:
PYTHON_VERSION: "2.7"
build_macosx_36:
<<: *macosx_build_job
variables:
PYTHON_VERSION: "3.6"
# Deploy targets
.deploy_template: &deploy_job
stage: deploy
before_script:
- ./_ci/install.sh _ci master #updates ci support scripts
script:
- ./_ci/deploy.sh
dependencies:
- build_linux_27
- build_linux_36
- build_macosx_27
- build_macosx_36
tags:
- deployer
deploy_beta:
<<: *deploy_job
environment: beta
only:
- master
deploy_stable:
<<: *deploy_job
environment: stable
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- branches
pypi:
stage: pypi
environment: pypi
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- branches
before_script:
- ./_ci/install.sh _ci master #updates ci support scripts
script:
- ./_ci/pypi.sh
dependencies:
- build_linux_36
tags:
- deployer
......@@ -6,7 +6,6 @@ import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torchvision.utils as vutils
import bob.core
......@@ -21,7 +20,7 @@ class CNNTrainer(object):
Attributes
----------
network: :py:class: torch.nn.Module
network: :py:class:`torch.nn.Module`
The network to train
batch_size: int
The size of your minibatch
......@@ -37,7 +36,7 @@ class CNNTrainer(object):
Parameters
----------
network: :py:class: torch.nn.Module
network: :py:class:`torch.nn.Module`
The network to train
batch_size: int
The size of your minibatch
......@@ -73,7 +72,7 @@ class CNNTrainer(object):
start_iteration: int
The iteration to start with
losses: list
The list of losses wfrom previous training
The list of losses from previous training
"""
......@@ -121,13 +120,13 @@ class CNNTrainer(object):
Parameters
----------
dataloader: :py:class:: torch.utils.data.DataLoader
dataloader: :py:class:`torch.utils.data.DataLoader`
The dataloader for your data
n_epochs: int
The number of epochs you would like to train for
learning_rate: float
The learning rate for SGD optimizer
output_dir: path
The learning rate for SGD optimizer.
output_dir: str
The directory where you would like to save models
"""
......
py:class torch.nn.modules.module.Module
py:class torch.utils.data.dataset.Dataset
===========
User guide
===========
As the name suggest, this package makes heavy use of pytorch_, so make sure you have it installed on your environment.
It also relies on bob_ (and in particular for I/O and databases interfaces), so you may want to refer
to their respective documentation as well.
Anatomy of the package
----------------------
This package is basically organized as follows (some files are omitted for clarity purposes):
.. code-block:: text
bob/
+-- learn/
+-- pytorch/
+-- architectures/
+-- CNN8.py
+-- CASIANet.py
+-- ...
+-- datasets/
+-- casia_webface.py
+-- fargo.py
+-- multipie.py
+-- ...
+-- scripts/
+-- train_cnn.py
+-- ...
+-- trainers/
+-- CNNTrainer.py
+ ``architectures`` contains files defining the different network architectures. The network is defined as a derived class of ``torch.nn.Module`` and must contain a ``forward`` method.
See for instance the simple examples provided in `PyTorch documentation <https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html>_`.
+ ``datasets`` contains files implementing datasets as ``torch.utils.data.DataSet``,
and some utility functions (wrapper around torch.transforms for instance)
+ ``scripts`` contains the various scripts to perform training.
+ ``trainers`` contains files implementing the different training procedure
.. _bob: http://idiap.github.io/bob/
.. _pytorch: http://pytorch.org/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment