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
<?php | |
// logging the requests for DEBUG | |
/* | |
ob_start(); | |
echo $_SERVER['REQUEST_URI']; | |
$post_data = file_get_contents("php://input"); | |
print_r($post_data); | |
$data = json_decode($post_data); | |
var_dump($data); | |
echo "\n"; |
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
pragma solidity ^0.4.9; | |
import "./Receiver_Interface.sol"; | |
import "./ERC223_Interface.sol"; | |
/** | |
* ERC223 token by Dexaran | |
* | |
* https://github.com/Dexaran/ERC223-token-standard | |
* source: https://github.com/Dexaran/ERC223-token-standard/blob/Recommended/ERC223_Token.sol |
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
pragma solidity ^0.5.3; | |
contract EnvientaToken { | |
string public constant symbol = "ENV"; | |
string public constant name = "ENVIENTA token"; | |
uint8 public constant decimals = 18; | |
event Transfer(address indexed from, address indexed to, uint256 value); | |
event Approval( address indexed owner, address indexed spender, uint256 value); |
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
# TensorFlow CNN model training example | |
# based on https://www.tensorflow.org/tutorials/images/cnn | |
from __future__ import absolute_import, division, print_function, unicode_literals | |
import tensorflow as tf | |
from tensorflow.keras import datasets, layers, models | |
import matplotlib.pyplot as plt |
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
# TensorFlow image classification example | |
# based on https://www.tensorflow.org/tutorials/keras/classification | |
# model generation: https://gist.github.com/TheBojda/f297544cc4864b2b10c2aad965339c58 | |
from __future__ import absolute_import, division, print_function, unicode_literals | |
import tensorflow as tf | |
from tensorflow.keras import datasets, layers, models | |
from tensorflow.keras.models import load_model |
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
# Simple neural network with NumPy from 11 lines of code | |
# source: https://iamtrask.github.io/2015/07/12/basic-python-network/ | |
X = np.array([ [0,0,1],[0,1,1],[1,0,1],[1,1,1] ]) | |
y = np.array([[0,1,1,0]]).T | |
syn0 = 2*np.random.random((3,4)) - 1 | |
syn1 = 2*np.random.random((4,1)) - 1 | |
for j in xrange(60000): | |
l1 = 1/(1+np.exp(-(np.dot(X,syn0)))) | |
l2 = 1/(1+np.exp(-(np.dot(l1,syn1)))) |
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
# Linear regression using GradientTape | |
# based on https://sanjayasubedi.com.np/deeplearning/tensorflow-2-linear-regression-from-scratch/ | |
import tensorflow as tf | |
import numpy as np | |
import matplotlib.pyplot as plt | |
class Model: | |
def __init__(self): | |
self.W = tf.Variable(16.0) |
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
import numpy as np | |
import tensorflow as tf | |
from tensorflow_core.python.keras import layers, models | |
words = ["cat", "dog", "apple", "orange", "car", "airplane", "man", "woman", "drink", "eat", "neural", "network", | |
"tensor", "flow"] | |
dict_len = len(words) | |
word_index = dict((word, i) for i, word in enumerate(words)) | |
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
# Word embedding tensorflow example | |
# based on: https://www.tensorflow.org/tutorials/text/word_embeddings | |
import io | |
import tensorflow as tf | |
from tensorflow_core.python.keras import layers, models, datasets | |
import tensorflow_datasets as tfds | |
(train_data, test_data), info = tfds.load( | |
'imdb_reviews/subwords8k', |
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
import gym | |
env = gym.make("Breakout-v0") | |
observation = env.reset() | |
for _ in range(10000): | |
env.render() | |
action = env.action_space.sample() # your agent here (this takes random actions) | |
observation, reward, done, info = env.step(action) | |
if done: |