黒木玄 Gen Kuroki
- いいね数 389,756/311,170
- フォロー 995 フォロワー 14,556 ツイート 293,980
- 現在地 (^-^)/
- Web https://genkuroki.github.io/documents/
- 自己紹介 私については https://twilog.org/genkuroki と https://genkuroki.github.io と https://github.com/genkuroki と https://github.com/genkuroki/public を見て下さい。
2021年04月08日(木)

FORTRANやFortranと同じように、x.f(y,z)スタイルのプログラミング言語とその発展版も今後も使い続けられる。
Fortranにも便利なところがあるのと同じように、x.f(y,z)スタイルのプログラミング言語の発展版にも便利なところがある。
しかし、どちらも最良のものではない。別のスタイルも可能。
タグ:
posted at 23:49:18


Although #JuliaLang 1.6 has much shorter package load times, it's still more fun with a pre-compiled system image. pic.twitter.com/8MK2JMRJ6v
タグ: JuliaLang
posted at 23:42:47

C++の開発で知られるBjarne Stroustrupさんは、f(x,y,z)をx.f(x,y)と書くスタイルの採用は浅い考えに基く失敗で、多重メソッド(=多重ディスパッチ)の採用が良いといっているように見える。
x.f(y,z)スタイルは「とてもファッショナブル」だったらしい。 twitter.com/genkuroki/stat...
タグ:
posted at 23:41:05




Anyone who has the access to the #JuliaLang General registry can review and merge this ?
github.com/JuliaRegistrie...
I'd like to publish JET v0.1.0.
タグ: JuliaLang
posted at 23:25:25



#Julia言語 追加
Dice型に足し算、引き算、掛け算なども定義してみました。
すると、自動的に、Dice型成分の行列とベクトルの掛け算が可能になっています。
Baseモジュールにある行列やベクトルの演算の定義をユーザー側は自分が定義した型でも簡単に使えます。
gist.github.com/genkuroki/90b5... pic.twitter.com/tHMGomIbIe
タグ: Julia言語
posted at 23:11:31


#Julia言語 例えば、
X = Int64[]
として、Int64型の成分を持つ空の配列を作ったとき、
push!(X, 123.0)
は、123.0がInt64型の123に変換可能なので、可能ですが、
push!(X, 1.23)
は、1.23はInt64に変換できないので、実行時エラーになります。 pic.twitter.com/7mOm8r0ILI
タグ: Julia言語
posted at 22:56:20

#Julia言語 Juliaの1次元配列(Vector型オブジェクト)の型には、成分の型の情報がパラメータとして含まれています。
例えば、成分がDice型のVectorの型は Vector{Dice} になる。
Vector{Dice} 型の配列にpush!できるのはDice型オブジェクトまたはDice型オブジェクトに変換可能なモノに限ります。 pic.twitter.com/2pj9k2AtRm
タグ: Julia言語
posted at 22:52:14

#Julia言語 解説
Dice()で1から6の目がランダムに生成。
Base.islessをDice型に定義しておくと、sort函数をDice型の成分を持つ配列でも使える。
自分で定義した型に、他のモジュール(今の場合はBaseモジュール)の函数を定義すると、そのモジュールの機能を自分が定義した型でも使えるようになる。 pic.twitter.com/AxiHtNJGSz
タグ: Julia言語
posted at 22:48:36

@akinori_ito @hamanobakeneko 単項演算子や二項演算子として使える記号は
github.com/JuliaLang/juli...
に書いてあるようです。 #Julia言語
俺掛算の定義に ⊗ 記号などを使えます。
比較の記号に ⪅ はよく使う。 pic.twitter.com/ljUolxmYG8
タグ: Julia言語
posted at 22:42:20

#Julia言語 【JuliaはPythonほど適当にやさしくないので、自分で作った構造体を配列にpush!するのできないっぽい。】
さすがにそれはない。できます。 twitter.com/norikushi77/st... pic.twitter.com/G0NR4QpC4d
タグ: Julia言語
posted at 22:10:45

Researchers at ‘MIT, Cornell and several other colleges are using Scientific Machine Learning (#SciML) in #Julialang to analyze the spread of a virtual phone virus they created to mimic the COVID-19 transmission. More information is available here safeblues.org
タグ: Julialang
posted at 21:53:21

#julialang
有識者の方,下記のl6における関数 radius_Al!() において,lをパラメータとして外部から入力させたいときはどのような方法が考えられますか…
例えば,l=0,1,2の場合を続けて計算したい,などのような場合です. pic.twitter.com/MywyaV57XH
タグ: julialang
posted at 20:25:59



そういう時に便利なのがこれ。生まれ年の守り本尊となるプログラミング言語がわかる。私の場合は SNOBOL3 en.wikipedia.org/wiki/Timeline_... twitter.com/miura1729/stat...
タグ:
posted at 18:39:49

Im(Nyarn)@linuxナニモワカ @Imaginary_Nyarn
ROS1であればJuliaのPythonラッパーがあるのでそっちを使えばPythonは書かなくてもいいはず
タグ:
posted at 18:36:26

#Julia言語
using Random
function f(N)
rng = Random.default_rng()
c = 0
for i = N
c += ifelse(rand(rng)^2 + rand(rng)^2 ≤ 1, 1, 0)
end
4c/N
end
f(10^9)
だとチョー一瞬で計算が終わってしまう(笑) twitter.com/inazuma_110/st... pic.twitter.com/PHvVm9rDYa
タグ: Julia言語
posted at 17:37:24


非公開
タグ:
posted at xx:xx:xx


「遠隔講義を大学で受講するための教室」で友達同士数人で同じ講義を受けてるっぽい光景も見た。自宅で一人で受講するよりは精神衛生上ずっといいかもなあと思ったりもした。
タグ:
posted at 15:33:29

非公開
タグ:
posted at xx:xx:xx



#Julia言語 上に書いたように、配列Yと数値yについて
abserr, i = findmin(i -> abs(Y[i] - y), eachindex(Y))
で可能。
julia版ではデフォルトでnumpy以上の道具が使えます。
juliaを理解すればnumpyが一段劣っている道具だと感じるようになると思う。一段劣っていても素晴らしい道具なのですが。 twitter.com/noppikinatta/s...
タグ: Julia言語
posted at 14:05:16

>割り算の指導の際、等分除と包含除の違いをどのように児童ら自身に理解させますか?
不思議だよね。「等分除も包含除も同じことだというのは大人の発想。子供にとっては違うんです」という話じゃなかったの?
「子供は違うと考えちゃうけど本当は同じだと理解させるにはどうするのか?」ならわかる twitter.com/MathematicsTex...
タグ:
posted at 13:53:26


ついたてってまず無限に速いCPU(囲碁や将棋なら最後まで読み切れてしまう)があったとしても何を書いていいか分からないゲーム。今色々なAIが何したとかあるけど、ついたては何と似ているんだろう。
タグ:
posted at 13:25:30

仮の話として、「数値の入った配列」が沢山のxについてf(x)を計算した結果を集めたものなら、f(x)を大量に計算するコストと比較して、findminするコストは相対的に無視できる可能性もあるかもしれない、と思いました。
方程式f(x)=yを近似的に解きたいなら、NLsolve.jlを使うとか。 twitter.com/h_ushihara/sta...
タグ:
posted at 13:24:49

@LiamT @DocSparse @vardi @ZDNet Definitely not :-) But we do provide stock images for #julialang code should people want them: github.com/JuliaLang/juli...
タグ: julialang
posted at 09:39:09

村田次郎 / Jiro Murata @jiromurata
g因子が2の粒子は特別な事が起きる。磁場中におくと、自転と公転の周期が一致する。月の様に(月はちょっと動く)。だから、2からわずかにずれると、そのズレはわかりやすいので、測定の精度が出る。静的な超高精度実験には絶好の舞台。
タグ:
posted at 09:15:47

