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 typing import Any, Mapping, Optional, Sequence, TypeVar, Union | |
| import tensorflow as tf | |
| from tensorflow.keras import layers | |
| T = TypeVar('T') | |
| Nested = Union[T, Sequence[T], Mapping[Any, T]] | |
| class AutoShapeMixin: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| %Make sure to have \usepackage{tikz} | |
| %https://tex.stackexchange.com/a/45815/140440 - for grid | |
| %https://tex.stackexchange.com/a/381175/140440 - for alignment in equation | |
| % This function draws a matrix. | |
| \newcommand{\mat}[2]{% cols, rows | |
| \vcenter{\hbox{ %Vertical alignment | |
| \begin{tikzpicture}[scale=0.3, align=center] |
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
| import jax | |
| from jax import core | |
| from graphviz import Digraph | |
| import itertools | |
| styles = { | |
| 'const': dict(style='filled', color='goldenrod1'), | |
| 'invar': dict(color='mediumspringgreen', style='filled'), | |
| 'outvar': dict(style='filled,dashed', fillcolor='indianred1', color='black'), |
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
| #!/bin/bash | |
| # TODO: you will need to have conda installed | |
| # create a python environment | |
| conda create -n env_tmp python=3.8.13 -y | |
| # activate environment | |
| conda activate env_tmp |
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
| Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc. | |
| Now on pip! `pip install arrgh` https://github.com/nmwsharp/arrgh |
OlderNewer