Generate fine-tuning samples & Fine-tuning the model & Generate samples by transferring Note On

Related tags

Deep LearningUPMT
Overview

UPMT

Generate fine-tuning samples & Fine-tuning the model & Generate samples by transferring Note On

See main.py as an example:

from model import PopMusicTransformer
import argparse
import tensorflow as tf
import os
import pickle
import numpy as np
from glob import glob
parser = argparse.ArgumentParser(description='')
parser.add_argument('--prompt_path', dest='prompt_path', default='./test/prompt/test_input.mid', help='path of prompt')
parser.add_argument('--output_path', dest='output_path', default='./test/output/test_generate.mid', help='path of the output')
parser.add_argument('--favorite_path', dest='favorite_path', default='./test/favorite/test_favorite.mid', help='path of favorite')
parser.add_argument('--trainingdata_path', dest='trainingdata_path', default='./test/data/training.pickle', help='path of favorite training data')
parser.add_argument('--output_checkpoint_folder', dest='output_checkpoint_folder', default='./test/checkpoint/', help='path of favorite')
parser.add_argument('--alpha', default=0.1, help='weight of events')
parser.add_argument('--temperature', default=300, help='sampling temperature')
parser.add_argument('--topk', default=5, help='sampling topk')
parser.add_argument('--smpi', default=[-2,-2,-1,-2,-2,2,2,5], help='signature music pattern interval')

parser.add_argument('--type', dest='type', default='generateno', help='generateno or pretrain or prepare')

args = parser.parse_args()


def main(_):

    tfconfig = tf.ConfigProto(allow_soft_placement=True)
    with tf.Session(config=tfconfig) as sess:
        if args.type == 'prepare':
            midi_paths = glob('./test/favorite'+'/*.mid')
            model = PopMusicTransformer(
                checkpoint='./test/model',
                is_training=False)
            model.prepare_data(
                        midi_paths=midi_paths)    
        elif args.type == 'generateno':
            model = PopMusicTransformer(
                checkpoint='./test/model',
                is_training=False)
            model.generate_noteon(
                        temperature=float(args.temperature),
                        topk=int(args.topk),
                        output_path=args.output_path,  
                        smpi= np.array(args.smpi),
                        prompt=args.prompt_path)
        elif args.type =='pretrain':
            training_data = pickle.load(open(args.trainingdata_path,"rb"))
            if not os.path.exists(args.output_checkpoint_folder):
                os.mkdir(args.output_checkpoint_folder)
            model = PopMusicTransformer(
                checkpoint='./test/model',
                is_training=True)
            model.finetune(
                training_data=training_data,
                alpha=float(args.alpha),
                favoritepath=args.favorite_path,
                output_checkpoint_folder=args.output_checkpoint_folder)

if __name__ == '__main__':
    tf.app.run()

Thanks https://github.com/YatingMusic/remi for the open source.

clustering moroccan stocks time series data using k-means with dtw (dynamic time warping)

Moroccan Stocks Clustering Context Hey! we don't always have to forecast time series am I right ? We use k-means to cluster about 70 moroccan stock pr

Ayman Lafaz 7 Oct 18, 2022
PyTorch implementation for ComboGAN

ComboGAN This is our ongoing PyTorch implementation for ComboGAN. Code was written by Asha Anoosheh (built upon CycleGAN) [ComboGAN Paper] If you use

Asha Anoosheh 139 Dec 20, 2022
PyTorch Implementation of Sparse DETR

Sparse DETR By Byungseok Roh*, Jaewoong Shin*, Wuhyun Shin*, and Saehoon Kim at Kakao Brain. (*: Equal contribution) This repository is an official im

Kakao Brain 113 Dec 28, 2022
Train CNNs for the fruits360 data set in NTOU CS「Machine Vision」class.

CNNs fruits360 Train CNNs for the fruits360 data set in NTOU CS「Machine Vision」class. CNN on a pretrained model Build a CNN on a pretrained model, Res

Ricky Chuang 1 Mar 07, 2022
This repository contains the code for the ICCV 2019 paper "Occupancy Flow - 4D Reconstruction by Learning Particle Dynamics"

