This file contains hidden or 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 nvidia/cuda:10.0-cudnn7-devel | |
| RUN apt-get update -y && \ | |
| apt-get install -y --no-install-recommends \ | |
| python3-dev \ | |
| python3-pip \ | |
| python3-wheel \ | |
| python3-setuptools \ | |
| git \ | |
| cmake \ |
This file contains hidden or 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 typing | |
| import chainer | |
| from chainer import functions | |
| from chainer import links | |
| from chainer import types | |
| class AttentionAugmentedConvolution2D(chainer.Chain): |
This file contains hidden or 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 swift:5.0.1-xenial | |
| # Install git, process tools | |
| RUN rm -rf /var/lib/apt/lists/* \ | |
| && apt-get update -y \ | |
| && apt-get -y --no-install-recommends install \ | |
| git \ | |
| procps \ | |
| aria2 \ | |
| libsqlite3-dev \ |
This file contains hidden or 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
| #include <algorithm> | |
| #include <iostream> | |
| #include <vector> | |
| int * func1(int * x, int n) { | |
| // for (int i = 0; i < ++n; ++i) { | |
| for (int i = 0; i < n; ++i) { | |
| std::cout << "i = " << i << ", x = " << x << std::endl; | |
| ++(*(x++)); |
This file contains hidden or 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
| // /Library/Developer/Toolchains/swift-tensorflow-DEVELOPMENT-2019-06-17-a.xctoolchain | |
| import TensorFlow | |
| public struct SNConv2D<Scalar: TensorFlowFloatingPoint>: Layer { | |
| // Avoid below errors: | |
| // TensorFlow.Layer:2:20: note: protocol requires nested type 'Input'; do you want to add it? | |
| // TensorFlow.Layer:3:20: note: protocol requires nested type 'Output'; do you want to add it? | |
| public typealias Input = Tensor<Scalar> |
This file contains hidden or 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
| /* | |
| * Introduction to Curiously Recurring Template Pattern | |
| * | |
| * Ref: https://theolizer.com/cpp-school2/cpp-school2-19/ | |
| */ | |
| #include <iostream> | |
| #include <iomanip> | |
| #include <cstdint> | |
| #include <tuple> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| # data: fastai's DataBunch | |
| def objective(trial: optuna.Trial): | |
| num_layers = trial.suggest_int('n_layers', 1, 5) # `num_layers` is 1, 2, 3, 4, or 5. | |
| layers, ps = [], [] # define the number of unit of each layer / the ratio of dropout of each layer | |
| for i in range(n_layers - 1): # `TabularModel` automatically adds the last layer. | |
| num_units = trial.suggest_categorical(f'num_units_layer_{i}', [800, 900, 1000, 1100, 1200]) | |
| p = trial.suggest_discrete_uniform(f'dropout_p_layer_{i}', 0, 1, 0.05) | |
| layers.append(num_units); ps.append(p) | |