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 os | |
| import ctypes | |
| import doctest | |
| from numba import * | |
| import numba | |
| import cffi | |
| import numpy as np |
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 numpy as np | |
| import scipy.linalg.blas | |
| cdef extern from "f2pyptr.h": | |
| void *f2py_pointer(object) except NULL | |
| ctypedef int dgemm_t( | |
| char *transa, char *transb, | |
| int *m, int *n, int *k, | |
| double *alpha, |
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
| % packages | |
| \usepackage[scaled=0.92]{helvet} % set Helvetica as the sans-serif font | |
| \renewcommand{\rmdefault}{ptm} % set Times as the default text font | |
| \usepackage[T1]{fontenc} | |
| \usepackage{amsmath} | |
| \usepackage{amsfonts} | |
| \usepackage{amssymb} | |
| % recommended: get mtpro lite |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| if self.grad_op == 'id': | |
| grad_op = λ x: x | |
| elif self.grad_op == 'sign': | |
| grad_op = λ x: (x > 0) * 1.0 - (x < 0) * 1.0 | |
| elif self.grad_op == 'rand': | |
| grad_op = λ x: ((x > 0) * 1.0 - (x < 0) * 1.0) * \ | |
| random_value(shape=x.eval().shape, low=0.0, high=1.0, type=floatX, | |
| random_generator=self.rgen) | |
| else: | |
| raise NotImplementedError("unknwon grad_op") |
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
| { | |
| "metadata": { | |
| "name": "rq-test" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { |
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
| { | |
| "metadata": { | |
| "name": "pdp_spieces_public" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { |
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
| { | |
| "metadata": { | |
| "name": "stats" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { |
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
| { | |
| "metadata": { | |
| "name": "pdp_spieces_public" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder