text
stringlengths 1
93.6k
|
|---|
variance_schedule = '{}{}'.format(args.S, args.schedule)
|
else:
|
raise NotImplementedError
|
if args.pretrain:
|
output_name = '{}_{}{}_kappa{}_generate'.format(args.name,
|
args.approxdiff,
|
variance_schedule,
|
kappa)
|
else:
|
output_name = '{}_{}{}_kappa{}_generate_finetune'.format(args.name,
|
args.approxdiff,
|
variance_schedule,
|
kappa)
|
model_path = '{}_{}{}_kappa{}finetuned.pt'.format(args.name,
|
args.approxdiff,
|
variance_schedule,
|
kappa)
|
n_exist = 0
|
if 'generated' in os.listdir() and output_name in os.listdir('generated'):
|
if len(os.listdir(os.path.join('generated', output_name))) == args.n_generate:
|
print('{} already finished'.format(output_name))
|
n_exist = args.n_generate
|
else:
|
n_exist = len(os.listdir(os.path.join('generated', output_name)))
|
n_exist = 0
|
if n_exist < args.n_generate:
|
print('start generating')
|
if args.pretrain:
|
model_path = os.path.join('checkpoints',
|
'{}diffusion_{}_model'.format('ema_' if args.ema else '', args.name),
|
'model.ckpt.pth')
|
generate(output_name, model_path, model_config,
|
diffusion_config, args.approxdiff, generation_param,
|
args.n_generate, args.batchsize, n_exist)
|
# <FILESEP>
|
#!/usr/bin/env python2
|
##################################################
|
# GNU Radio Python Flow Graph
|
# Title: Top Block
|
# Generated: Tue Oct 6 22:40:10 2015
|
##################################################
|
if __name__ == '__main__':
|
import ctypes
|
import sys
|
if sys.platform.startswith('linux'):
|
try:
|
x11 = ctypes.cdll.LoadLibrary('libX11.so')
|
x11.XInitThreads()
|
except:
|
print "Warning: failed to XInitThreads()"
|
from PyQt4 import Qt, QtCore, QtGui
|
from gnuradio import blocks
|
from gnuradio import audio
|
from gnuradio import eng_notation
|
from gnuradio import filter
|
from gnuradio import fft
|
from gnuradio import gr
|
from gnuradio import qtgui
|
from gnuradio.eng_option import eng_option
|
from gnuradio.filter import firdes
|
from optparse import OptionParser
|
import sip
|
import sys
|
import pyqtgraph as pg
|
#from blocks import BEServer, Threshold
|
import numpy as np
|
import scipy.signal
|
import signal
|
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
cnt = 0
|
import threading, time
|
import math
|
class InputDict(object):
|
pass
|
class Input(object):
|
"""Attribute type for describing signal inputs of Blocks"""
|
# A counter used to find out the order of declaration
|
order = 0
|
def __init__(self, type=np.float32):
|
self.order = Input.order
|
Input.order += 1
|
self.type = type
|
"""Create a copy from a class attribute for a specific Block instance"""
|
def instantiate(self, block, name):
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.