Skip to content

Instantly share code, notes, and snippets.

View RahulBhalley's full-sized avatar
🏠
Working from home

RahulBhalley

🏠
Working from home
View GitHub Profile
@fasiha
fasiha / stft.py
Last active June 23, 2022 12:44
Short-time Fourier transform with inverse in Python/Numpy, see https://stackoverflow.com/q/51655119/500207
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.
@rxwei
rxwei / ad-manifesto.md
Last active December 6, 2024 16:54
First-Class Automatic Differentiation in Swift: A Manifesto
@erogol
erogol / tts_example.ipynb
Last active November 17, 2024 10:02
TTS_example.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# 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
@cyrilzakka
cyrilzakka / ContentView.swift
Created July 26, 2019 21:03
Simple Image Viewer using SwiftUI
//
// ContentView.swift
// Scribe
//
// Created by Cyril Zakka on 7/21/19.
// Copyright © 2019 Cyril Zakka. All rights reserved.
//
import SwiftUI
struct ContentView: View {
@rxwei
rxwei / upstreaming-swift-autodiff.md
Last active January 28, 2020 11:06
Upstreaming Swift AutoDiff

Upstreaming Swift AutoDiff

Author: Richard Wei ([email protected]) on behalf of the Swift for TensorFlow team

Last updated: October 2, 2019

Overview

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

@dan-zheng
dan-zheng / README.md
Last active January 4, 2020 19:47
Retroactive derivative registration in Swift (https://bugs.swift.org/browse/TF-866)

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).
@hollance
hollance / CoreML+Combine.swift
Created November 12, 2019 16:28
Using Core ML with Combine
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.
@kongzii
kongzii / model.swift
Last active January 30, 2020 07:40
Example of saving trained weights of model in the Swift For Tensorflow
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>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.