Occupancy Flow This repository contains the code for the project Occupancy Flow - 4D Reconstruction by Learning Particle Dynamics. You can find detail

189 Dec 29, 2022
Deep motion generator collections

GenMotion GenMotion (/gen’motion/) is a Python library for making skeletal animations. It enables easy dataset loading and experiment sharing for synt

23 May 24, 2022
Quickly comparing your image classification models with the state-of-the-art models (such as DenseNet, ResNet, ...)

Image Classification Project Killer in PyTorch This repo is designed for those who want to start their experiments two days before the deadline and ki

349 Dec 08, 2022
A toolkit for making real world machine learning and data analysis applications in C++

dlib C++ library Dlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real worl

Davis E. King 11.6k Jan 01, 2023
An easier way to build neural search on the cloud

An easier way to build neural search on the cloud Jina is a deep learning-powered search framework for building cross-/multi-modal search systems (e.g

Jina AI 17k Jan 02, 2023
A Python implementation of active inference for Markov Decision Processes

A Python package for simulating Active Inference agents in Markov Decision Process environments. Please see our companion preprint on arxiv for an ove

235 Dec 21, 2022
Everything about being a TA for ITP/AP course!

تی‌ای بودن! تی‌ای یا دستیار استاد از نقش‌های رایج بین دانشجویان مهندسی است، این ریپوزیتوری قرار است نکات مهم درمورد تی‌ای بودن و تی ای شدن را به ما نش

<a href=[email protected]"> 14 Sep 10, 2022
The backbone CSPDarkNet of YOLOX.

YOLOX-Backbone The backbone CSPDarkNet of YOLOX. In this project, you can enjoy: CSPDarkNet-S CSPDarkNet-M CSPDarkNet-L CSPDarkNet-X CSPDarkNet-Tiny C

Jianhua Yang 9 Aug 22, 2022
Reference code for the paper CAMS: Color-Aware Multi-Style Transfer.

CAMS: Color-Aware Multi-Style Transfer Mahmoud Afifi1, Abdullah Abuolaim*1, Mostafa Hussien*2, Marcus A. Brubaker1, Michael S. Brown1 1York University

Mahmoud Afifi 36 Dec 04, 2022
Implement Decoupled Neural Interfaces using Synthetic Gradients in Pytorch

disclaimer: this code is modified from pytorch-tutorial Image classification with synthetic gradient in Pytorch I implement the Decoupled Neural Inter

Andrew 114 Dec 22, 2022
Implementation of Advantage-Weighted Regression: Simple and Scalable Off-Policy Reinforcement Learning

advantage-weighted-regression Implementation of Advantage-Weighted Regression: Simple and Scalable Off-Policy Reinforcement Learning, by Peng et al. (

Omar D. Domingues 1 Dec 02, 2021
N-Omniglot is a large neuromorphic few-shot learning dataset

N-Omniglot [Paper] || [Dataset] N-Omniglot is a large neuromorphic few-shot learning dataset. It reconstructs strokes of Omniglot as videos and uses D

11 Dec 05, 2022
Unofficial implementation of Alias-Free Generative Adversarial Networks. (https://arxiv.org/abs/2106.12423) in PyTorch

alias-free-gan-pytorch Unofficial implementation of Alias-Free Generative Adversarial Networks. (https://arxiv.org/abs/2106.12423) This implementation

Kim Seonghyeon 502 Jan 03, 2023
《Dual-Resolution Correspondence Network》(NeurIPS 2020)

Dual-Resolution Correspondence Network Dual-Resolution Correspondence Network, NeurIPS 2020 Dependency All dependencies are included in asset/dualrcne

Active Vision Laboratory 45 Nov 21, 2022
Image Matching Evaluation

Image Matching Evaluation (IME) IME provides to test any feature matching algorithm on datasets containing ground-truth homographies. Also, one can re

32 Nov 17, 2022
TigerLily: Finding drug interactions in silico with the Graph.

Drug Interaction Prediction with Tigerlily Documentation | Example Notebook | Youtube Video | Project Report Tigerlily is a TigerGraph based system de

Benedek Rozemberczki 91 Dec 30, 2022