This file contains hidden or 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
| from torch import nn | |
| from time import time | |
| import torch | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from tqdm import tqdm | |
| from skimage.util.shape import view_as_windows | |
| torch.manual_seed(42) | |
This file contains hidden or 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
| /** | |
| * LL(1) parser. Building parsing table, part 1: First and Follow sets. | |
| * | |
| * NOTICE: see full implementation in the Syntax tool, here: | |
| * https://github.com/DmitrySoshnikov/syntax/blob/master/src/sets-generator.js | |
| * | |
| * by Dmitry Soshnikov <[email protected]> | |
| * MIT Style License | |
| * | |
| * An LL(1)-parser is a top-down, fast predictive non-recursive parser, |
This file contains hidden or 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
| module TareaHaskell where | |
| import Data.List | |
| {- Ejercicio 1 | |
| Una funcion para sumar matrices. Las matrices | |
| pueden estar representadas como una lista de listas | |
| -} | |
| --Funcion auxiliar para sumar por renglon | |
| sumaRenglon::Num a=>[a]->[a]->[a] | |
| sumaRenglon [] [] = [] |
This file contains hidden or 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
| data BinaryTree a = EmptyTree | Node a (BinaryTree a) (BinaryTree a) | |
| deriving (Show) | |
| treeInsert :: Ord a => a -> BinaryTree a -> BinaryTree a | |
| treeInsert el EmptyTree = Node el EmptyTree EmptyTree | |
| treeInsert el (Node a left right) | |
| | el == a = Node el left right | |
| | el < a = Node a (treeInsert el left) right | |
| | el > a = Node a left (treeInsert el right) |