This file contains hidden or 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 main | |
| import ( | |
| rbt "github.com/Arafatk/dataviz/trees/redblacktree" | |
| ) | |
| func main() { | |
| tree := rbt.NewWithIntComparator() | |
| tree.Put(5, "e") | |
| tree.Put(6, "f") |
This file contains hidden or 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 main | |
| import ( | |
| bheap "github.com/Arafatk/dataviz/trees/binaryheap" | |
| ) | |
| func main() { | |
| heap := bheap.NewWithIntComparator() | |
| heap.Push(3) | |
| heap.Push(19) |
This file contains hidden or 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
| # 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) | |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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
| 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) |
This file contains hidden or 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 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) |
This file contains hidden or 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 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) |
This file contains hidden or 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
| 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) |
This file contains hidden or 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
| 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] |
This file contains hidden or 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
| node { | |
| name: "m1" | |
| op: "Const" | |
| attr { | |
| key: "_class" | |
| value { | |
| list { | |
| } | |
| } | |
| } |