Julia: LaTeX 符号

Julia是重度 LaTex符号的偏好的语言,这个已经深深融入Julia风格中。所以,有必要收藏一下LaTex符号表。


julia> for i ∈ 1:5  # /in 
	if i ∉ 2:3  # /notin 
		println(i) 
	end 
end
1
4
5

julia> k = 4π  # π : \pi
12.566370614359172

julia> num =rand()
julia> if num ≤ 0.5 println(num)  end  # ≤ :	\leq
using Flux

layers = [Dense(10 ,5, σ), Dense(5,2), softmax] # σ: \sigma ->Sigmoid函数

m2(x) == (m2[:dec] ∘ m2[:enc])(x)  #  ∘ : \circ

"""
# Flux中的源代码
# https://github.com/FluxML/Flux.jl/blob/6476a314859f3e43fbf41c1857fd7b243cf07f21/src/losses/functions.jl#L26-L44 

tversky_loss(ŷ, y; β = 0.7)
Return the [Tversky loss](https://arxiv.org/abs/1706.05721).
Used with imbalanced data to give more weight to false negatives.
Larger β weigh recall more than precision (by placing more emphasis on false negatives)
Calculated as:
    1 - sum(|y .* ŷ| + 1) / (sum(y .* ŷ + β*(1 .- y) .* ŷ + (1 - β)*y .* (1 .- ŷ)) + 1)
"""
function tversky_loss(ŷ, y; β = ofeltype(ŷ, 0.7))
    _check_sizes(ŷ, y)
    #TODO add agg
    num = sum(y .* ŷ) + 1
    den = sum(y .* ŷ + β * (1 .- y) .* ŷ + (1 - β) * y .* (1 .- ŷ)) + 1
    1 - num / den
end

1、如何输入这些符号?:先输入某个 LaTeX 符号(比如 \delta)再敲击 Tab 键.
2、如何查找这些符号?:打开Julia REPL环境,按下?切换到help模式:

help?>"∈" can be typed by \in<tab>

help?> δ
"δ" can be typed by \delta<tab>

julia> 123234  #xor(x, y)
145

help?>"⊻" can be typed by \xor<tab>

julia> 123124
-128

help?>"⊽" can be typed by \nor<tab>

search: ⊽

  nor(x, y)(x, y)
julia>(A,B) = kron(A,B)(generic function with 1 method)

help?>"⊗" can be typed by \otimes<tab>

julia>(x,y)= x^2 + y^2
∑ (generic function with 1 method)

help?>"∑" can be typed by \sum<tab>

julia> ϵ = 0.00001
1.0e-5

help?> ϵ
"ϵ" can be typed by \epsilon<tab>

help?>"ŷ" can be typed by y\hat<tab>

help?>"≈" can be typed by \approx<tab>

julia> gelu(x) = 0.5x * (1 + tanh((2) * (x + 0.044715x^3)))
gelu (generic function with 1 method)

help?>"√" can be typed by \sqrt<tab>

julia> selu(x) = λ * (x ≥ 0 ? x : α * (exp(x) - 1))
selu (generic function with 1 method)

help?> λ 
"λ" can be typed by \lambda<tab>

help?> α
"α" can be typed by \alpha<tab>

help?> η  # 往往学习率用这个符号表示
"η" can be typed by \eta<tab>

3、附表

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值