Skip to content

Instantly share code, notes, and snippets.

View donovanr's full-sized avatar

Rory Donovan-Maiye donovanr

View GitHub Profile
```
def logC_taylor(x, eps=1e-7, taylor_center=0.5, taylor_radius=0.05):
eps = torch.tensor(eps).type_as(x)
taylor_center = torch.tensor(taylor_center).type_as(x)
taylor_radius = torch.tensor(taylor_radius).type_as(x)
# singular at zero and one, so regularize
mask = x == 0
x[mask] = x[mask] + eps
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@donovanr
donovanr / osxfuse_sshfs.md
Last active May 25, 2017 22:37
how to use sshfs to access qmaster and /allen/aics/modeling etc

How to use sshfs to mount qmaster+isilon (or any other ssh-able machine)

Get FUSE and SSHFS

  • Download FUSE for Mac and SSHFS from here and install them in that order.

Create a mount point

  • Create a mountpoint for e.g. qmaster in /mnt and chown it to you:
    • sudo mkdir -p /mnt/qmaster
    • sudo chown <username> /mnt/qmaster
  • Symlink it to the /Volumes diectory (creating it directly in /Volumes causes trouble with unmounting):
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1039, in _do_call
return fn(*args)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1021, in _run_fn
status, run_metadata)
File "/usr/lib/python3.5/contextlib.py", line 66, in __exit__
next(self.gen)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for ./checkpoints/BEGAN_64_64_0001.tfmod
@donovanr
donovanr / jupyter_on_compute_node.md
Last active April 26, 2017 20:13
access jupyter notebooks running on compute nodes

Port forwarding using ProxyJump and ssh tunnels

These instructions assume an ssh client at least as recent as OpenSSH 7.3, otherwise the ProxyJump will fail.

  • set up a new host in your ~/.ssh/config file (change rorydm to your own username):
Host tartarus
    HostName n70
    ProxyJump qmaster
    User rorydm
    LocalForward 8888 localhost:9999
# install matching nvidia drivers on AWS
# from https://stradajl.readthedocs.io/en/latest/tutorial/
# really should rebuild genomics container on top of nvidia-docker
# ----------------------------------------------------------------
# First update the system and install build-essential:
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential
@donovanr
donovanr / jarred_example
Last active July 13, 2016 21:05
example plot
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
@donovanr
donovanr / installing_fragbuilder
Last active November 4, 2015 00:59
fragbuilder installation instructions, assuming anaconda python
# clone repo
git clone https://github.com/andersx/fragbuilder
# add to path, wherever you put it
export PYTHONPATH="${HOME}/git-repos/fragbuilder":$PYTHONPATH
# install openbabel dependency
git clone git://github.com/openbabel/openbabel.git
cd openbabel
mkdir build
@donovanr
donovanr / install_openmm.txt
Created October 23, 2015 20:09
installing openmm
install anaconda
add channel to conda config:
conda config --add channels http://conda.binstar.org/omnia
conda install openmm
conda install openmmtools
How to install the MMTK python package
On Mac (10.10)
install anaconda
create an environment with anaconda specifically for MMTK (needs numpy<1.9):
- conda create -n mmtk numpy=1.8.2
active that environment
- source activate mmtk
install netcdf and cython: