Skip to content

Instantly share code, notes, and snippets.

View JoostvDoorn's full-sized avatar

Joost van Doorn JoostvDoorn

View GitHub Profile
@JoostvDoorn
JoostvDoorn / BUILD
Last active August 28, 2023 13:23
Pants timeout issue
python_tests(
name="root",
)
python_requirements(
name="reqs0",
)
cd /tmp
export TF_VERSION='1.0.1'
wget $(echo "https://releases.hashicorp.com/terraform/$TF_VERSION/terraform_"$TF_VERSION"_linux_amd64.zip")
unzip terraform_"$TF_VERSION"_linux_amd64.zip
cp terraform $(which terraform)
@JoostvDoorn
JoostvDoorn / .bazel.rc
Last active November 6, 2019 08:51 — forked from jayeye/BUILD
stamping with build information. Obviously, replace _slash_ in the filenames with an actual slash!
build --workspace_status_command=./tools/mkstamp.sh
cd /tmp
wget $(echo "https://releases.hashicorp.com/terraform/$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version')/terraform_$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version')_linux_amd64.zip")
unzip terraform_$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version')_linux_amd64.zip
cp terraform $(which terraform)
series: xenial
applications:
flannel:
charm: "cs:~containers/flannel-15"
annotations:
"gui-x": "943"
"gui-y": "943.4101615137754"
"kubernetes-master":
charm: "cs:~containers/kubernetes-master-19"
num_units: 1
@JoostvDoorn
JoostvDoorn / README.md
Created January 17, 2017 13:42
Install torch 1.0-0

Troubleshooting cutorch 1.0-0 and cunn 1.0-0

When running code that requires cutorch 1.0-0 and cunn 1.0-0 then you might come accross some issues with type errors. Since there are no tags for other packages such as nn, over time compatiblity with the 1.0-0 version will dwindle unless you checkout specificly checkout an old version. Here are some instructions that helped in my case.

Here are some quick tips that might help.

Install torch normally.

Install old version of cutorch and cunn.

------------------------------------------------------------------------
--[[ CriterionMaskZero ]]--
-- Decorator that zeros err and gradInputs of the encapsulated criterion
-- if the target is zero
-- note: Use at your own risk
-- author: JoostvDoorn
------------------------------------------------------------------------
local CriterionMaskZero, parent = torch.class("nn.CriterionMaskZero", "nn.Criterion")
function CriterionMaskZero:__init(criterion)
@JoostvDoorn
JoostvDoorn / siameseBug.lua
Created October 22, 2016 19:03
Bug #357 in Element-Research/rnn
-- Simple Sentence Similarity Example with Siamese Encoder
-- Author: Joost van Doorn (joostvandoorn.com)
require 'nn'
require 'rnn'
require 'io'
local pl = require 'pl'
local dl = require 'dataload'
Module = nn.Module
-- local parallel = nn.ConcatTable():add(nn.SelectTable(2)):add(nn.SelectTable(3))
-- self.baselineModel:add(parallel)
-- local lookup = nn.LookupTableMaskZero(vocabSize, 256)
-- local lookups = nn.ParallelTable():add(lookup):add(lookup:clone('weight','bias','gradWeight','gradBias'))
-- self.baselineModel:add(lookups)
-- local rnn1 = nn.Sequential()
-- rnn1.lstmLayers = {cudnn.GRU(256, 128, 1)}
-- rnn1:add(rnn1.lstmLayers[1])
-- local rnn2 = nn.Sequential()