🏃♂️
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from chainer import Variable | |
from chainer import functions as F | |
# Pixel shuffle used in sub-pixel convolutions, in Chainer | |
# https://arxiv.org/pdf/1609.05158v2.pdf | |
# | |
# Example: | |
# Scaling factor: 3 | |
# In shape: (1, 9, 4, 4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from chainer import Variable | |
from chainer import links as L | |
import numpy as np | |
# Compare single-channel Convolution2D with Deconvolution2D | |
h = 128 | |
w = 128 | |
x = np.arange(h * w, dtype=np.float32) | |
x = x.reshape(1, 1, h, w) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import numpy | |
import chainer | |
import chainer.functions as F | |
import chainer.links as L | |
from chainer import training | |
from chainer.training import extensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/python/cpython/blob/master/Lib/profile.py | |
def _show(self, prof, filename, sort): | |
if filename is not None: | |
# NOTE(hvy): Replace environment variables similar to how | |
# nvprof does by e.g. replacing out_%q{MV2_COMM_WORLD_RANK} with | |
# out_1, out_2, etc. depending on the value of the variable | |
# MV2_COMM_WORLD_RANK | |
import re | |
if re.search(r'\%q{(.*?)\}', filename) is not None: | |
filename = re.sub(r'\%q{(.*?)\}', |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started by upstream project "chainer/chainer_pr" build number 333 | |
originally caused by: | |
GitHub pull request #6441 of commit 87e4eb6f662973b13d7b565c55a6ad71982fb283, no merge conflicts. | |
Building remotely on gpcl-gpu205 (mn1-p100 sakura11) in workspace /home/jenkins-external-slave/workspace/chainer/chainer_pr/TEST/CHAINERX_misc/label/mn1-p100 | |
using credential 40bb97f1-7bf9-4f59-b66e-8d81d634b1a9 | |
Wiping out workspace first. | |
Cloning the remote Git repository | |
Cloning repository [email protected]:chainer/chainer-test.git | |
> git init /home/jenkins-external-slave/workspace/chainer/chainer_pr/TEST/CHAINERX_misc/label/mn1-p100 # timeout=10 | |
Fetching upstream changes from [email protected]:chainer/chainer-test.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Optuna example that optimizes a simple quadratic function in parallel using `joblib` allowing | |
arbitrary arguments to the objective function. | |
Run the example as follows. | |
$ python quadratic_joblib_simple.py | |
If you need to rerun the example and thus delete previous studies, you can use the Optuna CLI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Add `_` prefix to the names of private interfaces. | |
Interfaces in `optuna`, i.e. submodules, classes and attributes are either public, private for internal use in `optuna` or private for internal use within a parcitular class. Private interfaces are not part of the public API and are not expected to be directly used by the library user. They are only meant for internal use in `optuna`. This reserves them for future changes and allows modifications without breaking compatibility. It is therefore important to clearly communciate whether an interfaces is public or private and `optuna` distinigushes between them as follows. | |
Reference: https://docs.python.org/3/tutorial/classes.html#private-variables. | |
### Good | |
```python | |
def public_function(): # Used by users. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import threading | |
import time | |
import joblib | |
import tqdm | |
class TqdmLoggingHandler(logging.StreamHandler): | |
def emit(self, record): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import OrderedDict | |
import time | |
from matplotlib import pyplot as plt | |
import optuna | |
from optuna import samplers | |
from optuna.storages import RDBStorage | |
from optuna.storages import RedisStorage | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Plots importances evaluated by fANOVA (AutoML.org) and Fanova (sklearn based implementation). | |
1. Loads data from csv containing parameter configuration-objective value pairs. | |
2. Loads search space definitions from csv. | |
3. Evaluates all single and pairwise importances between parameters. | |
4. Repeats evaluation N times (with different random seeds). | |
5. Plots the average over N evaluations. | |
""" | |
import argparse |
OlderNewer