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 types | |
model = types.SimpleNamespace( | |
config = config, | |
grid = grid, | |
) |
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 AttrDict(dict): | |
__getattr__ = dict.__getitem__ | |
__setattr__ = dict.__setitem__ | |
mydict = { | |
'a': 'foo', | |
'b': 'bar', | |
} | |
mydict = AttrDict(mydict) |
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
def get_dataset_mock(num_examples=1, num_classes=40): | |
output_types = {'points': tf.float32, 'label': tf.int64} | |
output_shapes = {'points': (2048, 3), 'label': (1,)} | |
def generator(): | |
for i in range(num_examples): | |
yield { | |
'points': | |
tf.random.uniform( | |
output_shapes['points'], |
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
# --- specify target with `make run TARGET=mnist.py` | |
TARGET=mnist.py | |
run: | |
ml_python $(TARGET) | |
# --- passing parameters `# make helloworld_pars MYVAR="something"` | |
MYVAR = "hello" | |
helloworld_pars: | |
@echo "foo" $(MYVAR) |
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
# --- save a numpy matrix as an OBJ file | |
M = np.random.randn(100, 3) | |
np.savetxt('out.obj', M, fmt=['%d', '%d', '%d']) |
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
# --- Performance considerations | |
# https://www.tensorflow.org/datasets/performances | |
# --- For more advanced transformation piplines | |
# https://www.tensorflow.org/tfx/tutorials/transform/simple | |
# --- Pre-processing dataset (read this CAREFULLY) | |
# https://www.tensorflow.org/api_docs/python/tf/data/Dataset#map | |
# https://www.tensorflow.org/guide/data_performance#vectorizing_mapping |
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
alias ll="ls -l" | |
export PATH="$PATH:." #< current folder always in bin | |
export PS1="\[\e[33m\]\w: \[\e[0m\]" | |
export CLICOLOR=1 #< enables colors | |
export LSCOLORS=ExFxCxDxBxegedabagacad #< specifies colors | |
export TZ="Canada/Pacific" | |
export PROMPT_DIRTRIM=2 #< trims long paths |
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
~: docker run -v "$HOME/jalpc:/srv/jekyll" -p 4000:4000 -it jekyll/jekyll:builder jekyll serve | |
Fetching gem metadata from https://rubygems.org/........... | |
Fetching gem metadata from https://rubygems.org/. | |
Resolving dependencies...... | |
Bundler::PermissionError: There was an error while trying to write to `/usr/gem/cache`. It is likely that you need to grant write permissions for that path. | |
An error occurred while installing concurrent-ruby (1.1.9), and Bundler cannot continue. | |
Make sure that `gem install concurrent-ruby -v '1.1.9' --source 'https://rubygems.org/'` succeeds before bundling. | |
In Gemfile: | |
github-pages was resolved to 215, which depends on |
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
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict | |
Based on: https://gist.github.com/trusktr/1e5e516df4e8032cbc3d | |
System file: /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict | |
Official info: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html | |
Complex example: https://github.com/ttscoff/KeyBindings/blob/master/DefaultKeyBinding.dict | |
NOTE: | |
To use Control instead of Command, either swap Control and | |
Command in Apple->System Preferences->Keyboard->Modifier Keys... |