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 tensorflow as tf | |
| from tensorflow.python.framework import ops | |
| import numpy as np | |
| # Define custom py_func which takes also a grad op as argument: | |
| def py_func(func, inp, Tout, stateful=True, name=None, grad=None): | |
| # Need to generate a unique name to avoid duplicates: | |
| rnd_name = 'PyFuncGrad' + str(np.random.randint(0, 1E+8)) | |
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
| #!/usr/bin/python | |
| #-*- coding: latin-1 -*- | |
| """This module contains pure Python implementations of the | |
| Levenberg-Marquardt algorithm for data fitting. | |
| """ | |
| import numpy | |
| from numpy import inner, max, diag, eye, Inf, dot | |
| from numpy.linalg import norm, solve |
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
| """ | |
| Zonal Statistics | |
| Vector-Raster Analysis | |
| Copyright 2013 Matthew Perry | |
| Usage: | |
| zonal_stats.py VECTOR RASTER | |
| zonal_stats.py -h | --help | |
| zonal_stats.py --version |