Skip to content

Instantly share code, notes, and snippets.

@minerado
minerado / plot_decision_boundary.py
Last active December 15, 2022 23:24
plot_decision_boundary function for PyTorch tensors
import torch
import matplotlib.pyplot as plt
def create_torch_grid(X: torch.Tensor, steps: int = 100):
x_min, x_max = X[:, 0].min() - 0.1, X[:, 0].max() + 0.1
y_min, y_max = X[:, 1].min() - 0.1, X[:, 1].max() + 0.1
grid_x = torch.linspace(x_min, x_max, steps=steps)
grid_y = torch.linspace(y_min, y_max, steps=steps)
@minerado
minerado / brdocs.ex
Last active December 4, 2022 16:27
CPF and CNPJ generators in Elixir
defmodule BrDocs do
@moduledoc """
Provides functions that handle Brazil tax payer's documents.
"""
@weights %{
9 => [10, 9, 8, 7, 6, 5, 4, 3, 2],
10 => [11, 10, 9, 8, 7, 6, 5, 4, 3, 2],
12 => [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2],
13 => [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]

Keybase proof

I hereby claim:

  • I am minerado on github.
  • I am ramondiogo (https://keybase.io/ramondiogo) on keybase.
  • I have a public key ASDj_QntEAyzXZopGLBQbGGXTw0qeKswFcTjgbg8lFxhigo

To claim this, I am signing this object: