Categories
Development

Fibonacci Adder Machine – Calculating Digits in Fibonacci Sequence

I’m working on a program that will calculate fibonacci numbers with certain digit limitations (i.e. first fibonacci number with 100 digits). The code I have below overall is running, but I am hitting a logical error that has me stumped. The goal of the code is to calculate Fibonacci numbers in a fashion similar to […]

Categories
Development

base64 encoded image in REST call to tensorflow-serving yeilds Type: Object is not of expected type: uint8

My understanding is that I should be able to grab a TensorFlow model from Google’s AI Hub, deploy it to TensorFlow Serving and use it to make predictions by POSTing images via REST requests using curl. I could not find any bbox predictors on AI Hub at this time but I did find one on […]

Categories
Development

How to find the optimal path for a graph with weighted edges using depth first search method?

I was trying mit 6.0002 problem set 2 and can’t figure out what i am doing wrong in the algorithm to find the shortest path using the depth search method. I have tried unweighted edges and it works fine for that but when i try weighted edges it does not return the shortest path. https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-0002-introduction-to-computational-thinking-and-data-science-fall-2016/assignments/ […]

Categories
Development

Get latest file by Version Number file name in a Folder

How do I get the highest number file inside a folder like N.2.4.0.12?. The file names are N.2.4.0.1, N.2.4.0.2, …, N.2.4.0.12 (highest number). I have been trying to get it but it is still showing N.2.4.0.10 instead of N.2.4.0.12 var FileInOrdered = allFiles.OrderBy(f => f.Name).Last();

Categories
Development

For each Loop Deployment issue

I have a package that need to use for each loop. I have a staging table that has all the months, I want to loop through every month (Jan, Feb, Mar, …, Dec) and load the data into the real table. So I have use execute SQL task to query all the column names of […]

Categories
Development

How to collect numbers in ascending order with minimal number of rounds?

Has someone an idea how to solve the following problem? Take the numbers 1,…,100000 and permute them in some way. At first you can make a swap of two numbers. Then you have to compute how many rounds it would take to collect numbers in ascending order. You have to collect numbers by every round […]

Categories
Development

How to run several scripts in differents folders on python

I have to run a lot of scripts for paper, and I would like to make this automatic. I have several folders (P1, P2,…, PN) in wich I have a script ( test1, test2, … testN) and I need to run all this, but doing on by one by myself I wast a lot of […]

Categories
Development

Keras: Create a custom generator for two input model using flow_from _directory() function

I was trying to train my siamese network with fit_generator(),I learned from this answer: Keras: How to use fit_generator with multiple inputs that the best way to do this was to create your own generator that yield the multiple data points, my problem was that I retrieve my data with flow_from_directory() function and I didn’t […]

Categories
Development

With pairwise summation, how many terms do I need to get an appreciably wrong result?

Using a given species of fp numbers, say float16, it is straight forward to construct sums with totally wrong results. For example, using python/numpy: import numpy as np one = np.float16(1) ope = np.nextafter(one,one+one) np.array((ope,one,-one,-one)).cumsum() # array([1.001, 2. , 1. , 0. ], dtype=float16) Here we have used cumsum to force naive summation. Left to […]

Categories
Development

Combination of connected paths of 0 to (k-1) to build path of k

Suppose there is a polygon of 6 vertices. I have to build an array of paths of progressive distances. The attached image is an example. Background: Polygon vertices are 0,1,2,3,4,5. A path from 1 to 4 will have vertices 1,2,3,4. I need to generate different combinations of this path. For example, (1,2,3) + (4) or […]