Viewing is open to everyone. Downloading and starring need a GitHub sign-in. Sign in with GitHub

LocatorRanker.swift

v0.1.0-build.85 Latest Commit ede38f5

Size
509 B
Lines
14
Language
swift
SHA-256
a65cca57384b…
View on GitHub

Sign in with GitHub to download. Each download is recorded with your GitHub username.

1// Generated by tools/train_locator_ranker.py. Do not hand-tune.
2
3import Foundation
4
5enum LocatorRanker {
6 private static let weights = [-10.65985208, 0.18755525, -0.55068352]
7 private static let bias = 0.81059192
8
9 static func score(aspectError: Double, fillRatio: Double, relativeSide: Double) -> Double {
10 let sideError = abs(relativeSide - 0.32)
11 let z = bias + weights[0] * aspectError + weights[1] * fillRatio + weights[2] * sideError
12 return 1.0 / (1.0 + exp(-z))
13 }
14}