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
import numpy as np | |
import matplotlib.pyplot as plt | |
def x(n): | |
return (1 - np.cos(n * np.pi)) / ((np.pi * n)** 2) if n != 0 else 0.5 | |
def y(n): | |
return x(n // 2) if n % 2 == 0 else 0 | |
def Xd(w, N=1000): |
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
import Foundation | |
import CoreML | |
import Accelerate | |
@objc(Mish) class Mish: NSObject, MLCustomLayer { | |
let mishPipeline: MTLComputePipelineState | |
required init(parameters: [String : Any]) throws { | |
// Create the Metal compute kernels. |
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
#! /usr/bin/env python | |
""" | |
Reads Darknet config and weights and creates Keras model with TF backend. | |
""" | |
import argparse | |
import configparser | |
import io | |
import os |