Skip to content

Instantly share code, notes, and snippets.

View arafatkatze's full-sized avatar
💭
Lover of life and all things beautiful

Ara arafatkatze

💭
Lover of life and all things beautiful
View GitHub Profile
@arafatkatze
arafatkatze / maps.go
Created May 8, 2018 18:14
An example of Maps in Dataviz
package main
import (
rbt "github.com/Arafatk/dataviz/trees/redblacktree"
)
func main() {
tree := rbt.NewWithIntComparator()
tree.Put(5, "e")
tree.Put(6, "f")
package main
import (
bheap "github.com/Arafatk/dataviz/trees/binaryheap"
)
func main() {
heap := bheap.NewWithIntComparator()
heap.Push(3)
heap.Push(19)
# Read the image file
image_file = File.new(Dir.pwd + '/break-captcha-protobuf/captcha-1.png', "r")
feeds_tensor = Tensorflow::Tensor.new(image_file.read)
# Specify the operations of tensorflow model
feeds_output = saved_model.graph.operation('CAPTCHA/input_image_as_bytes')
fetches = saved_model.graph.operation('CAPTCHA/prediction')
# Run the Model
feeds_tensor_to_output_hash = {feeds_output.output(0) => feeds_tensor}
out_tensor = saved_model.session.run(feeds_tensor_to_output_hash, [fetches.output(0)], [])
#Print the results
puts out_tensor
require 'tensorflow'
# Loading Saved Model
saved_model = Tensorflow::Savedmodel.new
saved_model.LoadSavedModel(Dir.pwd + '/break-captcha-protobuf', ['serve'], nil)
# Read the image file and specify the image contents in a Tensor
image_file = File.new(Dir.pwd + '/break-captcha-protobuf/captcha-1.png', "r")
feeds_tensor = Tensorflow::Tensor.new(image_file.read)
package main
import "github.com/Arafatk/glot"
func main() {
dimensions := 2
// The dimensions supported by the plot
persist := false
debug := false
plot, _ := glot.NewPlot(dimensions, persist, debug)
package main
import "github.com/Arafatk/glot"
func main() {
dimensions := 2
// The dimensions supported by the plot
persist := false
debug := false
plot, _ := glot.NewPlot(dimensions, persist, debug)
from __future__ import print_function
import tensorflow as tf
FLAGS = None
a = tf.constant([[2, 3],[4,1]])
b = tf.constant([[5, 6],[1,3]])
d = tf.constant([[0, 4],[9,8]])
with tf.Session() as sess:
c = sess.run(a+b)
require 'tensorflow'
graph = Tensorflow::Graph2.new
tensor_1 = Tensorflow::Tensor.new([2,3,4,6])
tensor_2 = Tensorflow::Tensor.new([2,3,4,6])
const_1 = graph.const("m1", tensor_1)
const_2 = graph.const("m2", tensor_2)
opec = Tensorflow::OpSpec.new
opec.name = "Additionofconstants"
opec.type = "Add"
opec.input = [const_1, const_2]
node {
name: "m1"
op: "Const"
attr {
key: "_class"
value {
list {
}
}
}