Options
All
  • Public
  • Public/Protected
  • All
Menu

deeplearn

Index

Type aliases

Conv2DInfo

Conv2DInfo: object

Information about the forward pass of a convolution/pooling operation. It includes input and output shape, strides, filter size and padding information.

Type declaration

FeedEntry

FeedEntry: object

FeedEntry associates a tensor with user-provided NDArray data.

Type declaration

FlatVector

FlatVector: boolean[] | number[] | TypedArray

PadInfo

PadInfo: object

Type declaration

RegularArray

RegularArray: T[] | T[][] | T[][][] | T[][][][]

ScopeResult

ScopeResultImmediate

ScopeResultImmediate: void | NDArray | NDArray[] | object

TypedArray

TypedArray: Float32Array | Int32Array | Uint8Array
license

Copyright 2017 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.

Variables

NAN_BOOL

NAN_BOOL: 255 = 255

NAN_FLOAT32

NAN_FLOAT32: number = NaN

NAN_INT32

NAN_INT32: number = 1 << 31

Functions

arraysEqual

assert

  • assert(expr: boolean, msg: string): void
  • Parameters

    • expr: boolean
    • msg: string

    Returns void

assertShapesMatch

  • assertShapesMatch(shapeA: number[], shapeB: number[], errorMessagePrefix?: string): void
  • Parameters

    • shapeA: number[]
    • shapeB: number[]
    • Default value errorMessagePrefix: string = ""

    Returns void

clamp

  • clamp(min: number, x: number, max: number): number
  • Clamps a value to a specified range.

    Parameters

    • min: number
    • x: number
    • max: number

    Returns number

computeConv2DInfo

  • computeConv2DInfo(inShape: [number, number, number, number], filterShape: [number, number, number, number], strides: number | [number, number], pad: "same" | "valid" | number, depthwise?: boolean, dataFormat?: "channelsFirst" | "channelsLast"): Conv2DInfo
  • Computes the information for a forward pass of a convolution/pooling operation.

    Parameters

    • inShape: [number, number, number, number]
    • filterShape: [number, number, number, number]
    • strides: number | [number, number]
    • pad: "same" | "valid" | number
    • Default value depthwise: boolean = false
    • Default value dataFormat: "channelsFirst" | "channelsLast" = "channelsLast"

    Returns Conv2DInfo

computeDefaultPad

  • computeDefaultPad(inputShape: [number, number, number], fieldSize: number, stride: number): number
  • Parameters

    • inputShape: [number, number, number]
    • fieldSize: number
    • stride: number

    Returns number

computeDilatedRC

  • computeDilatedRC(rc: [number, number], origStride: number): [number, number]
  • deprecated

    Use conv_util.computeConv2DInfo() instead.

    Parameters

    • rc: [number, number]
    • origStride: number

    Returns [number, number]

computeOutputShape3D

  • computeOutputShape3D(inShape: [number, number, number], fieldSize: number, outDepth: number, stride: number, zeroPad?: number): [number, number, number]
  • deprecated

    Use conv_util.computeConvInfo instead.

    Parameters

    • inShape: [number, number, number]
    • fieldSize: number
    • outDepth: number
    • stride: number
    • Optional zeroPad: number

    Returns [number, number, number]

computePool2DInfo

  • computePool2DInfo(inShape: [number, number, number, number], filterSize: [number, number] | number, strides: number | [number, number], pad: "same" | "valid" | number, dataFormat?: "channelsFirst" | "channelsLast"): Conv2DInfo
  • Parameters

    • inShape: [number, number, number, number]
    • filterSize: [number, number] | number
    • strides: number | [number, number]
    • pad: "same" | "valid" | number
    • Default value dataFormat: "channelsFirst" | "channelsLast" = "channelsLast"

    Returns Conv2DInfo

computeWeightsShape4D

  • computeWeightsShape4D(inputDepth: number, outputDepth: number, filterHeight: number, filterWidth: number): [number, number, number, number]
  • deprecated

    Use conv_util.getShapes(convInfo) instead.

    Parameters

    • inputDepth: number
    • outputDepth: number
    • filterHeight: number
    • filterWidth: number

    Returns [number, number, number, number]

createShuffledIndices

  • createShuffledIndices(n: number): Uint32Array
  • Parameters

    • n: number

    Returns Uint32Array

distSquared

flatten

  • flatten(arr: number | boolean | RegularArray<number> | RegularArray<boolean>, ret?: Array<number | boolean>): Array<number | boolean>
  • Parameters

    Returns Array<number | boolean>

getNaN

  • getNaN(dtype: DType): number

getQueryParams

  • getQueryParams(queryString: string): object
  • Parameters

    • queryString: string

    Returns object

    • [key: string]: string

getTypedArrayFromDType

  • getTypedArrayFromDType<D>(dtype: D, size: number): DataTypes[D]
  • Type parameters

    • D: "float32" | "int32" | "bool"

    Parameters

    • dtype: D
    • size: number

    Returns DataTypes[D]

inferFromImplicitShape

  • inferFromImplicitShape(shape: number[], size: number): number[]
  • Given the full size of the array and a shape that may contain -1 as the implicit dimension, returns the inferred shape where -1 is replaced. E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3].

    Parameters

    • shape: number[]

      The shape, which may contain -1 in some dimension.

    • size: number

      The full size (number of elements) of the array.

    Returns number[]

    The inferred shape where -1 is replaced with the inferred size.

inferShape

isInt

  • isInt(a: number): boolean
  • Parameters

    • a: number

    Returns boolean

isScalarShape

  • isScalarShape(shape: number[]): boolean
  • Parameters

    • shape: number[]

    Returns boolean

isValNaN

  • isValNaN(val: number, dtype: DType): boolean

randUniform

  • randUniform(a: number, b: number): number
  • Returns a sample from a uniform [a, b] distribution.

    Parameters

    • a: number
    • b: number

    Returns number

repeatedTry

  • repeatedTry(checkFn: function, delayFn?: (Anonymous function), maxCounter?: number): Promise<void>
  • Parameters

    • checkFn: function
        • (): boolean
        • Returns boolean

    • Default value delayFn: (Anonymous function) = (counter: number) => 0
    • Optional maxCounter: number

    Returns Promise<void>

rightPad

  • rightPad(a: string, size: number): string
  • Parameters

    • a: string
    • size: number

    Returns string

shuffle

  • shuffle(array: any[] | Uint32Array | Int32Array | Float32Array): void
  • Shuffles the array using Fisher-Yates algorithm.

    Parameters

    • array: any[] | Uint32Array | Int32Array | Float32Array

    Returns void

sizeFromShape

  • sizeFromShape(shape: number[]): number
  • Parameters

    • shape: number[]

    Returns number

sizeToSquarishShape

  • sizeToSquarishShape(size: number): [number, number]
  • Parameters

    • size: number

    Returns [number, number]

squeezeShape

  • squeezeShape(shape: number[]): object
  • Reduces the shape by removing all dimensions of shape 1.

    Parameters

    • shape: number[]

    Returns object

tanh

  • tanh(x: number): number
  • Parameters

    • x: number

    Returns number

Generated using TypeDoc