profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/polvalente/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Paulo Valente polvalente stone-payments Electronics and Computer Engineer, software developer and musician.

polvalente/functional-programming-concepts 6

Introdução a Programação Funcional

polvalente/gen_regex 3

Generate valid strings for a given Regular Expression in Elixir

polvalente/ex_spice 2

SPICE Simulator with Phoenix + Nx

lucaslrolim/DeuRuim 0

Hackathon UFRJ 2016

polvalente/AtomVM 0

Tiny Erlang VM

polvalente/bakeware 0

SpawnFest 2020 - Your description here..!

polvalente/banking-api-challenge 0

This repository is meant to store my solution to the challenge proposed by the PFE on Stone.

polvalente/basecamp-essentials 0

Opinionated features to increase your productivity with basecamp

polvalente/ChexDigits 0

Elixir lib to generate/validate various numbers with checking digits or checksums

polvalente/copeiro 0

The Copeiro package provides assertion functions that will enhance your testing experience

pull request commentelixir-nx/nx

fix: handle tall/wide b matrix on tri solve

@dognotdog could you test this branch to see if it actually solves your problem? If it doesn't I think I'll rework the implementation later this week.

I've added tests for both tall and wide matrices with different params, but I might have missed some combos

polvalente

comment created time in 10 hours

PR opened elixir-nx/nx

fix: handle tall/wide b matrix on tri solve

This is an attempt to fix the Nx.LinAlg.triangular_solve BinaryBackend implementation, as reported on #473

closes #473

+39 -17

0 comment

3 changed files

pr created time in 10 hours

create barnchelixir-nx/nx

branch : pv-fix/handle-tall-and-wide-b-tri-solve

created branch time in 10 hours

issue commentelixir-nx/nx

Nx.LinAlg, Nx.BinaryBackend.triangular_solve B-argument shape mismatch

@dognotdog I can work on this :)

The actual implementation for triangular_solve ended up being a little more convoluted than it should be. Perhaps this is an opportunity to refactor it.

dognotdog

comment created time in 10 hours

PullRequestReviewEvent

delete branch elixir-nx/nx

delete branch : pv-feat/add-take-grad

delete time in 21 hours

delete branch elixir-nx/nx

delete branch : pv-feat/add-gather-grad

delete time in 21 hours

push eventelixir-nx/nx

Paulo Valente

commit sha b07ee53b96b7e4ae07e4a0e6619c2cad61dee767

