View teste.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Hello World!") |
View gist:c4c272e40aaa9f1be858aff1a826bfa3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Testando |
View gist:b1da631e2e0467ac903458a2cf516927
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mckdlmcdklsm |
View lc.ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type term = Var of string | Lam of string * term | App of term * term | |
type value = Closure of ((string * value) list * string * term) | |
let rec eval env term = | |
match term with | |
| Var var -> List.assoc var env | |
| Lam (param, body) -> Closure (env, param, body) | |
| App (lambda, argument) -> ( | |
let lambda = eval env lambda in | |
let argument = eval env argument in |
View network.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
MAX_SIZE = 3 | |
device = torch.device('cpu') | |
# generating vocab | |
sentences = [ |
View hashmap.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HashMap(object): | |
def __init__(self, bucket_size=10): | |
self.bucket_size = bucket_size | |
self.buckets = [None] * self.bucket_size | |
def insert(self, key, value): | |
hashed_key = hash(key) | |
bucket_index = hashed_key % self.bucket_size | |
self.buckets[bucket_index] = value |
View random-forest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import warnings | |
import math | |
from functools import reduce | |
import collections | |
from collections import defaultdict | |
import numpy as np | |
from keras.datasets import mnist | |
from sklearn.tree import DecisionTreeClassifier | |
from sklearn.preprocessing import KBinsDiscretizer | |
from math import log2 |
View keras_boston_example.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import sklearn.datasets as datasets | |
from keras import layers, models, utils | |
def main(): | |
# Loading dataset | |
boston_dataset = datasets.load_boston() | |
# Defining inputs and outputs of the neural network |