村田次郎 / Jiro Murata @jiromurata
ブルックヘブンでクォークグルーオンプラズマを見つけたRHIC加速器の実験をやっていた僕らは、日本に帰ってJ-PARCの実験を考えた。僕も僅かとは言え賛同して応援しているのでフェルミの結果は勿論、悔しい。何年も前から予想済みではあるが、一言で言えば国力の圧倒的な差。それより、結果に驚いた!!
タグ:
posted at 06:43:33

村田次郎 / Jiro Murata @jiromurata
同様に超高精度の静的な実験は、素粒子の電気双極子モーメント。こちらは標準模型ではゼロであるべきで、有限値が出たら大発見。巨大科学である超大型加速器実験とは全く異なる思想に基づく小中規模実験。
タグ:
posted at 06:26:34

村田次郎 / Jiro Murata @jiromurata
g-2(gマイナスtwo)とは、素粒子の磁性の強さを表すg因子という量は、ほぼ2であるのだが、真空の性質を反映してわずかに2からずれる。このズレの名前。超高精度で実験観測出来、かつ、同精度で計算可能。静的な実験の代表格。人類が手にしている最も精密な科学の看板。
タグ:
posted at 06:22:50

村田次郎 / Jiro Murata @jiromurata
ミュー粒子は電子と非常によく似た素粒子で、質量が207倍。質量は即ちエネルギーなので、電子では起きない、高いエネルギーが必要な現象を起こせる可能性がある。例えば、重い未発見の粒子が周囲に仮想的に出現するとか。LHCでこうした新粒子を力づくで生成する代わりに、静的な観測で狙っている。
タグ:
posted at 06:14:58

村田次郎 / Jiro Murata @jiromurata
素粒子は空っぽの真空にある存在ではなく、真空という名前の物体のとある状態。素粒子の磁性はこの状態として標準模型の中の量子電磁力学で計算可能。これが実験と合わないならば、仮定している標準模型の真空が疑わしい。標準模型はもう、30年以上は難攻不落。何か、知らない場があるか、時空構造か。
タグ:
posted at 06:08:11

村田次郎 / Jiro Murata @jiromurata
J-Parcの実験では重大な系統誤差の対策で、普通は測れない静電場を計測する装置を、僕の重力実験を応用して開発した事もある。同様の装置は実はセンター試験に出題された事もある。
タグ:
posted at 05:44:19

村田次郎 / Jiro Murata @jiromurata
実験の系統誤差を疑い、ブルックヘブンの結果に決着をつけるべく、日米両国でそれぞれ追実験が準備され、まずは米フェルミ研の結果が。これがブルックヘブンをピタリと再現。まだまだ一部しか解析されていないので、今後の解析で凄い事になる。日本のJ-Parcの実験は齊藤センター長が進めて来た。
タグ:
posted at 05:44:19

村田次郎 / Jiro Murata @jiromurata
これは大変な事!ミュー粒子の磁性が標準模型と「やはり」合わない!20年前ブルックヘブンの実験が「合わない」と言い、僕は現場でそれを聞いた。皆、興奮したが20年間半信半疑。鉄壁の標準模型の唯一の綻びがいよいよ。軽い電子では「合う」ので、高エネルギーに何かある。
news.fnal.gov/2021/04/first-...
タグ:
posted at 05:44:18

Stefan Karpinski @StefanKarpinski
R function call semantics are wild twitter.com/j_v_66/status/...
タグ:
posted at 02:47:35

