View gdal_logger.py
import gdal
import logging
# example GDAL error handler function
gdal_logger = logging.getLogger('gdal')
if not gdal_logger.handlers:
gdal_logger.addHandler(logging.NullHandler)
errtype = {
View result.txt
MODEL: value_function
variable shape dtype params
0 value_function/conv2d/Variable:0 [1, 3, 3, 2] float32_ref 18
1 value_function/conv2d/Variable_1:0 [2] float32_ref 2
2 value_function/conv2d_1/Variable:0 [1, 49, 2, 20] float32_ref 1960
3 value_function/conv2d_1/Variable_1:0 [20] float32_ref 20
4 value_function/conv2d_2/Variable:0 [1, 1, 21, 1] float32_ref 21
5 value_function/conv2d_2/Variable_1:0 [1] float32_ref 1
total params: 2022
MODEL: baseline/baseline_state
View analysing cryptocoin histories.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View analysing cryptocoin histories.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View plot tensorforce explorations.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View live_plot_notebook.py
import numpy as np
from matplotlib import pyplot as plt
class LivePlotNotebook(object):
"""
Live plot using %matplotlib notebook in jupyter notebook
Usage:
```
import time
View tensor_board_logger.py
import tensorflow as tf
import numpy as np
class TensorBoardLogger(object):
"""
Log scalar and histograms/distributions to tensorboard.
Usage:
```
View tensorforce_progressbar.py
from tqdm import tqdm_notebook, tqdm
class StepsProgressBarNotebook(object):
"""
HTML5 logger for tensorforce using tqdm_notebook for jupyter-notebook.
Usage:
`runner.run(episodes=np.inf, episode_finished=StepsProgressBar(steps=1e9, print_every=1000))`
"""
def __init__(self, steps, print_every=None, mean_of=100):
View jaccard_coef_loss.py
from keras import backend as K
def jaccard_distance_loss(y_true, y_pred, smooth=100):
"""
Jaccard = (|X & Y|)/ (|X|+ |Y| - |X & Y|)
= sum(|A*B|)/(sum(|A|)+sum(|B|)-sum(|A*B|))
The jaccard distance loss is usefull for unbalanced datasets. This has been
shifted so it converges on 0 and is smoothed to avoid exploding or disapearing
gradient.
View DualFlowGenerators.py
from skimage.transform import resize
class DualFlowGenerators(object):
"""
Class to deliver X from multiple keras NumpyIterators.
Can also resize the image
"""
def __init__(self, image_data_generators, resize=False):
super().__init__()
assert [a.n==image_data_generators[0].n for a in image_data_generators], 'all inputs should have same length'