This file contains 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/env python3 | |
''' | |
Run the script, then paste a "python-like" dictionary as input and press enter. | |
The script will output the json parseable version of the input. | |
''' | |
import json | |
import ast | |
def transform(obj): |
This file contains 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
# Gist for discussion: https://github.com/fchollet/keras/pull/8592#discussion_r153287881 | |
# OPTION 1 - replace list comprehension with for loop: | |
def func_load(code, defaults=None, closure=None, globs=None): | |
"""Deserializes a user defined function. | |
# Arguments | |
code: bytecode of the function. |
This file contains 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
See Dockerfile and run-stuff.sh |
This file contains 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
# Python version of: https://gist.github.com/davidbarber/16708b9135f13c9599f754f4010a0284 | |
# as per blog post: https://davidbarber.github.io/blog/2017/04/03/variational-optimisation/ | |
# also see https://www.reddit.com/r/MachineLearning/comments/63dhfc/r_evolutionary_optimization_as_a_variational/ | |
from __future__ import print_function | |
import matplotlib | |
matplotlib.use('Agg') |