import numpy as np | |
import numpy.fft as fft | |
def stft(x, Nwin, Nfft=None): | |
""" | |
Short-time Fourier transform: convert a 1D vector to a 2D array | |
The short-time Fourier transform (STFT) breaks a long vector into disjoint | |
chunks (no overlap) and runs an FFT (Fast Fourier Transform) on each chunk. |
# install_certifi.py | |
# | |
# sample script to install or update a set of default Root Certificates | |
# for the ssl module. Uses the certificates provided by the certifi package: | |
# https://pypi.python.org/pypi/certifi | |
import os | |
import os.path | |
import ssl | |
import stat |
// | |
// ContentView.swift | |
// Scribe | |
// | |
// Created by Cyril Zakka on 7/21/19. | |
// Copyright © 2019 Cyril Zakka. All rights reserved. | |
// | |
import SwiftUI | |
struct ContentView: View { |
Author: Richard Wei ([email protected]) on behalf of the Swift for TensorFlow team
Last updated: October 2, 2019
The differentiable programming feature (AutoDiff) has been incubated in the 'tensorflow' branch of apple/swift since December 2017 and released as part of the Swift for TensorFlow toolchains. The Differentiable Programming Mega-Proposal, which serves as a manifesto, received general positive feedback from the community, but there is a long way between receiving conceptual approval and obtaining Swift Evolution approval of such a large feature. We would like to merge the pieces into the 'master' branch under a gate to further development and bake the feature on master, just like Apple develops its major features
Retroactive derivative registration: register derivatives for functions in other modules.
Previously:
- If module A defines
func foo
, then its derivatives must be in the same module.
With retroactive derivative registration:
- If module A defines
func foo
; - And if module B imports module A and defines
@differentiating(foo) func derivativeFoo
: - Then module C can import modules A and B and differentiate
func foo
(e.g. via differentiation APIs).
import CoreML | |
import Combine | |
extension Publisher where Self.Output: MLFeatureProvider { | |
/** | |
Operator that lets you run a Core ML model as part of a Combine chain. | |
It accepts an MLFeatureProvider object as input, and, if all goes well, | |
returns another MLFeatureProvider with the model outputs. |
import Foundation | |
import Python | |
import TensorFlow | |
public struct MyModel : Layer { | |
public var conv1d: Conv1D<Float> | |
public var dense1: Dense<Float> | |
public var dropout: Dropout<Float> | |
public var denseOut: Dense<Float> | |