using CuArrays, NNlib, Test
ACTIVATION_FUNCTIONS = [σ, logσ, hardσ, hardtanh, relu, leakyrelu, relu6, rrelu,
elu, gelu, celu, swish, lisht, selu, trelu, softplus,
softsign, logcosh, mish, tanhshrink, softshrink];
x = randn(Float32, (5, 5))
for f in filter(x -> x != rrelu, ACTIVATION_FUNCTIONS)
@testset "$(f)" begin
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
# GaussianRandomWalk for Mamba | |
# \begin{align*} | |
# Y_0 &= D,\\ | |
# Y_{i+1} &= Y_i+\mu_i+\epsilon_i,\ \epsilon_i \sim \mbox{Normal}(0, \sigma)\\ | |
# \end{align*} | |
# Reference: | |
# Create User-Defined Multivariate Distribution | |
# https://mambajl.readthedocs.io/en/latest/mcmc/distributions.html#user-defined-univariate-distributions |
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
function rolling(fun::Function, x::AbstractArray{T}, window::Int) where {T <: Real} | |
[fun(view(x, i:i + window - 1)) for i = 1:length(x) - window + 1] | |
end | |
println(rolling(sum, [1, 2, 3, 4, 5], 2)) # [3, 5, 7, 9] | |
println(rolling(sum, [1, 2, 3, 4, 5], 3)) # [6, 9, 12] | |
println(rolling(prod, [1, 2, 3, 4, 5], 3)) # [6, 24, 60] |
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
using Adapt | |
using CuArrays | |
using Flux | |
using InteractiveUtils | |
function f1(x) | |
fill(1f0, size(x)) |> gpu | |
end | |
function f2(x) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
ARG CUDA=10.0 | |
ARG UBUNTU_VERSION=18.04 | |
FROM nvidia/cuda:${CUDA}-cudnn7-devel-ubuntu${UBUNTU_VERSION} | |
ENV JULIA_PATH=/usr/local/julia | |
ENV PATH=$JULIA_PATH/bin:$PATH | |
ENV JULIA_TAR_ARCH=x86_64 | |
ENV JULIA_DIR_ARCH=x64 |
https://github.com/MikeInnes/MacroTools.jl
julia> using MacroTools
julia> ex = :(f(x) = x^2 + 3x + 4)
:(f(x) = begin
#= REPL[2]:1 =#
x ^ 2 + 3x + 4
end)
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
└ @ Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:1365 | |
ERROR: Unsatisfiable requirements detected for package Polynomials [f27b6e38]: | |
Polynomials [f27b6e38] log: | |
├─possible versions are: [0.5.0-0.5.3, 0.6.0-0.6.1, 0.7.0] or uninstalled | |
├─restricted to versions 0.6 by an explicit requirement, leaving only versions 0.6.0-0.6.1 | |
└─restricted by compatibility requirements with RecipesBase [3cdcf5f2] to versions: [0.5.0-0.5.3, 0.7.0] or uninstalled — no versions left | |
└─RecipesBase [3cdcf5f2] log: | |
├─possible versions are: [0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 1.0.0] or uninstalled | |
└─restricted to versions 1 by IntervalArithmetic [d1acc4aa], leaving only versions 1.0.0 | |
└─IntervalArithmetic [d1acc4aa] log: |
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
function solve(n, m, ts, xss, ss) | |
mat = BitArray(undef, n, m) | |
for i in 1:n | |
for j in 1:ts[i] | |
mat[i, xss[i][j]] = 1 | |
end | |
end | |
println(mat) | |
s = BitArray(ss) | |
c = 1 |
- "Saint John": what is writing to this log file?
ファイルをオープンしているコマンドは lsof
コマンドで調べられる。
ubuntu@ip-172-31-32-108:/$ lsof /var/log/bad.log
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
badlog.py 637 ubuntu 3w REG 259,1 25744 67701 /var/log/bad.log
kill
でコマンドを止める。
OlderNewer