Skip to content

Instantly share code, notes, and snippets.

View tanmayb123's full-sized avatar

Tanmay Bakshi tanmayb123

  • Software Developer, YouTuber
  • Canada
View GitHub Profile
import multiprocessing
import random
import sys
rangemin = 1
rangemax = 9
def randomGen(num):
values = []
for i in range(0, num):
import Foundation
import TensorFlow
struct MAuto: Parameterized {
// Define constants
static let imageSize: Int32 = 28
static let inputSize: Int32 = imageSize * imageSize
static let hiddenLength: Int32 = 512
static let coderLength: Int32 = 256
using Flux.Tracker
using Flux.Tracker: update!
using ProgressMeter
euclidean_distance(p1, p2) = sqrt((p1[1] - p2[1]) ^ 2 + (p1[2] - p2[2]) ^ 2)
squared_error(expected, output) = (expected - output) ^ 2
function trilateration_error(r1, r2, r3, expected_distances, prediction)
prediction_r1 = euclidean_distance(prediction, r1)
using Flux.Tracker
using Flux.Tracker: update!
using ProgressMeter
euclidean_distance(p1, p2) = sqrt((p1[1] - p2[1]) ^ 2 + (p1[2] - p2[2]) ^ 2)
squared_error(expected, output) = (expected - output) ^ 2
function trilateration_error(r1, r2, r3, expected_distances, pred)
pred_r1 = euclidean_distance(r1, pred)
import SwiftUI
struct ContentView : View {
var body: some View {
Text("Hello World")
}
}
#if DEBUG
struct ContentView_Previews : PreviewProvider {
Text("Hello World")
.font(.largeTitle)
.bold()
VStack {
Text("Hello World")
.font(.largeTitle)
.bold()
Text("This is my test app.")
}
VStack(alignment: .leading) {
Text("Hello World")
.font(.largeTitle)
.bold()
Text("This is my test app.")
}
struct ContentView : View {
@State var stackLocation: CGPoint = .zero
var body: some View {
VStack(alignment: .leading) {
Text("Hello World")
.font(.largeTitle)
.bold()
Text("This is my test app.")
}
VStack(alignment: .leading) {
Text("Hello World")
.font(.largeTitle)
.bold()
Text("This is my test app.")
}
.offset(x: stackLocation.x, y: stackLocation.y)