Julia REPL stan now @miguelraz_
Step 8: Primes.jl doesn't have a `primecount` function out of the box. Are you a Julia beginner? This is a good PR to get started! Try and take a stab at it and I don't mind mentoring ya through the process.
タグ:
posted at 02:24:48
ごまふあざらし(GomahuAzaras @MathSorcerer
Hahaha! this thread is awesome! twitter.com/miguelraz_/sta...
タグ:
posted at 02:18:39

Julia REPL stan now @miguelraz_
Step 7: @MoseGiordano , one of the core maintainers of BinaryBuilder.jl, realizes I missed some warnings and we're not using AVX2 speedups on all compatible platforms. PR merged and deployed within the hour:
github.com/JuliaPackaging...
タグ:
posted at 02:10:48

Julia Computing Launches JuliaSim for Scientific Machine Learning in the Cloud: JuliaSim is a next generation cloud-based #modeling and #simulation platform. For more details click here juliacomputing.com/products/julia...
#julialang #SciML pic.twitter.com/c7JjUQOUei
タグ: julialang modeling SciML simulation
posted at 02:06:19

多くの人が結局一日を大学で過ごすことになるなら、1/2定員に制限してる教室に入り切るわけないんだよなあ。こりゃ、リアルタイム遠隔講義を止めて全部録画にせよ、って方向に行く可能性があるな。
タグ:
posted at 01:32:15

遠隔講義と対面講義が混在した状態で新学期が始まったわけだが、遠隔と対面が連続した場合10分休みなんかでは移動が不可能なので両方大学で受講することになる→「遠隔講義を大学で受講するための教室」の密度が大変なことに、という現象が予想通り起きてる模様。
タグ:
posted at 01:25:04

#Julia言語 配列Yの中からxに最も近いものを1行で見付ける方法
お求めのものとは違う陳腐な方法ですが、1行で書けるということを知らない人も結構いるかもしれないと思ったので紹介→添付画像
ソースコード↓
gist.github.com/genkuroki/f187...
函数を最初の引数に取る函数達はチェックしておく価値あり。 twitter.com/h_ushihara/sta... pic.twitter.com/CNPlTwtJDG
タグ: Julia言語
posted at 01:10:18

Julia REPL stan now @miguelraz_
Step 6: This snippet now works on every machine that Julia can run on (snippet thanks to Carsten Bauer) pic.twitter.com/8RsXCJ4WdQ
タグ:
posted at 00:46:55

#Julia言語 私はsin(x)をFloat64で計算するための13次多項式の係数を自力で作ることを以前やったことがあるので、こういう問題が結構非自明であることを感覚的に知っている。
昔から使われているsin(x)を計算するための係数そのものは再現できなかったが、性能的には同等のものを作れた。 twitter.com/genkuroki/stat...
タグ: Julia言語
posted at 00:45:43


#Julia言語 github.com/JuliaLang/juli...
要約【sinpiがDoubleFloat64の精度のπのかけ算経由で実装されているけど、sinpi_kernelをそれ専用の係数で定義すればsin並に速くなるのでは?】
これって可能?
πを拡張精度で使わないと、ある確定した値以上の相対誤差がバイアスとして発生すると思う。続く
タグ: Julia言語
posted at 00:45:43

How the Julia Language Is Making it Easy for Programmers to Use GPU Capabilities with JuliaGPU. Blog by Federico Carrone. notamonadtutorial.com/julia-gpu-98a4...
#julialang #GPU #parallelcomputing #HPC
タグ: GPU HPC julialang parallelcomputing
posted at 00:27:34

Are you interested in developing software with #JuliaLang? Here is how to create a software package with Julia language, publish it on #GitHub, automate unit tests, document deployment, and version release using #GitHubActions! jaantollander.com/post/how-to-cr...
タグ: GitHub GitHubActions JuliaLang
posted at 00:27:18

slowfouriertransform @cmmmsubmm
Crazy realization today: I wanted to randomly sample values based on a derived parameter, and it was faster and easier to parameterize the distribution in Flux.jl/#JuliaLang than to write code to do conditional sampling
gist.github.com/laserkelvin/58...
タグ:
posted at 00:02:44