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
# Deep Q-learning CartPole example | |
# based on https://github.com/gsurma/cartpole.git & https://gym.openai.com/evaluations/eval_OeUSZwUcR2qSAqMmOE1UIw/ | |
import gym | |
import random | |
import numpy as np | |
from os import path | |
from collections import deque | |
from tensorflow.keras.models import Sequential | |
from tensorflow.keras.layers import Dense |
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 | |
text = "Hello World!" | |
input_text = text[:-1] | |
target_text = text[1:] | |
print(input_text) | |
print(target_text) |
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
# MINST GAN Example | |
# based on https://www.tensorflow.org/tutorials/generative/dcgan | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
from tensorflow.keras import layers, models | |
import time | |
BUFFER_SIZE = 60000 | |
BATCH_SIZE = 256 |
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
# MINST GAN Example | |
# based on https://www.tensorflow.org/tutorials/generative/dcgan | |
import numpy as np | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
from tensorflow.keras import layers, models | |
import time | |
BUFFER_SIZE = 60000 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>TensorFlow.js Tutorial</title> | |
<!-- Import TensorFlow.js --> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.0.0/dist/tf.min.js"></script> |
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 {Cifar10} from './data.js'; | |
async function load () { | |
const data = new Cifar10() | |
await data.load() | |
const [train_images, train_labels] = data.nextTrainBatch(); | |
const [test_images, test_labels] = data.nextTestBatch(); | |
console.log(train_images, train_labels, test_images, test_labels); |
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 {Cifar10} from './data.js'; | |
async function load () { | |
const data = new Cifar10() | |
await data.load() | |
const model = await tf.loadLayersModel('./model/model.json'); | |
//tfvis.show.modelSummary({name: 'Model Architecture'}, model); | |
const class_names = ['airplane', 'automobile', 'bird', 'cat', 'deer', |
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 React, { Component } from 'react'; | |
import { StyleSheet, Text, View, Button } from 'react-native'; | |
export default class App extends Component { | |
constructor() { | |
super() | |
this.state = {text: 'Hello World!'} | |
} |
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 TODO react native app | |
// based on https://codeburst.io/todo-app-with-react-native-f889e97e398e | |
import React, { Component } from 'react'; | |
import { StyleSheet, Text, View, FlatList, TextInput, Keyboard, Button } from 'react-native'; | |
const isAndroid = Platform.OS == "android"; | |
export default class App extends Component { |
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
package org.tensorflow.lite.examples.digitclassifier | |
import android.content.Context | |
import android.content.res.AssetManager | |
import android.graphics.Bitmap | |
import android.util.Log | |
import com.google.android.gms.tasks.Task | |
import com.google.android.gms.tasks.Tasks.call | |
import java.io.FileInputStream | |
import java.io.IOException |