Skip to content

Instantly share code, notes, and snippets.

@dfdx
dfdx / core.jl
Created July 28, 2016 17:30
Julia Workshop
################ BASICS #################
# dynamic typing
x = 3 # => 3 (Int64)
x = 3.2 # => 3.2 (Float64)
x = 2 + 1im # => 2 + 1im (Complex{Int64})
x = 2//3 # => 2//3 (Rational{Int64})
for n in numbers:
# выполняется для каждого числа
# выполняется после цикла
@dfdx
dfdx / benchmark.jl
Last active January 31, 2019 19:01
Zygote vs. Yota benchmark
using Yota
using Zygote
using Zygote: @adjoint
using BenchmarkTools
using Distributions
import NNlib
logistic(x) = 1 / (1 + exp(-x))
softplus(x) = log(exp(x) + 1)
@dfdx
dfdx / gist:6579079a7007a2cb0a79a97d3d550fdf
Created October 20, 2022 21:58
Yota: profiling grad on ResNet
Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
╎24825 @Base/task.jl:484; (::VSCodeServer.var"#61#62")()
╎ 24825 @VSCodeServer/src/eval.jl:34; macro expansion
╎ 24825 @Base/essentials.jl:726; invokelatest(::Any)
╎ 24825 @Base/essentials.jl:729; #invokelatest#2
╎ 24825 @VSCodeServer/src/repl.jl:187; (::VSCodeServer.var"#106#108"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
╎ 24825 @Base/logging.jl:623; with_logger
╎ ╎ 24825 @Base/logging.jl:511; with_logstate(f::Function, logstate::Any)
╎ ╎ 24825 @VSCodeServer/src/repl.jl:186; (::VSCodeServer.var"#107#109"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
@dfdx
dfdx / onnx3_pb.jl
Created March 19, 2023 19:30
Freshly generated onnx3_pb.jl
# Autogenerated using ProtoBuf.jl v1.0.6 on 2023-03-19T22:26:02.274
# original file: /home/azbs/data/onnx/onnx.proto3 (proto3 syntax)
import ProtoBuf as PB
using ProtoBuf: OneOf
using EnumX: @enumx
export Version, var"TensorProto.Segment", var"TensorShapeProto.Dimension"
export StringStringEntryProto, OperatorStatus, OperatorSetIdProto
export var"TensorProto.DataLocation", var"AttributeProto.AttributeType"
@dfdx
dfdx / back.jpg
Last active September 10, 2023 07:27
raymond weil watches
back.jpg