feat: add gather grad (#467)

view details

push time in 21 hours

PR merged elixir-nx/nx

Reviewers
feat: add gather grad

Adds the grad for Nx.gather

+112 -0

0 comment

2 changed files

polvalente

pr closed time in 21 hours

push eventelixir-nx/nx

Paulo Valente

commit sha 2bd700979b2614bae61655ce4ec594c3ec8e26e2

feat: add take grad (#466) * feat: add take grad * test: add failing test * fix: type coercion in scatter-add * chore: Nx.rank instead of tuple_size * chore: remove take grad * feat: add take back

view details

Paulo Valente

commit sha e090a31b85179f7671073aabae3a6e21aa9df527

Merge remote-tracking branch 'origin/main' into pv-feat/add-gather-grad

view details

push time in 21 hours

push eventelixir-nx/nx

Paulo Valente

commit sha 2bd700979b2614bae61655ce4ec594c3ec8e26e2

feat: add take grad (#466) * feat: add take grad * test: add failing test * fix: type coercion in scatter-add * chore: Nx.rank instead of tuple_size * chore: remove take grad * feat: add take back

view details

push time in 21 hours

PR merged elixir-nx/nx

Reviewers
feat: add take grad

Similar to #460

+200 -4

0 comment

3 changed files

polvalente

pr closed time in 21 hours

Pull request review commentelixir-nx/nx

feat: add gather grad

 defmodule Nx.Defn.GradTest do     end   end +  describe "gather" do+    defn grad_sum_gather(t, i) do+      grad(+        t,+        fn t ->+          t+          |> Nx.gather(i)+          |> Nx.sum()+        end+      )+    end++    defn grad_sum_gather_power(t, i) do+      grad(+        t,+        fn t ->+          t+          |> Nx.power(2)+          |> Nx.gather(i)+          |> Nx.sum()+        end+      )+    end++    defn grad_sum_log_power_gather_cos(t, i) do+      grad(+        t,+        fn t ->+          t+          |> Nx.cos()+          |> Nx.gather(i)+          |> Nx.power(2)+          |> Nx.log()+          |> Nx.sum()+        end+      )+    end++    test "computes gradient" do+      assert Nx.tensor([+               [1.0, 3.0, 1.0, 0.0],+               [1.0, 1.0, 0.0, 0.0],+               [1.0, 0.0, 1.0, 3.0]+             ]) ==+               grad_sum_gather(+                 Nx.tensor([+                   [0, 1, 2, 3],+                   [4, 5, 6, 7],+                   [8, 9, 10, 11]+                 ]),+                 Nx.tensor([+                   [+                     [[0, 0], [0, 1], [0, 2]],+                     [[2, 0], [1, 0], [0, 1]],+                     [[0, 1], [1, 1], [2, 2]],+                     [[2, 3], [2, 3], [2, 3]]+                   ]+                 ])+               )++      assert Nx.tensor([[0.0, 6.0, 4.0, 0.0], [8.0, 10.0, 0.0, 0.0], [16.0, 0.0, 20.0, 66.0]]) ==+               grad_sum_gather_power(+                 Nx.tensor([+                   [0, 1, 2, 3],+                   [4, 5, 6, 7],+                   [8, 9, 10, 11]+                 ]),+                 Nx.tensor([+                   [+                     [[0, 0], [0, 1], [0, 2]],+                     [[2, 0], [1, 0], [0, 1]],+                     [[0, 1], [1, 1], [2, 2]],+                     [[2, 3], [2, 3], [2, 3]]+                   ]+                 ])+               )++      assert Nx.tensor([+               [-0.0, -9.34444522857666, 4.370079040527344, -0.0],+               [-2.3156425952911377, 6.7610297203063965, 0.0, -0.0],+               [13.5994234085083, -0.0, -1.2967215776443481, 1355.705078125]

This one is mostly equivalent to Jax aside from rounding errors:

[
  [-0.0000000e+00, -9.3444452e+00,  4.3700790e+00, -0.0000000e+00],
  [-2.3156426e+00,  6.7610297e+00,  0.0000000e+00, -0.0000000e+00],
  [ 1.3599423e+01, -0.0000000e+00, -1.2967216e+00, 1.3557051e+03]
]
polvalente

comment created time in a day

PullRequestReviewEvent

PR opened elixir-nx/nx

feat: add gather grad

Adds the grad for Nx.gather

+112 -0

0 comment

2 changed files

pr created time in a day

create barnchelixir-nx/nx

branch : pv-feat/add-gather-grad

created branch time in a day

push eventelixir-nx/nx

Paulo Valente

commit sha 642e846dd3f7bbb422cbfa05aa282d497b1c0043

feat: take along axis grad (#460) * feat: add take along axis grad * feat: add take_along_axis grad test * wip: add broken test * fix: reshape g instead of gather * chore: tidy up code * chore: format code Co-authored-by: José Valim <jose.valim@dashbit.co>

view details

Paulo Valente

commit sha c4ebfd94631919f0a3e31aedb50f9ae8b7f8351f

chore: remove take grad

view details

Paulo Valente

commit sha e69ebbf69a68cf482832f13901c1a6cdb83e4b4a

Merge remote-tracking branch 'origin/main' into pv-feat/add-take-grad

view details

Paulo Valente

commit sha eb2c21caacb1d5dabea05d55c05c3325877d01db

feat: add take back

view details

push time in a day

delete branch elixir-nx/nx

delete branch : pv-feat/take-along-axis-grad

delete time in a day

push eventelixir-nx/nx

Paulo Valente

commit sha 642e846dd3f7bbb422cbfa05aa282d497b1c0043

feat: take along axis grad (#460) * feat: add take along axis grad * feat: add take_along_axis grad test * wip: add broken test * fix: reshape g instead of gather * chore: tidy up code * chore: format code Co-authored-by: José Valim <jose.valim@dashbit.co>

view details

push time in a day

PR merged elixir-nx/nx

feat: take along axis grad
+132 -0

1 comment

2 changed files

polvalente

pr closed time in a day

push eventelixir-nx/nx

Paulo Valente

commit sha 451618e0722c310b569178b742abc4aaad7b9ef7

chore: Nx.rank instead of tuple_size

view details

push time in a day

Pull request review commentelixir-nx/nx

feat: add take grad

 defmodule Nx.Defn.Grad do     to_grad(t, g, cache)   end +  defp grad(:take, [t, i, axis], _ans, g, cache) do+    axes_range = 0..(tuple_size(t.shape) - 1)//1

Nx.rank :)

I'll change this and possibly other occurences

polvalente

comment created time in a day

PullRequestReviewEvent

push eventelixir-nx/nx

Paulo Valente

commit sha b09ee45105a0a1fedaef6a689fb3f8489730e199

refactor: use binary-matching syntax for scatter-add impl (#464) * refactor: use binary-matching syntax for scatter-add impl * fix: type coercion in scatter-add

view details

Paulo Valente

commit sha f5d96d275d3c756c4ba386c4bf1feaaa0a143ff2

Merge remote-tracking branch 'origin/main' into pv-feat/add-take-grad

view details

push time in a day

delete branch elixir-nx/nx

delete branch : pv-refactor/use-binary-match-syntax-scatter-add

delete time in a day

push eventelixir-nx/nx

Paulo Valente

commit sha b09ee45105a0a1fedaef6a689fb3f8489730e199

refactor: use binary-matching syntax for scatter-add impl (#464) * refactor: use binary-matching syntax for scatter-add impl * fix: type coercion in scatter-add

view details

push time in a day

PR merged elixir-nx/nx

Reviewers
refactor: use binary-matching syntax for scatter-add impl

As discussed in https://github.com/elixir-nx/nx/pull/458#discussion_r711698612

+24 -22

1 comment

1 changed file

polvalente

pr closed time in a day

push eventelixir-nx/nx

Paulo Valente

commit sha 6e73ce6f1db8bf02ba1ea654365e6ff4e9473457

fix: type coercion in scatter-add

view details

push time in a day

pull request commentelixir-nx/nx

refactor: use binary-matching syntax for scatter-add impl

I'm gonna apply a fix that appeared in #466, and merge eveything afterwards :)

polvalente

comment created time in a day

push eventelixir-nx/nx

Paulo Valente

commit sha ad7f6fc8340c20495fb5afa903496e222dc473eb

fix: type coercion in scatter-add

view details

push time in a day