Documentation ¶
Overview ¶
Package tfutils provides various functions usefull when constructing TensorFlow compute graphs.
Index ¶
- func BytesToBytes(s *op.Scope, inputPH, outputOP tf.Output, feeds map[tf.Output]*tf.Tensor) (conversionFunc func([]byte) ([]byte, error), err error)
- func ComputeMFCC(s *op.Scope, pcm tf.Output) (mfcc, sampleRatePH tf.Output)
- func ComputeSpectrogram(s *op.Scope, pcm tf.Output, freqMin, freqBuf int) (slice tf.Output)
- func EmbedTrainingData(inputs [][][]float32, outputs [][libaural2.StridesPerClip]int32, ...) (graph *tf.Graph, err error)
- func EncodeWav(s *op.Scope, pcmOutput tf.Output) (wavBytesOutput, sampleRatePH tf.Output)
- func MakeAudioClipToMFCCtensor() (renderMFCC func(*libaural2.AudioClip) (*tf.Tensor, error), err error)
- func MakeCleanWav(sampleRate int) (cleanWav func([]byte) ([]byte, error), err error)
- func MakeProbsTensorToImage() (probsToImage func(*tf.Tensor) ([]byte, error), err error)
- func ParseRawBytesToPCM(s *op.Scope) (rawBytes, pcm tf.Output)
- func ParseWavBytesToPCM(s *op.Scope) (wavBytes, pcm tf.Output)
- func ReadRawToPCM(s *op.Scope) (filePath, pcm tf.Output)
- func ReadWaveToPCM(s *op.Scope) (filePath, pcm tf.Output)
- func RenderImage(s *op.Scope, values tf.Output) (jpegBytes tf.Output)
- func SplitInputSeqs(inputSet [][][]float32) (splitSet [][][]float32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToBytes ¶
func BytesToBytes(s *op.Scope, inputPH, outputOP tf.Output, feeds map[tf.Output]*tf.Tensor) (conversionFunc func([]byte) ([]byte, error), err error)
BytesToBytes takes a scope, a placeholder for a []byte, and an output of []byte and returns a `func([]byte)[]byte`. feeds may be an empty map, or it may be populated with whatever special feeds your graph needs.
func ComputeMFCC ¶
ComputeMFCC compute the Mel-frequency cepstrum coefficients of the PCM audio
func ComputeSpectrogram ¶
ComputeSpectrogram computes the spectrogram of the given audio
func EmbedTrainingData ¶
func EmbedTrainingData(inputs [][][]float32, outputs [][libaural2.StridesPerClip]int32, ids []libaural2.ClipID, numSubSeqs int, batchSize int) (graph *tf.Graph, err error)
EmbedTrainingData returns a GrapDef with the inputs and outputs embeded inputs must be of shape [len, libaural2.StridesPerClip, libaural2.InputSize] outputs must be of shape [len, libaural2.StridesPerClip] where len is the same for inputs, outputs, and ids.
func MakeAudioClipToMFCCtensor ¶
func MakeAudioClipToMFCCtensor() (renderMFCC func(*libaural2.AudioClip) (*tf.Tensor, error), err error)
MakeAudioClipToMFCCtensor makes a function that takes an audioClip and returns a tensor of mfccs sutable for feeding to seqInference
func MakeCleanWav ¶
MakeCleanWav returns a function which takes the bytes of a wav file, converts to PCM, checks that it is good and reconstructs a wav file from the PCM. If the input is malformed, it will return an error. The output may be slighty different from the input. Use the output.
func MakeProbsTensorToImage ¶
MakeProbsTensorToImage makes a function that takes a tensor of probs, and returns the byte of an image.
func ParseRawBytesToPCM ¶
ParseRawBytesToPCM returns a placeholder for []byte of an int16le raw file, and an output for float PCM
func ParseWavBytesToPCM ¶
ParseWavBytesToPCM returns a placeholder for []byte of an int16le wav file, and an output for float PCM
func ReadRawToPCM ¶
ReadRawToPCM returns a placeholder for a filepath to an int16le raw file, and an output for float PCM
func ReadWaveToPCM ¶
ReadWaveToPCM returns a placeholder for a filepath to an int16le wav file, and an output for float PCM
func RenderImage ¶
RenderImage takes an operation of shape [time, freq], and returns an operation of the bytes in JPEG image.
func SplitInputSeqs ¶
SplitInputSeqs splits long seqs into shorter seqs for training.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
demo
|
|
protobuf/tensorflow/core/framework
Package tensorflow is a generated protocol buffer package.
|
Package tensorflow is a generated protocol buffer package. |
Package lstmutils contains some useful functions for processing trained LSTM models in the particular format used by aural2.
|
Package lstmutils contains some useful functions for processing trained LSTM models in the particular format used by aural2. |