Skip to content

Instantly share code, notes, and snippets.

@piacerex
Last active October 6, 2022 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piacerex/ca512eca6c83921449ccbc6d62628e40 to your computer and use it in GitHub Desktop.
Save piacerex/ca512eca6c83921449ccbc6d62628e40 to your computer and use it in GitHub Desktop.
Livebook新フィーチャのライブデモ(2022年版)

Livebook new featuresヽ(=´▽`=)ノ

Mix.install([
  {:kino, git: "https://github.com/livebook-dev/kino", override: true},
  {:kino_db, "~> 0.1.2"},
  {:postgrex, "~> 0.16.3"},
  {:kino_vega_lite, "~> 0.1.1"},
  {:kino_maplibre, "~> 0.1.3"},
  {:exla, "~> 0.2"},
  {:axon_onnx, "~> 0.1"},
  {:stb_image, "~> 0.5"},
  {:download, "~> 0.0"},
  {:jason, "~> 1.3"},
  {:scidata, "~> 0.1.4"}
])
:ok

リアルタイムグラフ

memory_plot =
  VegaLite.new(width: 600, height: 400, padding: 20)
  |> VegaLite.repeat(
    [layer: ["total", "processes", "atom", "binary", "code", "ets"]],
    VegaLite.new()
    |> VegaLite.mark(:line)
    |> VegaLite.encode_field(:x, "iter", type: :quantitative, title: "Measurement")
    |> VegaLite.encode_repeat(:y, :layer, type: :quantitative, title: "Memory usage (MB)")
    |> VegaLite.encode(:color, datum: [repeat: :layer], type: :nominal)
  )
  |> Kino.VegaLite.new()
Kino.VegaLite.periodically(memory_plot, 200, 1, fn i ->
  point =
    :erlang.memory()
    |> Enum.map(fn {type, bytes} -> {type, bytes / 1_000_000} end)
    |> Map.new()
    |> Map.put(:iter, i)

  Kino.VegaLite.push(memory_plot, point, window: 1000)
  {:cont, i + 1}
end)
:ok
for i <- 1..8000, do: String.duplicate("piacere", i)

チャート(Smartから)

my_data = %{a: [89, 124, 09, 67, 45], b: [12, 45, 67, 83, 32]}
%{a: 'Y|\tC-', b: '\f-CS '}

シーケンス図

Kino.Process.render_seq_trace(fn -> IO.puts("hello") end)
hello
:ok
parent = self()

Kino.Process.render_seq_trace(fn ->
  ponger_by_ping =
    spawn(fn ->
      receive do
        :ping -> send(parent, :pong) |> dbg
      end
    end)

  send(ponger_by_ping, :ping) |> IO.inspect()

  receive do
    :pong -> :ponged!
  end
end)
:ping
:ponged!

地図

earthquakes = "https://maplibre.org/maplibre-gl-js-docs/assets/earthquakes.geojson"
conference = %Geo.Point{coordinates: {100.4933, 13.7551}, properties: %{year: 2004}}
%Geo.Point{coordinates: {100.4933, 13.7551}, srid: nil, properties: %{year: 2004}}
:pong
MapLibre.new(style: :terrain)
|> MapLibre.add_source("earthquakes", type: :geojson, data: earthquakes)
|> MapLibre.add_layer(
  id: "test",
  source: "earthquakes",
  type: :circle,
  paint: [circle_color: "#f50000", circle_radius: 7, circle_opacity: 0.4]
)

DB(隣のElixir PJで作ったテーブル内容を参照します)

opts = [
  hostname: "localhost",
  port: 5432,
  username: "postgres",
  password: "postgres",
  database: "basic_dev",
  socket_options: [:inet6]
]

{:ok, conn2} = Kino.start_child({Postgrex, opts})
{:ok, #PID<0.430.0>}
result2 = Postgrex.query!(conn2, "select schemaname, tablename, tableowner from pg_tables", [])
result = Postgrex.query!(conn2, "select * from blogs", [])

dbg

[1, 2, 3]
|> Enum.map(&(&1 * 3))
|> Enum.map(&(&1 - 2))
|> Enum.map(&(&1 / 2))
|> dbg
[0.5, 2.0, 3.5]

捨てたコードブロックも復活できます

[1, 2, 3]
|> Enum.map(&(&1 * 3))
|> Enum.map(&(&1 - 2))
|> Enum.map(&(&1 / 2))
|> dbg
[0.5, 2.0, 3.5]

Livebookで既存のElixir PJをロードすることもできます(時間が余ってたらデモします)

今回、動かしているLivebookは、Githubから構築した最新版のため、mixプロジェクトをロードするメニューが出ませんでした…

livebook serverで起動できる下記インストールでお試し出来ます

mix escript.install hex livebook
livebook server
data =
  Download.from("https://pbs.twimg.com/media/FcyOH_WaAAQf6GV?format=jpg&name=small")
  |> elem(1)
  |> File.read!()

Kino.Image.new(data, :jpeg)

Pythonで作られたOnnxディープラーニングモデルをElixirで走らせる

EXLA.set_as_nx_default([:tpu, :cuda, :rocm, :host])

File.rm("imagenet_class_index.json")

classes =
  Download.from(
    "https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json"
  )
  |> elem(1)
  |> File.read!()
  |> Jason.decode!()

File.rm("resnet18-v1-7.onnx")

{model, params} =
  Download.from(
    "https://media.githubusercontent.com/media/onnx/models/main/vision/classification/resnet/model/resnet18-v1-7.onnx"
  )
  |> elem(1)
  |> AxonOnnx.import()
warning: EXLA.set_as_nx_default/1 is deprecated. Configure the Nx backend directly
  /home/piacere/new_feature.livemd#cell:gaj7gbiact2aimwub33cmiq5xlb6xfb5:1


13:27:50.652 [info] XLA service 0x7fd7805fe730 initialized for platform Host (this does not guarantee that XLA will be used). Devices:

13:27:50.657 [info]   StreamExecutor device (0): Host, Default Version

13:27:52.744 [warn] N has no specified dimension, assuming nil

{#Axon<
   inputs: %{"data" => {nil, 3, 224, 224}}
   outputs: "resnetv15_dense0_fwd"
   nodes: 78
 >,
 %{
   "resnetv15_stage2_conv1_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[128][128][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155553>
       [
         [
           [
             [-0.004372711759060621, -0.05419772490859032, -3.91293375287205e-4],
             [-0.04232256859540939, -0.06853722780942917, 0.04243552312254906],
             [-0.00898411963135004, -0.07863212376832962, -0.016110705211758614]
           ],
           [
             [-0.010281874798238277, 0.03421446308493614, -0.014962800778448582],
             [-0.016651591286063194, 0.06242304667830467, -0.021968599408864975],
             [0.008408828638494015, -0.01319062802940607, -0.032806456089019775]
           ],
           [
             [0.006438169162720442, -0.022291747853159904, 0.008700958453118801],
             [-0.006003286223858595, 0.012804224155843258, -0.03372650220990181],
             [0.006644513923674822, 0.03296489641070366, -0.008054926060140133]
           ],
           [
             [0.03198675438761711, -0.008067324757575989, 0.02648865059018135],
             [0.02297864854335785, 0.0386367104947567, -0.07900068163871765],
             [0.033621758222579956, 0.02159077301621437, 0.02256469801068306]
           ],
           [
             [-0.04729733243584633, 0.024080155417323112, -0.005679002031683922],
             [-0.008684554137289524, -0.030438365414738655, 0.002640919527038932],
             [-2.89778381556971e-5, -0.010822935961186886, -0.014380409382283688]
           ],
           [
             [-0.002085881307721138, ...],
             ...
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage3_conv0_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[256][128][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155557>
       [
         [
           [
             [-0.0132809579372406, -0.021667124703526497, -0.007288098335266113],
             [-0.007261752150952816, -0.011978251859545708, -0.00867552775889635],
             [0.024430986493825912, 0.0010231132619082928, 0.00932250078767538]
           ],
           [
             [-0.004223249386996031, -0.0020390385761857033, 0.0123683400452137],
             [0.018303273245692253, 0.026677964255213737, 0.01098636444658041],
             [0.04307591915130615, 0.06255745142698288, 0.05567341297864914]
           ],
           [
             [0.012428343296051025, 0.0259371530264616, 0.02102091908454895],
             [0.002833062317222357, -0.012572483159601688, 0.053992487490177155],
             [-0.002169080777093768, 0.029913710430264473, 0.05847463384270668]
           ],
           [
             [-0.006782576907426119, -0.015180363319814205, -0.0024544952902942896],
             [0.014065624214708805, -0.014143011532723904, 0.004663258325308561],
             [0.017230762168765068, -0.005719166714698076, -0.014543636702001095]
           ],
           [
             [-0.0087962681427598, -0.003275044495239854, 0.014437062665820122],
             [0.0033619666937738657, -0.005276537965983152, 0.00811026245355606],
             [-0.00519958883523941, 0.008937902748584747, 0.01126845832914114]
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage1_conv2_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[64][64][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155549>
       [
         [
           [
             [-0.04273908957839012, -0.0016209344612434506, -0.024602342396974564],
             [-0.0014729746617376804, 0.0407138429582119, 0.003976970445364714],
             [-0.024285735562443733, 0.008288075216114521, 0.026334460824728012]
           ],
           [
             [0.022718101739883423, 0.027617767453193665, -0.0015894880052655935],
             [0.029189737513661385, -0.0296456478536129, 0.005020724609494209],
             [-0.016052044928073883, 0.003710768651217222, 0.003594387089833617]
           ],
           [
             [0.0022521952632814646, 0.03973611816763878, -0.008867218159139156],
             [0.03960597887635231, 0.09111523628234863, 0.04423365741968155],
             [-0.006665181368589401, 0.05003541335463524, 0.021319540217518806]
           ],
           [
             [-0.02817159704864025, -0.020342908799648285, -0.035205960273742676],
             [-0.021228399127721786, -0.015519125387072563, -0.019682085141539574],
             [-0.029222961515188217, -0.019630378112196922, -0.02652803249657154]
           ],
           [
             [-0.028428852558135986, -0.06003900617361069, -0.011422639712691307],
             [0.0047211111523211, 0.017041660845279694, 0.018938405439257622],
             [0.01961064338684082, 0.05447525531053543, ...]
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage3_conv3_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[256][256][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155559>
       [
         [
           [
             [0.007360897492617369, 0.011684455908834934, 0.014390671625733376],
             [0.01795717515051365, 0.018082698807120323, 0.007120896130800247],
             [-0.01249797735363245, -0.021108508110046387, -0.018952926620841026]
           ],
           [
             [0.005976986140012741, 0.003644037526100874, -0.009489438496530056],
             [0.003749158466234803, -0.006711691617965698, -0.006486326921731234],
             [-0.020584726706147194, -0.02576063759624958, -0.032088130712509155]
           ],
           [
             [-0.04379397630691528, 0.06337196379899979, 0.04274430871009827],
             [-0.04211288318037987, 0.10768246650695801, 0.03375661000609398],
             [-0.04575773701071739, -0.0370059609413147, -0.02428184635937214]
           ],
           [
             [-0.011994347907602787, -0.008994431234896183, -0.004394493997097015],
             [0.006494964938610792, 0.008632502518594265, -0.006265564821660519],
             [-0.0022780282888561487, 0.010660781525075436, -0.001458185026422143]
           ],
           [
             [0.0013403133489191532, -0.004409696441143751, -0.009679187089204788],
             [0.008197332732379436, -0.004781861323863268, -0.012495175004005432],
             [0.005880873650312424, ...]
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage1_batchnorm3_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156574>
       [0.17209984362125397, 0.006118499208241701, 0.046158578246831894, 0.2616331875324249, 0.047538693994283676, -0.1332138031721115, -0.14159579575061798, -0.22409465909004211, -0.1705334335565567, 0.17851437628269196, -0.14194239675998688, 0.14119787514209747, 0.24726499617099762, -0.24126304686069489, 0.0788675844669342, 0.02458156831562519, -0.16053283214569092, -0.03937358036637306, 0.0768241211771965, 0.009212430566549301, 0.11453794687986374, -0.058193571865558624, 0.10432858020067215, 0.1427590698003769, -0.006379001308232546, 0.10411231219768524, -0.11333339661359787, -0.01300036907196045, -0.22290268540382385, 0.15458111464977264, 0.047290921211242676, 9.417664841748774e-4, 0.18037591874599457, -0.2871352434158325, 0.03729450702667236, 0.158797025680542, -0.0427778996527195, -0.06669793277978897, -0.12869243323802948, 0.046405766159296036, -0.10199212282896042, -0.06456106156110764, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156573>
       [0.21748007833957672, 0.3514665961265564, 0.2732861340045929, 0.27742791175842285, 0.24738048017024994, 0.3718911409378052, 0.34789225459098816, 0.42112666368484497, 0.2833738625049591, 0.3125789165496826, 0.4478318989276886, 0.2905173599720001, 0.5661211013793945, 0.5346167683601379, 0.39130064845085144, 0.6248013377189636, 0.6175164580345154, 0.5105664730072021, 0.31301483511924744, 0.49441030621528625, 0.29812195897102356, 0.48537227511405945, 0.2841026484966278, 0.27279117703437805, 0.4470939338207245, 0.43783998489379883, 0.34781044721603394, 0.2684362828731537, 0.32683250308036804, 0.696101725101471, 0.3728120028972626, 0.1681371033191681, 0.2642030417919159, 0.28523433208465576, 0.27973616123199463, 0.5557174682617188, 0.666621744632721, 0.38617250323295593, 0.4075431227684021, 0.6257655620574951, 0.37075087428092957, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156575>
       [0.05512537062168121, 0.2595690190792084, -0.049237582832574844, 0.04469703510403633, -0.07464569061994553, -0.09598635137081146, 0.03816966712474823, -0.004327676724642515, 0.11293864250183105, 0.0017437192145735025, -0.04388900846242905, 0.010042845271527767, 5.892590852454305e-4, -0.1037544459104538, 0.022028744220733643, 0.06744462251663208, -0.12486346065998077, -0.13421498239040375, -0.19209356606006622, 0.10132186859846115, 0.16112294793128967, 0.047579772770404816, -0.0735909640789032, 0.16654402017593384, -0.13080161809921265, -0.2900204658508301, -0.05816976726055145, -0.08223054558038712, 0.11685419082641602, -0.015925955027341843, -0.29348576068878174, -0.13051675260066986, -0.2572914958000183, -0.1295301765203476, 0.09597738832235336, -0.1798400580883026, 0.030478280037641525, -0.09064535796642303, -0.24201823770999908, -0.029760124161839485, ...]
     >,
     "var" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156576>
       [0.036362603306770325, 0.02163962833583355, 0.028978446498513222, 0.013921423815190792, 0.017633484676480293, 0.06508386880159378, 0.03457463160157204, 0.01873803324997425, 0.0314139761030674, 0.03456990793347359, 0.021263349801301956, 0.01834406703710556, 0.029071129858493805, 0.03549467772245407, 0.023502057418227196, 0.02790575474500656, 0.03459765017032623, 0.021767428144812584, 0.038501542061567307, 0.04073057323694229, 0.020157456398010254, 0.019277233630418777, 0.027829118072986603, 0.022200150415301323, 0.030972301959991455, 0.022777006030082703, 0.03643421828746796, 0.02056802809238434, 0.043726444244384766, 0.0440472811460495, 0.027097592130303383, 0.02111688256263733, 0.017365621402859688, 0.02980935387313366, 0.02249041385948658, 0.03220800310373306, 0.03904491662979126, 0.039861176162958145, 0.041399721056222916, ...]
     >
   },
   "resnetv15_conv0_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[64][3][7][7]
       EXLA.Backend<host:0, 0.1909074504.761397274.155546>
       [
         [
           [
             [-0.0018184100044891238, -0.020294396206736565, -0.05647287517786026, -0.017123185098171234, 0.027556927874684334, 0.016942223533988, -0.02611982636153698],
             [-0.019106149673461914, -0.015018479898571968, -0.013928757049143314, 0.04271012172102928, 0.04689779505133629, 0.013606674037873745, -0.02657388336956501],
             [-0.02268465980887413, -0.008339977823197842, 0.015022536739706993, 0.035579975694417953, 0.04979927837848663, 0.026079069823026657, -0.014280244708061218],
             [0.007661927025765181, 0.026159588247537613, 0.035990890115499496, 0.021425114944577217, 0.046952277421951294, 0.052874259650707245, 0.006164622027426958],
             [0.007683857809752226, 0.037574950605630875, 0.045994970947504044, 0.03542231023311615, 0.061670538038015366, 0.05270526558160782, -0.005582894664257765],
             [0.011148842051625252, 0.033756304532289505, 0.04414188861846924, 0.04307037219405174, 0.05528620630502701, 0.00868887547403574, ...],
             ...
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage2_conv2_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[128][64][1][1]
       EXLA.Backend<host:0, 0.1909074504.761397274.155551>
       [
         [
           [
             [-0.07025585323572159]
           ],
           [
             [-0.026780370622873306]
           ],
           [
             [-0.01724754087626934]
           ],
           [
             [-0.04220627248287201]
           ],
           [
             [0.01576266996562481]
           ],
           [
             [0.03804337605834007]
           ],
           [
             [0.04410058259963989]
           ],
           [
             [0.0215569119900465]
           ],
           [
             [-0.011832201853394508]
           ],
           [
             [-0.01704918034374714]
           ],
           [
             [-0.019389577209949493]
           ],
           [
             [0.0024659978225827217]
           ],
           [
             [-0.08506906777620316]
           ],
           [
             [-0.06553124636411667]
           ],
           [
             [-0.07711481302976608]
           ],
           [
             [0.0035402378998696804]
           ],
           [
             [0.03447660431265831]
           ],
           [
             [-0.019013287499547005]
           ],
           [
             [-0.04653102904558182]
           ],
           [
             [-0.03312944248318672]
           ],
           [
             [-0.05929741635918617]
           ],
           [
             [0.0471075177192688]
           ],
           [
             [0.01380248460918665]
           ],
           [
             [0.012288697995245457]
           ],
           [
             [0.01234856154769659]
           ],
           [
             [-0.04691522940993309]
           ],
           [
             [-0.025216056033968925]
           ],
           [
             [-0.003479759907349944]
           ],
           [
             [0.034383323043584824]
           ],
           [
             [0.1419815868139267]
           ],
           [
             [0.03304138407111168]
           ],
           [
             [-0.01724536530673504]
           ],
           [
             [0.00598535779863596]
           ],
           [
             [-0.01786188594996929]
           ],
           [
             [-0.07275085896253586]
           ],
           [
             [0.007575713563710451]
           ],
           [
             [0.028518645092844963]
           ],
           [
             [0.02167900651693344]
           ],
           [
             [0.0045365202240645885]
           ],
           [
             [0.06451937556266785]
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage4_batchnorm1_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156640>
       [-0.3312325179576874, -0.12665832042694092, -0.17228902876377106, -0.24594725668430328, -0.1218721941113472, -0.26590457558631897, -0.1048421710729599, -0.15851233899593353, -0.1698925793170929, -0.1402788758277893, -0.19430601596832275, -0.22849872708320618, -0.1667681783437729, -0.2581608295440674, -0.16658757627010345, -0.22952330112457275, -0.22646163403987885, -0.2378488928079605, -0.1498619168996811, -0.17069348692893982, -0.1615811437368393, -0.16065584123134613, -0.2606816589832306, -0.17667390406131744, -0.1978839486837387, -0.20210157334804535, -0.271391898393631, -0.26092422008514404, -0.23841096460819244, -0.17240464687347412, -0.24755237996578217, -0.23081864416599274, -0.174147367477417, -0.1741199642419815, -0.13863839209079742, -0.26724424958229065, -0.31445765495300293, -0.19204720854759216, -0.10499333590269089, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156639>
       [0.46572786569595337, 0.39868590235710144, 0.42078787088394165, 0.44266679883003235, 0.37192827463150024, 0.3439003825187683, 0.39599496126174927, 0.42094895243644714, 0.4550004005432129, 0.4367839992046356, 0.41631239652633667, 0.42456886172294617, 0.4153840243816376, 0.43920713663101196, 0.38395315408706665, 0.42333418130874634, 0.4022522270679474, 0.5328371524810791, 0.35675641894340515, 0.3660064935684204, 0.3822944760322571, 0.3758334815502167, 0.4795381426811218, 0.4117264151573181, 0.4207192063331604, 0.43001696467399597, 0.5384849905967712, 0.47440311312675476, 0.45109373331069946, 0.4140130877494812, 0.4147493839263916, 0.5797527432441711, 0.41658681631088257, 0.5930690169334412, 0.4125818908214569, 0.44802945852279663, 0.5167822241783142, 0.41298821568489075, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156641>
       [-0.16339531540870667, -0.17552787065505981, -0.1241803914308548, -0.1085064634680748, -0.17689794301986694, -0.09204146265983582, -0.04021696373820305, -0.182294100522995, -0.1651945412158966, -0.08834721893072128, -0.11787472665309906, -0.15882447361946106, -0.14014512300491333, -0.154926598072052, -0.2686997652053833, -0.14680960774421692, -0.11121977865695953, -0.2081460952758789, -0.15902012586593628, -0.12542344629764557, -0.13255713880062103, -0.14280995726585388, -0.0727514773607254, -0.10823705792427063, -0.1535014510154724, -0.15209923684597015, -0.18521003425121307, -0.11015152186155319, -0.12506961822509766, -0.018289431929588318, -0.10455582290887833, -0.17761579155921936, -0.12855064868927002, -0.1547035425901413, -0.1274917721748352, -0.2331312894821167, -0.15505637228488922, ...]
     >,
     "var" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156642>
       [0.01165462564677, 0.020705603063106537, 0.013701953925192356, 0.01711604930460453, 0.014669987373054028, 0.015717962756752968, 0.019033832475543022, 0.022330308333039284, 0.020732326433062553, 0.020009547472000122, 0.016169290989637375, 0.014446193352341652, 0.01930125802755356, 0.013931909576058388, 0.020261665806174278, 0.014756574295461178, 0.014657885767519474, 0.01972023770213127, 0.01530918013304472, 0.015886828303337097, 0.014899121597409248, 0.0149239432066679, 0.02041514404118061, 0.014997728168964386, 0.01885036565363407, 0.01615867391228676, 0.019680872559547424, 0.016341201961040497, 0.01700337789952755, 0.019986946135759354, 0.01264936849474907, 0.02500566840171814, 0.017231635749340057, 0.03354296460747719, 0.01812060736119747, 0.015769293531775475, ...]
     >
   },
   "resnetv15_stage2_batchnorm1_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156589>
       [-0.06712693721055984, 0.04884012043476105, 0.12086392939090729, -0.07154455035924911, -0.07156413793563843, -0.04221009835600853, 0.10512065142393112, 0.0969671681523323, 0.00497826561331749, 0.10426348447799683, 0.03755638375878334, 0.023956315591931343, -0.030488045886158943, 0.06632853299379349, -0.004831552039831877, 0.019802646711468697, -0.11444760113954544, 0.009140939451754093, 0.06953513622283936, -0.07613534480333328, 0.008831397630274296, -0.21252228319644928, -0.013173296116292477, 0.006079841870814562, 0.13708354532718658, -0.05716102570295334, -0.0844983160495758, 0.06339163333177567, -0.05904626101255417, -0.04436257481575012, 0.11894155293703079, -0.056009408086538315, 0.1613737940788269, -0.07890591770410538, -0.07261412590742111, 0.13737724721431732, -0.010524772107601166, 0.10884805023670197, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156588>
       [0.2947116792201996, 0.3010447919368744, 0.1503370851278305, 0.38703182339668274, 0.3640561103820801, 0.3070819079875946, 0.23811767995357513, 0.34393274784088135, 0.32123497128486633, 0.21251294016838074, 0.19830070436000824, 0.2460334450006485, 0.37701818346977234, 0.2223045974969864, 0.34972554445266724, 0.2725076377391815, 0.4283561110496521, 0.20518794655799866, 0.14916907250881195, 0.3797819912433624, 0.2981772720813751, 0.36848166584968567, 0.18472176790237427, 0.3110820949077606, 0.13221633434295654, 0.31015560030937195, 0.3232255280017853, 0.3335379362106323, 0.3140956461429596, 0.29352691769599915, 0.24873116612434387, 0.23914362490177155, 0.16789290308952332, 0.4803355038166046, 0.3855978846549988, 0.3063528835773468, 0.2781458795070648, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156590>
       [-0.168156698346138, -0.3174460828304291, -0.21332214772701263, -0.2645810544490814, -0.10959387570619583, -0.20171886682510376, -0.17404305934906006, -0.18956857919692993, -0.10092373937368393, -0.15560558438301086, -0.02900683507323265, -0.25889742374420166, -0.4577954411506653, -0.24879905581474304, -0.062089331448078156, -0.2018052339553833, -0.2061970829963684, -0.35889163613319397, -0.13493268191814423, -0.13814282417297363, -0.08303679525852203, -0.040602948516607285, -0.18943974375724792, -0.1579238325357437, -0.3399718999862671, -0.1261942982673645, -0.18101371824741364, -0.47851142287254333, -0.22149613499641418, -0.10070005059242249, 0.18525835871696472, -0.04607166349887848, -0.06613463163375854, -0.7024778127670288, -0.20907065272331238, 0.22894053161144257, ...]
     >,
     "var" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156591>
       [0.05983922630548477, 0.12412801384925842, 0.05000807344913483, 0.07001117616891861, 0.06249478459358215, 0.06647398322820663, 0.04670685529708862, 0.1151534914970398, 0.0547926239669323, 0.05495990812778473, 0.03765198960900307, 0.043873995542526245, 0.11560399830341339, 0.0607108399271965, 0.08174172043800354, 0.045318566262722015, 0.06779321283102036, 0.05134747177362442, 0.04395778104662895, 0.039554398506879807, 0.061605263501405716, 0.03416914492845535, 0.03984470292925835, 0.05485661327838898, 0.053109005093574524, 0.043458692729473114, 0.03941047191619873, 0.13211119174957275, 0.04657619446516037, 0.03216325119137764, 0.08940749615430832, 0.03236881271004677, 0.04348920285701752, 0.09556173533201218, 0.05970083549618721, ...]
     >
   },
   "resnetv15_stage4_batchnorm3_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156645>
       [-0.20877386629581451, -0.23771072924137115, -0.2800235450267792, -0.20427311956882477, -0.20494399964809418, -0.3414366543292999, -0.23191796243190765, -0.11276114732027054, -0.2678108513355255, -0.23581543564796448, -0.26471802592277527, -0.34258008003234863, -0.3078129291534424, -0.4265258014202118, -0.269579142332077, -0.13011819124221802, -0.28164127469062805, -0.24079382419586182, -0.28811025619506836, -0.2577960193157196, -0.3317391872406006, -0.027371732518076897, -0.19523511826992035, -0.1981348842382431, -0.2167050540447235, -0.3930096924304962, -0.19226482510566711, -0.23928532004356384, -0.2974832355976105, -0.3388822376728058, -0.3222447335720062, -0.26364758610725403, -0.18860876560211182, -0.2605261504650116, -0.19536055624485016, -0.2456725537776947, -0.2277771532535553, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156644>
       [0.26711180806159973, 0.27278658747673035, 0.29994723200798035, 0.2519586384296417, 0.26285576820373535, 0.30845212936401367, 0.2724456787109375, 0.21601548790931702, 0.2989080846309662, 0.25965607166290283, 0.280232697725296, 0.3281201422214508, 0.32010379433631897, 0.3669077157974243, 0.2971067726612091, 0.2169426679611206, 0.2786111533641815, 0.26552656292915344, 0.3070426285266876, 0.26522114872932434, 0.3334543704986572, 0.1903027892112732, 0.24865390360355377, 0.24128219485282898, 0.2508713901042938, 0.3601941466331482, 0.2503695785999298, 0.28261399269104004, 0.31398990750312805, 0.30295324325561523, 0.3174939453601837, 0.30440786480903625, 0.247114896774292, 0.29690054059028625, 0.2692229449748993, 0.2854210138320923, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156646>
       [-0.6521344780921936, -0.6016889214515686, -0.6551918387413025, -0.508089542388916, -0.39589375257492065, -0.5254730582237244, -0.4366898238658905, -0.5988600254058838, -0.595978319644928, -0.5447014570236206, -0.6750208735466003, -0.6689499020576477, -0.722243070602417, -0.5923499464988708, -0.48466479778289795, -0.44668665528297424, -0.5799710750579834, -0.5087935328483582, -0.664008378982544, -0.5395622849464417, -0.7114517688751221, -0.6090403199195862, -0.6616658568382263, -0.5229893922805786, -0.36782270669937134, -0.6596415042877197, -0.562640368938446, -0.6389751434326172, -0.7193968892097473, -0.616251528263092, -0.7597682476043701, -0.7548766732215881, -0.5993218421936035, -0.5763722062110901, -0.5152085423469543, ...]
     >,
     "var" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156647>
       [0.146584615111351, 0.10959020256996155, 0.1306970864534378, 0.11660075187683105, 0.11595187336206436, 0.11740252375602722, 0.13165895640850067, 0.18009184300899506, 0.12678903341293335, 0.12030621618032455, 0.11005813628435135, 0.12358298897743225, 0.1313392072916031, 0.12356364727020264, 0.11072297394275665, 0.12782984972000122, 0.11231722682714462, 0.11324699223041534, 0.12878009676933289, 0.10415193438529968, 0.13365718722343445, 0.1634305715560913, 0.1222558468580246, 0.1116553470492363, 0.10853931307792664, 0.12246934324502945, 0.11301521956920624, 0.13088425993919373, 0.1334567815065384, 0.1107645183801651, 0.13319867849349976, 0.15332292020320892, 0.12308048456907272, 0.13450288772583008, ...]
     >
   },
   "resnetv15_stage3_conv4_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[256][256][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155560>
       [
         [
           [
             [-7.654938381165266e-4, -0.0012541175819933414, -0.005619543604552746],
             [-0.00543149234727025, -0.015810055658221245, -0.004231226164847612],
             [0.0010035504819825292, 0.023871688172221184, 0.02238980121910572]
           ],
           [
             [-0.010763377882540226, 0.005733445752412081, 0.002162543823942542],
             [-0.019837820902466774, -0.008970159105956554, -0.011367014609277248],
             [-0.0250693429261446, -0.029408153146505356, -0.02924862876534462]
           ],
           [
             [0.0035870575811713934, -0.002172898268327117, -0.0031379780266433954],
             [0.003353904699906707, -0.00829745177179575, -0.023637400940060616],
             [-0.01191688235849142, -0.0015022619627416134, -0.010250404477119446]
           ],
           [
             [0.049969322979450226, 0.05117403715848923, 0.031013552099466324],
             [0.029666855931282043, 0.03048267588019371, 0.03743773698806763],
             [0.01695449836552143, 8.03108443506062e-4, -0.00333001627586782]
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_batchnorm0_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156554>
       [0.587593138217926, 0.29107263684272766, -0.024483349174261093, -0.6630364060401917, -0.0020227988716214895, 0.3022291362285614, 0.3730568587779999, 0.1112227588891983, 0.1520187109708786, 0.21198906004428864, 0.13707078993320465, 0.19141234457492828, -0.5249555706977844, 0.07064074277877808, 0.28787603974342346, -0.2420191913843155, 0.23204661905765533, 0.27727773785591125, 0.31336602568626404, -1.6729488561395556e-4, 0.49501875042915344, 0.23982594907283783, 0.2188287079334259, 0.21207115054130554, -0.21726736426353455, -0.024191003292798996, 0.4805299937725067, 0.3787311911582947, 0.5034685134887695, -0.0064132544212043285, 0.2908456027507782, 0.06416871398687363, 0.23073889315128326, 0.2649628818035126, 0.42389485239982605, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156553>
       [0.29138192534446716, 0.24767467379570007, 0.299111932516098, 0.5343009829521179, 6.391098140738904e-4, 0.18285895884037018, 0.22397305071353912, 0.17678862810134888, 0.20423470437526703, 0.1936219036579132, 0.18264399468898773, 0.2254352867603302, 0.4346472918987274, 0.2766549289226532, 0.2059396356344223, 0.2890668213367462, 0.22227691113948822, 0.22667959332466125, 0.2125527560710907, 4.306473783799447e-5, 0.25175368785858154, 0.22437728941440582, 0.17729178071022034, 0.2757891118526459, 0.3437325954437256, 0.27306893467903137, 0.29073598980903625, 0.27616509795188904, 0.2379094511270523, 0.0026047376450151205, 0.25673726201057434, 0.2776851952075958, 0.222115620970726, 0.17700907588005066, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156555>
       [-0.42671093344688416, 0.08226132392883301, 0.16757726669311523, 0.30075564980506897, -0.0022984968964010477, -0.0509272962808609, 0.19857972860336304, 0.009426109492778778, 0.005283120088279247, -0.027073703706264496, 0.02132471278309822, -0.037921857088804245, 0.20704242587089539, -0.0432727225124836, -0.08905208855867386, 0.12931209802627563, -0.09387306123971939, 0.03620840236544609, -0.09781206399202347, -1.6178679652512074e-4, 0.12961934506893158, -0.0259462408721447, -2.1653124713338912e-4, -0.012905667535960674, 0.16656464338302612, 0.09146969765424728, 0.15287327766418457, -0.17391763627529144, 0.12551893293857574, 0.002942846156656742, -0.08922877162694931, -0.006476830691099167, -0.08746246248483658, ...]
     >,
     "var" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156556>
       [11.652042388916016, 2.254652738571167, 3.4426052570343018, 5.669634819030762, 3.087691147811711e-4, 0.8677323460578918, 5.838933944702148, 0.6580311059951782, 1.241700291633606, 1.0077310800552368, 0.4037395119667053, 1.4956117868423462, 3.372952461242676, 9.26255989074707, 0.9500734210014343, 1.3466229438781738, 2.042525291442871, 1.6146833896636963, 2.1970999240875244, 1.5063529872350045e-6, 2.4043335914611816, 1.1075119972229004, 0.4450664520263672, 5.188594341278076, 2.5614442825317383, 4.420430660247803, 3.3879494667053223, 3.8978564739227295, 2.031447649002075, 5.072808125987649e-4, 2.158104658126831, 8.78343391418457, ...]
     >
   },
   "resnetv15_stage4_batchnorm2_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156630>
       [-0.3312325179576874, -0.12665832042694092, -0.17228902876377106, -0.24594725668430328, -0.1218721941113472, -0.26590457558631897, -0.1048421710729599, -0.15851233899593353, -0.1698925793170929, -0.1402788758277893, -0.19430601596832275, -0.22849872708320618, -0.1667681783437729, -0.2581608295440674, -0.16658757627010345, -0.22952330112457275, -0.22646163403987885, -0.2378488928079605, -0.1498619168996811, -0.17069348692893982, -0.1615811437368393, -0.16065584123134613, -0.2606816589832306, -0.17667390406131744, -0.1978839486837387, -0.20210157334804535, -0.271391898393631, -0.26092422008514404, -0.23841096460819244, -0.17240464687347412, -0.24755237996578217, -0.23081864416599274, -0.174147367477417, -0.1741199642419815, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156629>
       [0.2968880832195282, 0.11974726617336273, 0.23095574975013733, 0.206597700715065, 0.19574274122714996, 0.45377087593078613, 0.15695996582508087, 0.2316320240497589, 0.15276645123958588, 0.1638481467962265, 0.22738884389400482, 0.26710036396980286, 0.21389195322990417, 0.24456456303596497, 0.20493683218955994, 0.21701562404632568, 0.2413935512304306, 0.25599440932273865, 0.22501036524772644, 0.2222050577402115, 0.18122948706150055, 0.1987130492925644, 0.1930241882801056, 0.1878809779882431, 0.2042781263589859, 0.16571789979934692, 0.19552388787269592, 0.20186921954154968, 0.2906608581542969, 0.14263497292995453, 0.2719217836856842, 0.31874337792396545, 0.18274083733558655, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156631>
       [-0.0282656978815794, -0.05123039335012436, -0.08382279425859451, -0.01918616332113743, -0.06124699115753174, 0.16090667247772217, -0.012807008810341358, 0.07816866040229797, -0.025735970586538315, -0.013907958753407001, -0.0687464028596878, -0.06658604741096497, -0.05023999512195587, -0.04548171907663345, 0.020555036142468452, -0.03185397386550903, -0.036464568227529526, -0.07243824750185013, -0.010142830200493336, -0.04848286882042885, -0.08299148082733154, 0.02182731032371521, -0.0344371572136879, 0.021397847682237625, -0.10347319394350052, -0.030690331012010574, -0.01603761501610279, -0.05263519287109375, -0.13102418184280396, -0.0055511342361569405, -0.0668979063630104, -0.09267334640026093, ...]
     >,
     "var" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156632>
       [0.011962611228227615, 0.007065557409077883, 0.011405100114643574, 0.011682163923978806, 0.013524055480957031, 0.03168965131044388, 0.009958469308912754, 0.019135642796754837, 0.008647040463984013, 0.008019698783755302, 0.014810729771852493, 0.012140237726271152, 0.014805926010012627, 0.014166329987347126, 0.015744881704449654, 0.011752401478588581, 0.012508247047662735, 0.01193732675164938, 0.012897911481559277, 0.014396539889276028, 0.01063704863190651, 0.010911505669355392, 0.010317117907106876, 0.013082519173622131, 0.01175064779818058, 0.009017747826874256, 0.010166092775762081, 0.009667903184890747, 0.017266027629375458, 0.007492504082620144, 0.014234211295843124, ...]
     >
   },
   "resnetv15_stage4_batchnorm0_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156635>
       [-0.24155224859714508, -0.1655367612838745, -0.2362428903579712, -0.297939270734787, -0.13231845200061798, -0.15744264423847198, -0.18724729120731354, -0.2951382100582123, -0.148399218916893, -0.18559801578521729, -0.11932827532291412, -0.12623333930969238, -0.256923109292984, -0.044834282249212265, -0.2110227346420288, -0.2115551084280014, -0.11731667816638947, -0.1666031926870346, -0.20493711531162262, -0.19463776051998138, -0.29766085743904114, -0.1907205879688263, -0.20953336358070374, -0.3337366580963135, -0.23370732367038727, -0.1747748702764511, -0.1467113047838211, -0.08561372756958008, -0.20195676386356354, -0.29919254779815674, -0.20222018659114838, -0.2603137493133545, -0.08084195107221603, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156634>
       [0.25325247645378113, 0.21825657784938812, 0.24655881524085999, 0.27043378353118896, 0.22990275919437408, 0.25042709708213806, 0.25451406836509705, 0.30246832966804504, 0.2524814307689667, 0.28113940358161926, 0.2077207863330841, 0.20662568509578705, 0.2588883638381958, 0.20847131311893463, 0.26073822379112244, 0.2557273805141449, 0.19417521357536316, 0.2545725405216217, 0.2705022394657135, 0.30174484848976135, 0.27989354729652405, 0.252013236284256, 0.2637576758861542, 0.2910470962524414, 0.2766549289226532, 0.23044954240322113, 0.2085641622543335, 0.214538112282753, 0.22246207296848297, 0.2796212136745453, 0.24051904678344727, 0.2713375389575958, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156636>
       [-0.4336963891983032, -0.23883824050426483, -0.3521521985530853, -0.3526935279369354, -0.626591682434082, -0.41804012656211853, -0.5059647560119629, -0.5763117671012878, -0.4084964990615845, -0.30629763007164, -0.3367079496383667, -0.3472674489021301, -0.24112799763679504, -0.18936707079410553, -0.361521452665329, -0.5377254486083984, -0.3687479794025421, -0.5371721982955933, -0.5013487339019775, -0.23022377490997314, -0.38127467036247253, -0.45319679379463196, -0.4169219136238098, 0.5066828727722168, -0.3689904808998108, -0.24151581525802612, -0.2224670946598053, -0.4306512176990509, -0.2235100269317627, -0.3162861466407776, -0.30013954639434814, ...]
     >,
     "var" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156637>
       [0.10991121828556061, 0.0948372483253479, 0.10544309765100479, 0.08275268971920013, 0.12929925322532654, 0.1897469162940979, 0.11832831799983978, 0.16446325182914734, 0.1489732563495636, 0.1421491801738739, 0.09366630017757416, 0.10282783955335617, 0.11191682517528534, 0.21690978109836578, 0.108671173453331, 0.14515581727027893, 0.07476262003183365, 0.12735682725906372, 0.15100587904453278, 0.21550947427749634, 0.1079971045255661, 0.11900558322668076, 0.13415265083312988, 0.1892063021659851, 0.11596490442752838, 0.10914052277803421, 0.08730174601078033, 0.1574259251356125, 0.09958615899085999, 0.10460279881954193, ...]
     >
   },
   "resnetv15_stage2_batchnorm3_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156594>
       [-0.04395094886422157, -0.05701160803437233, -0.0784233883023262, -0.1836012452840805, -0.09642499685287476, -0.14476895332336426, -0.12382876127958298, -0.15487538278102875, -0.22984850406646729, -0.047572311013936996, -0.19638463854789734, -0.16662685573101044, -0.20483604073524475, -0.07941170781850815, -0.012142985127866268, -0.18818160891532898, -0.3211292326450348, -0.20370352268218994, -0.13551096618175507, -0.5240849852561951, -0.07249947637319565, -0.21951042115688324, -0.16655777394771576, 0.0053205834701657295, -0.18369482457637787, -0.05757158249616623, -0.09690945595502853, -0.10079992562532425, -0.11553001403808594, -0.24056051671504974, -0.14644218981266022, -0.08806241303682327, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156593>
       [0.22042763233184814, 0.2789342701435089, 0.24084916710853577, 0.29117926955223083, 0.28787434101104736, 0.29219886660575867, 0.2999396026134491, 0.282732218503952, 0.3327922523021698, 0.2556438446044922, 0.35115835070610046, 0.3411886692047119, 0.36218690872192383, 0.3221089839935303, 0.2933202087879181, 0.35309961438179016, 0.40377289056777954, 0.32451823353767395, 0.2937040627002716, 0.44771692156791687, 0.27920952439308167, 0.359043151140213, 0.32701441645622253, 0.302125483751297, 0.3154490292072296, 0.2536280155181885, 0.2527831792831421, 0.28608033061027527, 0.270442932844162, 0.3537032902240753, 0.3439619839191437, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156595>
       [0.5274529457092285, -0.13098309934139252, -0.37648239731788635, -0.28879842162132263, -0.21182002127170563, -0.37073177099227905, -0.19884878396987915, -0.2830484211444855, -0.15065154433250427, -0.20781072974205017, -0.4018034338951111, -0.23275986313819885, -0.17937761545181274, -0.4216316342353821, -0.8968116641044617, -0.5919016599655151, -0.26309365034103394, -0.30946412682533264, 0.011061749421060085, -0.9592186212539673, 0.13710038363933563, -0.3188667893409729, -0.30890756845474243, -0.5774483680725098, 0.057782769203186035, 0.7171685099601746, -0.1753111481666565, -0.3599262535572052, -0.24202103912830353, 0.09307456761598587, ...]
     >,
     "var" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156596>
       [0.1293395757675171, 0.24263884127140045, 0.12121682614088058, 0.1134759932756424, 0.2424165904521942, 0.18523693084716797, 0.15369771420955658, 0.11012681573629379, 0.11777694523334503, 0.15458980202674866, 0.1394628882408142, 0.17648904025554657, 0.19223524630069733, 0.25851839780807495, 0.3417447805404663, 0.16686971485614777, 0.1793210655450821, 0.13947534561157227, 0.15005792677402496, 0.14712779223918915, 0.21643760800361633, 0.22743462026119232, 0.21632032096385956, 0.4108874201774597, 0.14631399512290955, 0.1730966418981552, 0.19301067292690277, 0.22719143331050873, 0.11737871170043945, ...]
     >
   },
   "resnetv15_stage3_conv1_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[256][256][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155558>
       [
         [
           [
             [0.01419223751872778, 0.016100922599434853, 0.0048361849039793015],
             [0.006055143196135759, 0.013857746496796608, -0.0010814927518367767],
             [-4.158224619459361e-4, -0.01594977080821991, -0.014827833510935307]
           ],
           [
             [-0.00951190385967493, 0.01324904803186655, 0.0015549632953479886],
             [-0.020943475887179375, 0.03341425582766533, 0.018300076946616173],
             [-0.008326533250510693, 0.051841672509908676, 0.003323822747915983]
           ],
           [
             [0.014539403840899467, -0.008780326694250107, 0.011811011470854282],
             [0.02091040089726448, 0.010964253917336464, 0.012329227291047573],
             [-7.504939567297697e-4, 0.019712241366505623, -0.001082635368220508]
           ],
           [
             [-0.022622067481279373, 0.010965055786073208, 0.028470303863286972],
             [0.0023461945820599794, ...],
             ...
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_dense0_fwd" => %{
     "bias" => #Nx.Tensor<
       f32[1000]
       EXLA.Backend<host:0, 0.1909074504.761397290.156654>
       [-0.014516017399728298, 0.008977323770523071, -0.01756366901099682, -0.022805534303188324, 0.005514263641089201, -0.0023895285557955503, -0.006300796288996935, 0.003997286316007376, -0.009898905642330647, -0.013384408317506313, -0.008494910784065723, -0.007285325787961483, -0.01696144975721836, -0.011042668484151363, -0.009525335393846035, -0.002408474450930953, 0.005191809963434935, -0.01025440264493227, 0.008521326817572117, -0.01924849860370159, -0.009740181267261505, 0.0026285266503691673, 0.018570279702544212, -0.005831103306263685, -0.004423247650265694, 0.00971891637891531, 0.01473058108240366, -3.316114016342908e-4, 0.006712410598993301, 0.010385870933532715, ...]
     >,
     "kernel" => #Nx.Tensor<
       f32[512][1000]
       EXLA.Backend<host:0, 0.1909074504.761397274.155567>
       [
         [0.05392485484480858, 0.029603246599435806, 0.11962364614009857, 0.1488860696554184, 0.05104931443929672, 0.06791471689939499, 0.025444863364100456, 0.1517402082681656, 0.029227975755929947, -0.11503010988235474, -0.11755800992250443, -0.038904037326574326, 0.03844360634684563, -0.06780872493982315, -0.039154041558504105, 0.014898867346346378, 0.03663166984915733, 0.015704037621617317, -0.06713414937257767, -0.041684601455926895, 0.036668721586465836, 0.13441477715969086, 0.010147671215236187, -0.02641906961798668, 0.23699522018432617, -0.04432240501046181, -0.03596866503357887, 0.009027269668877125, 0.04733157530426979, ...],
         ...
       ]
     >
   },
   "resnetv15_stage2_batchnorm4_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156599>
       [-0.3621666133403778, 0.004522890318185091, -0.07879718393087387, -0.11537926644086838, -0.2815950810909271, -0.2920692265033722, -0.4337766170501709, -0.24400141835212708, -0.10778523981571198, -0.15662981569766998, -0.14692211151123047, 0.12659138441085815, -0.04114118218421936, -0.059445831924676895, -0.11475466191768646, -0.03250168636441231, -0.04536732658743858, -0.17520473897457123, -0.17804287374019623, -0.3663465678691864, -0.18978442251682281, -0.18216446042060852, -0.12076754868030548, -0.14121975004673004, -0.0767010822892189, -0.38803669810295105, -0.06674090027809143, 0.061076100915670395, -0.4311618506908417, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156598>
       [0.5986339449882507, 0.11569047719240189, 0.1611069291830063, 0.5185135006904602, 0.4424709975719452, 0.4653591513633728, 0.5269555449485779, 0.30571815371513367, 0.30407094955444336, 0.24878719449043274, 0.1747891753911972, 0.32633328437805176, 0.31816014647483826, 0.20030631124973297, 0.23404809832572937, 0.2462226003408432, 0.42545458674430847, 0.28341391682624817, 0.15671657025814056, 0.3792104423046112, 0.4349070191383362, 0.2157992273569107, 0.22062398493289948, 0.3794603943824768, 0.08183980733156204, 0.5290737748146057, 0.555567741394043, 0.2849140465259552, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156600>
       [-0.083211250603199, 0.02946513518691063, 0.08581072092056274, -0.19361701607704163, 0.023598523810505867, -0.216515451669693, -0.2958885431289673, -0.03162626922130585, -0.11774782091379166, -0.09672611951828003, -0.17841775715351105, -0.17631953954696655, -0.09393623471260071, -0.15819281339645386, 0.00532991299405694, -0.2360677868127823, -0.40538081526756287, -0.2005082219839096, 0.03532950207591057, -0.13115617632865906, -0.15865390002727509, -0.12766976654529572, -0.10528843104839325, -0.06915920227766037, -0.09979267418384552, -0.12045887857675552, -0.4557574987411499, ...]
     >,
     "var" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156601>
       [0.05690556392073631, 0.01900484599173069, 0.02873336523771286, 0.07030436396598816, 0.05602714419364929, 0.035205114632844925, 0.0759160965681076, 0.034588612616062164, 0.04513872042298317, 0.025914285331964493, 0.026329604908823967, 0.0652218759059906, 0.05036775767803192, 0.028931990265846252, 0.033216554671525955, 0.0422186516225338, 0.06010064110159874, 0.05931312218308449, 0.028619514778256416, 0.032049570232629776, 0.05494242534041405, 0.02020711824297905, 0.028605826199054718, 0.04322804510593414, 0.018985632807016373, 0.0512661412358284, ...]
     >
   },
   "resnetv15_stage3_conv2_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[256][128][1][1]
       EXLA.Backend<host:0, 0.1909074504.761397274.155556>
       [
         [
           [
             [0.018013833090662956]
           ],
           [
             [-0.07341165095567703]
           ],
           [
             [-0.04026216268539429]
           ],
           [
             [0.028528781607747078]
           ],
           [
             [-0.019993074238300323]
           ],
           [
             [0.04533904418349266]
           ],
           [
             [-0.06998885422945023]
           ],
           [
             [-3.9746990660205483e-4]
           ],
           [
             [0.040357813239097595]
           ],
           [
             [-0.022985238581895828]
           ],
           [
             [-0.02928733639419079]
           ],
           [
             [0.0478060320019722]
           ],
           [
             [-0.0049891690723598]
           ],
           [
             [0.06426215916872025]
           ],
           [
             [-0.028886795043945312]
           ],
           [
             [0.0685325637459755]
           ],
           [
             [0.024257946759462357]
           ],
           [
             [0.0018382014241069555]
           ],
           [
             [0.03494932875037193]
           ],
           [
             [-0.01751917600631714]
           ],
           [
             [0.002307106973603368]
           ],
           [
             [-0.007347475737333298]
           ],
           [
             [-0.05744224414229393]
           ],
           [
             [-0.029467521235346794]
           ],
           [
             [0.023255769163370132]
           ],
           [
             [-0.020194588229060173]
           ],
           [
             [0.021703558042645454]
           ],
           [
             [0.04024609550833702]
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage3_batchnorm4_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156625>
       [-0.11685841530561447, -0.17474272847175598, -0.2810176610946655, 0.009556620381772518, -0.27940356731414795, -0.2790069580078125, -0.0672529935836792, -0.2624538242816925, -0.07640797644853592, 0.07620832324028015, 0.06316999346017838, -0.2319391667842865, -0.23469173908233643, -0.2732333838939667, 0.004756692331284285, -0.18676911294460297, -0.006132133770734072, -0.28174278140068054, -0.2645944654941559, -0.13453911244869232, -0.2502969205379486, -0.17973540723323822, -0.25024178624153137, -0.05835064500570297, -0.3268739879131317, 0.060364268720149994, -0.11470179259777069, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156624>
       [0.24193939566612244, 0.3297259509563446, 0.22800567746162415, 0.23109900951385498, 0.3586515188217163, 0.296141117811203, 0.12065333127975464, 0.23136283457279205, 0.22824743390083313, 0.170188769698143, 0.18873976171016693, 0.30588647723197937, 0.38015884160995483, 0.24270343780517578, 0.0870261862874031, 0.2231374979019165, 0.09912992268800735, 0.2474382221698761, 0.3564615547657013, 0.43970420956611633, 0.20691834390163422, 0.2939641773700714, 0.3841531574726105, 0.40648627281188965, 0.391285240650177, 0.16587932407855988, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156626>
       [-0.1543675661087036, -0.12313710898160934, -0.05812518298625946, -0.021678585559129715, -0.09479895234107971, -0.13945265114307404, -0.027440929785370827, -0.0830509215593338, -0.048501282930374146, -0.18216374516487122, -0.024577589705586433, -0.08555333316326141, -0.10340044647455215, -0.044444017112255096, -0.022757673636078835, 0.1536872237920761, 0.018250761553645134, -0.1063910648226738, -0.07801215350627899, -0.20411869883537292, 0.0066182552836835384, -0.17187662422657013, -0.18709096312522888, -0.3429386615753174, -0.13010455667972565, ...]
     >,
     "var" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156627>
       [0.01753869652748108, 0.021231841295957565, 0.009062809869647026, 0.015554644167423248, 0.02145841158926487, 0.015902459621429443, 0.009992172941565514, 0.013123467564582825, 0.015161799266934395, 0.020521005615592003, 0.01721145398914814, 0.016472985967993736, 0.018205147236585617, 0.011602806858718395, 0.007568830158561468, 0.01706477254629135, 0.009285100735723972, 0.011213717982172966, 0.016172518953680992, 0.03704923391342163, 0.01593053713440895, 0.02172703668475151, 0.02103578858077526, 0.044850386679172516, ...]
     >
   },
   "resnetv15_stage4_conv1_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[512][512][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155563>
       [
         [
           [
             [-0.027957575395703316, -0.019059283658862114, -0.014456323347985744],
             [0.002509977901354432, -0.008105172775685787, -0.0032372944988310337],
             [-0.003681754693388939, -0.015594051219522953, -0.0069901118986308575]
           ],
           [
             [-0.01640176773071289, -0.013426140882074833, -0.014672650024294853],
             [-0.009348432533442974, -0.015524924732744694, -0.008392270654439926],
             [0.01765734888613224, 0.0322110690176487, 0.031084787100553513]
           ],
           [
             [-0.015190839767456055, -0.010472857393324375, -0.011150700971484184],
             [-0.018579160794615746, 7.919403724372387e-4, 0.0027964734472334385],
             [-0.014656782150268555, -0.016046730801463127, ...]
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage2_batchnorm0_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156584>
       [-0.08128590136766434, -0.058626439422369, 0.019257158041000366, 0.09710581600666046, -0.05943477898836136, -0.021473992615938187, -0.11035644263029099, 0.00259335245937109, -0.047750357538461685, -0.07497038692235947, -0.06905713677406311, -0.08176127821207047, -0.12185609340667725, -0.01995314471423626, -0.0735180601477623, -0.06685391813516617, -0.045599039644002914, -0.13863492012023926, -0.06689149886369705, -0.04790952429175377, 4.972931346856058e-4, -0.013107233680784702, -0.09481953084468842, -0.07576694339513779, -0.03680161014199257, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156583>
       [0.3259434998035431, 0.2876892387866974, 0.2572369873523712, 0.2471320629119873, 0.30606892704963684, 0.30388930439949036, 0.26268360018730164, 0.26726123690605164, 0.30057862401008606, 0.31101885437965393, 0.3351903259754181, 0.3182835280895233, 0.3283501863479614, 0.3042004406452179, 0.33199045062065125, 0.2909865081310272, 0.2818000614643097, 0.34818387031555176, 0.252461701631546, 0.2725345194339752, 0.271053284406662, 0.29021432995796204, 0.3284207284450531, 0.29044225811958313, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156585>
       [-0.35513925552368164, -0.827293872833252, -0.5598382353782654, -1.367710828781128, -0.19600524008274078, -0.7544761300086975, -0.8823570013046265, -0.36386626958847046, -0.5853767991065979, -0.1681542694568634, -0.1035887598991394, -0.07869160920381546, -0.3306775987148285, -0.47895485162734985, -0.4790283739566803, -0.7762764692306519, -0.3897761106491089, -0.4695548117160797, -1.0567861795425415, 0.30824995040893555, -0.3809780478477478, -0.8286125063896179, -0.3496479392051697, ...]
     >,
     "var" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156586>
       [0.5349592566490173, 0.4299734830856323, 0.3635936379432678, 1.2503166198730469, 0.5360496044158936, 0.7365655899047852, 0.3095395267009735, 0.6329663991928101, 0.503640353679657, 0.5982130169868469, 0.6653233170509338, 0.551180899143219, 0.4741606116294861, 0.7052844762802124, 0.5223845839500427, 0.4860941469669342, 0.7665867805480957, 0.4872332513332367, 0.43669643998146057, 0.35961654782295227, 0.5229731202125549, 0.4860832691192627, ...]
     >
   },
   "resnetv15_stage3_batchnorm1_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156615>
       [0.010692477226257324, -0.04125773906707764, -0.12367366254329681, -0.02065807580947876, -0.07538139820098877, 0.04930815100669861, 0.05527028068900108, -0.018517710268497467, 0.03215691074728966, 0.01712210290133953, -0.048085715621709824, -0.05197107419371605, -0.10435468703508377, -0.07371296733617783, 0.05700621381402016, 0.004412811249494553, 0.03053240291774273, -0.08806097507476807, -0.1246338039636612, -0.06346801668405533, 0.0731622651219368, -0.04949784651398659, -0.04361501708626747, -0.10988782346248627, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156614>
       [0.2701602280139923, 0.39142104983329773, 0.33358073234558105, 0.26790115237236023, 0.38863909244537354, 0.2845604121685028, 0.18784329295158386, 0.2716767489910126, 0.2594466209411621, 0.22086408734321594, 0.2587709426879883, 0.325224906206131, 0.4436357319355011, 0.31567609310150146, 0.20151101052761078, 0.24047304689884186, 0.22428105771541595, 0.32561561465263367, 0.355813205242157, 0.3424791097640991, 0.22149528563022614, 0.3102473318576813, 0.337135910987854, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156616>
       [-0.1208229511976242, -0.14651718735694885, -0.06613209843635559, -0.09581898897886276, -0.20560236275196075, -0.0045504383742809296, -0.09243973344564438, -0.1029941663146019, -0.4632074534893036, -0.4269793927669525, 0.024528538808226585, -0.23047272861003876, -0.2023988664150238, -0.06804023683071136, -0.011881696060299873, -0.0033510015346109867, 0.01469399407505989, 0.0045888787135481834, -0.28219109773635864, -0.1049884706735611, -0.19582359492778778, -0.13115519285202026, ...]
     >,
     "var" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156617>
       [0.07006558775901794, 0.12821190059185028, 0.036692626774311066, 0.07283742725849152, 0.10209156572818756, 0.11933022737503052, 0.050299905240535736, 0.0685155987739563, 0.06911278516054153, 0.07919430732727051, 0.052020516246557236, 0.06369984894990921, 0.11134789884090424, 0.04916424676775932, 0.06871239095926285, 0.05967267230153084, 0.08594197779893875, 0.045836348086595535, 0.055767569690942764, 0.07292734086513519, 0.07837260514497757, ...]
     >
   },
   "resnetv15_stage2_conv4_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[128][128][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155555>
       [
         [
           [
             [-0.011238896287977695, -0.06532904505729675, -0.037422988563776016],
             [0.027119547128677368, -0.07054231315851212, -0.014727586880326271],
             [0.07467161864042282, -0.0019802332390099764, -0.00862919632345438]
           ],
           [
             [-0.015134722925722599, 0.03120115026831627, 0.06329355388879776],
             [-0.05205101519823074, 0.014423750340938568, 0.052598387002944946],
             [-0.01463844534009695, 0.011968983337283134, 0.0353945828974247]
           ],
           [
             [-0.025951042771339417, -0.02432739920914173, 0.009584699757397175],
             [-0.008627589792013168, -0.016249559819698334, ...],
             ...
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage2_conv0_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[128][64][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155552>
       [
         [
           [
             [-0.009047268889844418, 0.004512330517172813, 0.012734277173876762],
             [-0.04045099392533302, 0.030612675473093987, -0.04034426435828209],
             [-0.001980394357815385, 0.037391919642686844, -0.034454260021448135]
           ],
           [
             [-0.0031767175532877445, 0.026091335341334343, -0.013485043309628963],
             [-0.00898613128811121, 0.0038133913185447454, -0.002884469460695982],
             [-0.03228029981255531, 0.046299047768116, 0.014937303960323334]
           ],
           [
             [8.434235351160169e-4, 0.019833005964756012, -0.02017982490360737],
             [0.012309701181948185, ...],
             ...
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage2_batchnorm2_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156579>
       [-0.06712693721055984, 0.04884012043476105, 0.12086392939090729, -0.07154455035924911, -0.07156413793563843, -0.04221009835600853, 0.10512065142393112, 0.0969671681523323, 0.00497826561331749, 0.10426348447799683, 0.03755638375878334, 0.023956315591931343, -0.030488045886158943, 0.06632853299379349, -0.004831552039831877, 0.019802646711468697, -0.11444760113954544, 0.009140939451754093, 0.06953513622283936, -0.07613534480333328, 0.008831397630274296, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156578>
       [0.15913204848766327, 0.17548692226409912, 0.2012660652399063, 0.11328452080488205, 0.13310621678829193, 0.13953398168087006, 0.10680638253688812, 0.02569027617573738, 0.19395019114017487, 0.13502173125743866, 0.2177240550518036, 0.02336437627673149, 0.08145945519208908, 0.19000104069709778, 0.15815438330173492, 0.18759936094284058, 0.11220957338809967, 0.2712390124797821, 0.2214273065328598, 0.14069710671901703, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156580>
       [-0.27274879813194275, 0.2418554276227951, -0.46523982286453247, 0.0851946622133255, -0.2590768039226532, 0.03093763068318367, -0.10104981064796448, 0.07193934172391891, -0.17125928401947021, -0.0986124649643898, -0.34529590606689453, 0.07771048694849014, -0.38620471954345703, 0.018493708223104477, -0.23791465163230896, 0.332027792930603, -0.39268332719802856, 0.25666874647140503, -0.035902634263038635, ...]
     >,
     "var" => #Nx.Tensor<
       f32[128]
       EXLA.Backend<host:0, 0.1909074504.761397290.156581>
       [0.08016509562730789, 0.12624269723892212, 0.11194305121898651, 0.03165494650602341, 0.0412445031106472, 0.051635101437568665, 0.03274092078208923, 0.008281323127448559, 0.06534218788146973, 0.061551809310913086, 0.08092083036899567, 0.008930547162890434, 0.03453747183084488, 0.07588431239128113, 0.08613869547843933, 0.08010461926460266, 0.028784237802028656, 0.13911503553390503, ...]
     >
   },
   "resnetv15_stage4_conv3_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[512][512][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155564>
       [
         [
           [
             [-0.016800375655293465, -0.011469701305031776, -0.00872033927589655],
             [9.476878913119435e-4, -0.006984044332057238, -0.001885177451185882],
             [0.013132847845554352, 0.002815097803249955, 0.013542795553803444]
           ],
           [
             [0.041471417993307114, 0.04367503523826599, 0.038953427225351334],
             [0.009557894431054592, 0.008674327284097672, 0.003928501624614],
             [-0.015430220402777195, -0.0116095170378685, -0.018892943859100342]
           ],
           [
             [0.004969494882971048, -0.006368243135511875, ...],
             ...
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage3_batchnorm2_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156604>
       [0.010692477226257324, -0.04125773906707764, -0.12367366254329681, -0.02065807580947876, -0.07538139820098877, 0.04930815100669861, 0.05527028068900108, -0.018517710268497467, 0.03215691074728966, 0.01712210290133953, -0.048085715621709824, -0.05197107419371605, -0.10435468703508377, -0.07371296733617783, 0.05700621381402016, 0.004412811249494553, 0.03053240291774273, -0.08806097507476807, -0.1246338039636612, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156603>
       [0.09080582112073898, 0.03905678167939186, 0.15975965559482574, 0.046096231788396835, 0.08688437938690186, 0.063653863966465, 0.11143629997968674, 0.09391072392463684, 0.04387209191918373, 0.0659412145614624, 0.06723270565271378, 0.06520146876573563, 0.04149414226412773, 0.1437389850616455, 0.04682902246713638, 0.11796601116657257, 0.05874079838395119, 0.1694187968969345, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156605>
       [0.13062268495559692, -0.08343728631734848, -0.21410530805587769, -0.07355433702468872, -0.08937449008226395, -0.10730555653572083, 0.06822583079338074, 0.05729565769433975, -0.031057637184858322, 0.2264973521232605, -0.07070206850767136, -0.032183289527893066, -0.03716294467449188, -0.051594123244285583, 0.07180161774158478, -0.020916743203997612, 0.005523259751498699, ...]
     >,
     "var" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156606>
       [0.021337775513529778, 0.005282795522361994, 0.01706477254629135, 0.00652682688087225, 0.013983880169689655, 0.015725890174508095, 0.02301640994846821, 0.014888675883412361, 0.007054580375552177, 0.015593364834785461, 0.010350418277084827, 0.010896195657551289, 0.007803055457770824, 0.018402637913823128, 0.007391696330159903, 0.02523915283381939, ...]
     >
   },
   "resnetv15_stage4_conv0_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[512][256][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155562>
       [
         [
           [
             [-0.016711799427866936, -0.015728861093521118, 0.001950560137629509],
             [-0.01858464442193508, -0.01003581564873457, -0.010342231951653957],
             [-0.010438058525323868, 0.0036442612763494253, -0.006362196523696184]
           ],
           [
             [-0.0038456281181424856, -0.007519946433603764, -2.492387138772756e-4],
             [0.008252915926277637, -0.006952244322746992, 9.825262241065502e-4],
             [-0.014622555114328861, -0.03331390395760536, -0.006622023414820433]
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage1_conv3_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[64][64][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155550>
       [
         [
           [
             [0.032543573528528214, 0.016670912504196167, 0.01889680325984955],
             [0.03727031871676445, -0.0018695127218961716, 0.01431198325008154],
             [0.04716675728559494, 0.019355408847332, 0.028984231874346733]
           ],
           [
             [-0.026857523247599602, -1.2814865840482526e-5, -0.007149054668843746],
             [0.011508463881909847, 0.02320995181798935, 0.009674125351011753],
             [0.009768263436853886, 5.767777911387384e-4, ...]
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage4_conv2_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[512][256][1][1]
       EXLA.Backend<host:0, 0.1909074504.761397274.155561>
       [
         [
           [
             [0.011229150928556919]
           ],
           [
             [0.019238075241446495]
           ],
           [
             [-0.002623265143483877]
           ],
           [
             [0.014152259565889835]
           ],
           [
             [0.02339213900268078]
           ],
           [
             [0.0013205230934545398]
           ],
           [
             [-0.027431201189756393]
           ],
           [
             [0.014291135594248772]
           ],
           [
             [0.07028329372406006]
           ],
           [
             [-0.0012591007398441434]
           ],
           [
             [-0.02935127727687359]
           ],
           [
             [0.004806073848158121]
           ],
           [
             [-7.295550312846899e-4]
           ],
           [
             [0.002717585302889347]
           ],
           [
             [0.020743558183312416]
           ],
           [
             [-0.017851514741778374]
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage4_batchnorm4_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156650>
       [0.29839834570884705, 0.2834465801715851, 0.37828537821769714, 0.30457112193107605, 0.26241275668144226, 0.13238953053951263, 0.28889259696006775, 0.24859103560447693, 0.25562605261802673, 0.4312242865562439, 0.28197792172431946, 0.39689862728118896, 0.30176594853401184, 0.26086804270744324, 0.26783645153045654, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156649>
       [1.8617608547210693, 1.6679459810256958, 1.7603156566619873, 1.8510187864303589, 1.8655521869659424, 1.8277837038040161, 1.7890766859054565, 1.7882192134857178, 1.8499443531036377, 1.8895186185836792, 1.8300055265426636, 1.9134618043899536, 1.9050825834274292, 1.872599720954895, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156651>
       [-0.03549177944660187, -0.0039099836722016335, -0.019524360075592995, -8.268942474387586e-4, -0.008532573468983173, 0.04741824045777321, -0.012827688828110695, -0.03727615624666214, -0.018805066123604774, -0.039054300636053085, -0.039793647825717926, -0.05425969511270523, -0.029270131140947342, ...]
     >,
     "var" => #Nx.Tensor<
       f32[512]
       EXLA.Backend<host:0, 0.1909074504.761397290.156652>
       [0.010464047081768513, 0.009128118865191936, 0.009239805862307549, 0.01165322121232748, 0.009918089024722576, 0.011912747286260128, 0.01002173125743866, 0.010961075313389301, 0.010664282366633415, 0.010956396348774433, 0.011787171475589275, 0.011072554625570774, ...]
     >
   },
   "resnetv15_stage1_batchnorm2_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156569>
       [-0.7485178709030151, -0.1663590669631958, -0.03892993554472923, -0.0772387757897377, -0.07333818823099136, -0.15288524329662323, -0.2606365978717804, -0.39575326442718506, -0.3605923652648926, -0.4852154552936554, -0.3737225830554962, -0.00435051741078496, 0.06745114177465439, 0.003364883828908205, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156568>
       [0.5238097310066223, 0.3495059013366699, 0.3053877055644989, 0.3628399968147278, 0.34861689805984497, 0.2918603718280792, 0.34413474798202515, 0.38352155685424805, 0.46793100237846375, 0.39869287610054016, 0.4001026153564453, 0.26115214824676514, 0.169174924492836, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156570>
       [-0.7500556707382202, -1.1872758865356445, -1.8939886093139648, -1.274788737297058, -2.2394418716430664, -1.2854626178741455, 0.10081827640533447, -0.030943986028432846, -1.881779432296753, -0.9787175059318542, -1.2177609205245972, -0.530941367149353, ...]
     >,
     "var" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156571>
       [0.1614823192358017, 0.5241051316261292, 0.6152471303939819, 0.7954678535461426, 1.0039441585540771, 0.35622885823249817, 0.2858514189720154, 0.38904309272766113, 0.8245828747749329, 0.1963333785533905, 0.2749897539615631, ...]
     >
   },
   "resnetv15_stage1_conv1_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[64][64][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155548>
       [
         [
           [
             [0.01871308870613575, -0.031842559576034546, 0.024749312549829483],
             [-0.016241757199168205, -0.05760044604539871, 0.016969142481684685],
             [0.007869287393987179, -0.0036844799760729074, 0.040698353201150894]
           ],
           [
             [0.009184181690216064, 0.023880526423454285, -0.01875920780003071],
             [0.06694190949201584, ...],
             ...
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage1_batchnorm1_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156564>
       [-0.040120963007211685, -0.3170172870159149, -0.04241752251982689, -0.5802510380744934, 0.26239946484565735, 0.3017888367176056, -0.18110309541225433, -0.1285313218832016, 0.3209875524044037, 0.2281520664691925, -0.17817941308021545, 0.08335805684328079, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156563>
       [0.49402374029159546, 0.5134744644165039, 0.2537424862384796, 0.3116507828235626, 0.4744444489479065, 0.45202118158340454, 0.4324341118335724, 0.49336618185043335, 0.2106447070837021, 0.2561410665512085, 0.33924317359924316, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156565>
       [0.00331737007945776, 0.27468928694725037, -0.38905030488967896, 0.05364706739783287, -0.3384496867656708, -0.30531883239746094, 0.46344324946403503, -0.03333354368805885, 0.07025309652090073, 0.1587822288274765, ...]
     >,
     "var" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156566>
       [0.24737980961799622, 0.06390736997127533, 0.052232787013053894, 0.015203788876533508, 0.0988045483827591, 0.22388330101966858, 0.1739601045846939, 0.07253564894199371, 0.07306408882141113, ...]
     >
   },
   "resnetv15_stage4_conv4_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[512][512][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155565>
       [
         [
           [
             [-0.015217610634863377, -0.011189159005880356, -0.014019230380654335],
             [-0.015381508506834507, -0.010292046703398228, -0.014651701785624027],
             [-0.013440364971756935, -0.00985556561499834, -0.011614901944994926]
           ],
           [
             [0.01829547993838787, 0.013575977645814419, ...],
             ...
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage1_conv0_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[64][64][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155547>
       [
         [
           [
             [0.043822888284921646, 0.062267836183309555, -0.006844627670943737],
             [0.09769172221422195, 0.07716245204210281, -0.018926994875073433],
             [0.03232939913868904, 0.04561552405357361, -0.03801621124148369]
           ],
           [
             [0.038107600063085556, ...],
             ...
           ],
           ...
         ],
         ...
       ]
     >
   },
   "resnetv15_stage1_batchnorm0_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156559>
       [0.1948392689228058, 0.16296766698360443, -0.09230189025402069, -0.35222509503364563, 0.15753422677516937, -0.15709419548511505, 0.11483567208051682, 0.07835886627435684, 0.11399303376674652, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156558>
       [0.19410167634487152, 0.31050190329551697, 0.23076966404914856, 0.41234782338142395, 0.20157073438167572, 0.467096745967865, 0.22827579081058502, 0.3384336233139038, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156560>
       [0.404837429523468, -0.2394668012857437, 0.7167940139770508, -0.675224781036377, -0.7786844372749329, -1.2702536582946777, 0.2588159441947937, ...]
     >,
     "var" => #Nx.Tensor<
       f32[64]
       EXLA.Backend<host:0, 0.1909074504.761397290.156561>
       [0.08670833706855774, 0.26689794659614563, 0.16378606855869293, 0.1099817156791687, 0.13851839303970337, 0.7126830220222473, ...]
     >
   },
   "resnetv15_stage3_batchnorm0_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156609>
       [-0.09120768308639526, -0.007152423728257418, -0.07391073554754257, -0.2816636264324188, -0.10459817945957184, -0.1683277040719986, 0.01626509241759777, -0.07259050756692886, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156608>
       [0.27343717217445374, 0.22024916112422943, 0.25931403040885925, 0.3606833219528198, 0.2795335054397583, 0.30611369013786316, 0.22057434916496277, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156610>
       [-0.5810739994049072, -0.028193168342113495, -0.09040157496929169, -0.6935681104660034, -0.1618105173110962, -0.5318779945373535, ...]
     >,
     "var" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156611>
       [0.13277746737003326, 0.13704648613929749, 0.2576930522918701, 0.1827121078968048, 0.2004612386226654, ...]
     >
   },
   "resnetv15_stage3_batchnorm3_fwd" => %{
     "beta" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156620>
       [-0.08134147524833679, -0.05202662944793701, -0.05989963561296463, -0.1400786191225052, -0.3466731309890747, -0.13203097879886627, -0.2742483615875244, ...]
     >,
     "gamma" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156619>
       [0.1920032650232315, 0.20267318189144135, 0.1787775754928589, 0.24087002873420715, 0.3335247337818146, 0.21728456020355225, ...]
     >,
     "mean" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156621>
       [-0.38270992040634155, -1.0034687519073486, -0.21975059807300568, 0.1490575671195984, -0.6650262475013733, ...]
     >,
     "var" => #Nx.Tensor<
       f32[256]
       EXLA.Backend<host:0, 0.1909074504.761397290.156622>
       [0.09810656309127808, 0.13605093955993652, 0.09942719340324402, 0.10358069837093353, ...]
     >
   },
   "resnetv15_stage2_conv3_fwd" => %{
     "kernel" => #Nx.Tensor<
       f32[128][128][3][3]
       EXLA.Backend<host:0, 0.1909074504.761397274.155554>
       [
         [
           [
             [0.015774188563227654, 0.053117070347070694, -0.02352462336421013],
             [0.02808522991836071, 0.11933763325214386, -0.01605604775249958],
             ...
           ],
           ...
         ],
         ...
       ]
     >
   }
 }}
File.rm("greatwhiteshark_157273892.jpg")

data =
  Download.from("https://www.collinsdictionary.com/images/full/greatwhiteshark_157273892.jpg")
  |> elem(1)
  |> File.read!()

Kino.Image.new(data, :jpeg)
nx_image =
  data
  |> StbImage.read_binary!()
  |> StbImage.resize(224, 224)
  |> StbImage.to_nx()

nx_channels =
  nx_image
  |> Nx.axis_size(2)

tensor =
  case nx_channels do
    3 -> nx_image
    4 -> Nx.slice(nx_image, [0, 0, 0], [224, 224, 3])
  end
  |> Nx.divide(255)
  |> Nx.subtract(Nx.tensor([0.485, 0.456, 0.406]))
  |> Nx.divide(Nx.tensor([0.229, 0.224, 0.225]))
  |> Nx.transpose()
  |> Nx.new_axis(0)

Axon.predict(model, params, tensor)
|> Nx.flatten()
|> Nx.argsort()
|> Nx.reverse()
|> Nx.slice([0], [5])
|> Nx.to_flat_list()
|> Enum.with_index()
|> Enum.map(fn {no, index} -> {index, Map.get(classes, to_string(no))} end)
[
  {0, ["n01491361", "tiger_shark"]},
  {1, ["n01484850", "great_white_shark"]},
  {2, ["n01494475", "hammerhead"]},
  {3, ["n01496331", "electric_ray"]},
  {4, ["n02074367", "dugong"]}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment