1 | /// <amd-module name="@tensorflow/tfjs-core/dist/ops/conv1d" />
|
2 | /**
|
3 | * @license
|
4 | * Copyright 2020 Google LLC. All Rights Reserved.
|
5 | * Licensed under the Apache License, Version 2.0 (the "License");
|
6 | * you may not use this file except in compliance with the License.
|
7 | * You may obtain a copy of the License at
|
8 | *
|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
10 | *
|
11 | * Unless required by applicable law or agreed to in writing, software
|
12 | * distributed under the License is distributed on an "AS IS" BASIS,
|
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 | * See the License for the specific language governing permissions and
|
15 | * limitations under the License.
|
16 | * =============================================================================
|
17 | */
|
18 | import { Tensor2D, Tensor3D } from '../tensor';
|
19 | import { TensorLike } from '../types';
|
20 | import * as conv_util from './conv_util';
|
21 | /**
|
22 | * Computes a 1D convolution over the input x.
|
23 | *
|
24 | * @param x The input tensor, of rank 3 or rank 2, of shape
|
25 | * `[batch, width, inChannels]`. If rank 2, batch of 1 is assumed.
|
26 | * @param filter The filter, rank 3, of shape
|
27 | * `[filterWidth, inDepth, outDepth]`.
|
28 | * @param stride The number of entries by which the filter is moved right at
|
29 | * each step.
|
30 | * @param pad The type of padding algorithm.
|
31 | * - `same` and stride 1: output will be of same size as input,
|
32 | * regardless of filter size.
|
33 | * - `valid`: output will be smaller than input if filter is larger
|
34 | * than 1x1.
|
35 | * - For more info, see this guide:
|
36 | * [https://www.tensorflow.org/api_docs/python/tf/nn/convolution](
|
37 | * https://www.tensorflow.org/api_docs/python/tf/nn/convolution)
|
38 | * @param dataFormat An optional string from "NWC", "NCW". Defaults to "NWC",
|
39 | * the data is stored in the order of [batch, in_width, in_channels]. Only
|
40 | * "NWC" is currently supported.
|
41 | * @param dilation The dilation rate in which we sample input values in
|
42 | * atrous convolution. Defaults to `1`. If it is greater than 1, then
|
43 | * stride must be `1`.
|
44 | * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is
|
45 | * provided, it will default to truncate.
|
46 | *
|
47 | * @doc {heading: 'Operations', subheading: 'Convolution'}
|
48 | */
|
49 | declare function conv1d_<T extends Tensor2D | Tensor3D>(x: T | TensorLike, filter: Tensor3D | TensorLike, stride: number, pad: 'valid' | 'same' | number | conv_util.ExplicitPadding, dataFormat?: 'NWC' | 'NCW', dilation?: number, dimRoundingMode?: 'floor' | 'round' | 'ceil'): T;
|
50 | export declare const conv1d: typeof conv1d_;
|
51 | export {};
|