Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "core/sketch_support"

Support modules used by SketchRNN

license

Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Variables

Let returnV

returnV: boolean = false

Let vVal

vVal: number = 0

Functions

birandn

  • birandn(mu1: number, mu2: number, std1: number, std2: number, rho: number): number[]
  • Parameters

    • mu1: number
    • mu2: number
    • std1: number
    • std2: number
    • rho: number

    Returns number[]

gaussRandom

  • gaussRandom(): number

lineToStroke

  • lineToStroke(line: number[][], lastPoint: number[]): number[][]
  • Convert to stroke-5 format to polyline

    Parameters

    • line: number[][]
    • lastPoint: number[]

    Returns number[][]

linesToStrokes

  • linesToStrokes(rawData: number[][][]): number[][]
  • Convert from polylines to stroke-5 format that sketch-rnn uses

    Parameters

    • rawData: number[][][]

    Returns number[][]

randf

  • randf(a: number, b: number): number

randi

  • randi(a: number, b: number): number

randn

  • randn(mu: number, std: number): number

sampleSoftmax

  • sampleSoftmax(zSample: number[] | Float32Array): number
  • Sample from a categorial distribution

    Parameters

    • zSample: number[] | Float32Array

    Returns number

simplifyLine

  • simplifyLine(V: number[][], tolerance?: number): number[][]

simplifyLines

  • simplifyLines(lines: number[][][], tolerance?: number): number[][][]
  • Clean wrapper method to use RDP function.

    Parameters

    • lines: number[][][]
    • Optional tolerance: number

    Returns number[][][]

stringToArray

  • stringToArray(b64encoded: string): Int16Array
  • Converts b64 data into int16 array version.

    Parameters

    • b64encoded: string

      String of b64 encoded data.

    Returns Int16Array

    int16 version of data.

stringToUint8array

  • stringToUint8array(b64encoded: string): Uint8Array
  • Deals with decompressing b64 models to uint8 arrays.

    Parameters

    • b64encoded: string

      String of b64 encoded data.

    Returns Uint8Array

    uint8 version of data.

Generated using TypeDoc