Skip to content

Instantly share code, notes, and snippets.

View shark8me's full-sized avatar

Kiran Karkera shark8me

View GitHub Profile
@shark8me
shark8me / convstack1d.py
Created October 12, 2022 17:13
1-d conv stack for Automated Music Transcription
class ConvStack1d(nn.Module):
def __init__(self, input_features, output_features):
super().__init__()
cqt_feats=217
op_divby=2
l1_out_channels= cqt_feats //op_divby
self.cnn = nn.Sequential(
# layer 0
nn.Conv1d(output_features, l1_out_channels, 3 , padding=1),
nn.BatchNorm1d(l1_out_channels),
Run F1 Recall
using 2d convolution 0.827038 0.774268
using 1d convolution along the frequency axis 0.606367 0.575986
using 1d convolution along the time axis 0.969859 0.966472
@shark8me
shark8me / convstack2d.py
Created September 16, 2022 13:45
Default convolution stack for AMT
class ConvStack2d(nn.Module):
def __init__(self, input_features, output_features):
super().__init__()
# input is batch_size * 1 channel * frames * input_features
self.cnn = nn.Sequential(
# layer 0
nn.Conv2d(1, output_features // 16, (3, 3), padding=1),
nn.BatchNorm2d(output_features // 16),
nn.ReLU(),
@shark8me
shark8me / timidity.cfg
Created July 10, 2022 09:12
Configuring timidity to use multiple soundfonts
dir /soundfont
bank 0
74 %font ExpressiveFluteSSO-v1.2.sf2 0 0
40 %font Strings-4U-v1.0.sf2 0 0
54 %font KBH-Real-Choir-V2.5.sf2 0 1
@shark8me
shark8me / settings.xml
Last active September 15, 2021 15:21
Maven settings.xml entry to allow for download of jars from Github registry
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
@shark8me
shark8me / project.clj
Created September 15, 2021 14:57
project.clj definition for deploying to Github packages
(defproject group-id/artifact-id "version"
:repositories [["github" {:url "https://maven.pkg.github.com/<githubusername>/<repo>"
:username <github-username> :password [:env/GITHUB_TOKEN]}]]
;;other bits
)
@shark8me
shark8me / deploy.yaml
Last active September 15, 2021 13:57
Deploy Clojure jars to Github packages
name: Publish package to GitHub Packages
on: [push]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
@shark8me
shark8me / k8s-pi-job-full.clj
Created September 15, 2020 11:49
Running the K8S Pi job via the Clojure Repl
(ns clj-k8s-job.core
(:require
[clojure-kubernetes-client.core :as core]
[clojure-kubernetes-client.api.core-v1 :refer [read-namespaced-pod-log
list-pod-for-all-namespaces]]
[clojure-kubernetes-client.api.batch-v1 :refer [create-namespaced-job
read-namespaced-job-status
delete-namespaced-job]]))
(def pi-job-spec
@shark8me
shark8me / delete-job.clj
Created September 15, 2020 11:41
Delete the Kubernetes Job
(delete-namespaced-job "pi" "default"
{:kind :DeleteOptions
:propagationPolicy "Foreground"})
;;all dependents are deleted when this command returns
@shark8me
shark8me / get-job-result.clj
Created September 15, 2020 11:36
Get the Kubernetes job result
(->
;;this is a utility API to get the name of the pods
;;used by the job named pi.
(get-job-pods "pi")
first
(read-namespaced-pod-log "default"))
;;the result is the first 50 digits of pi.
;;"3.1415926535897932384626433832795028841971693993751\n"