Main Content

tribas

(To be removed) Triangular basis transfer function

tribas will be removed in a future release. For more information, see Transition Legacy Neural Network Code to dlnetwork Workflows.

For advice on updating your code, see Version History.

Graph and Symbol

Triangular basis transfer function. The function returns 0 if input n is less than or equal to -1 or if n is greater than or equal to 1. When input n is between -1 and 1, the function takes the shape of a triangle, returning 1 when input n is 0.

Syntax

A = tribas(N,FP)

Description

tribas is a neural transfer function. Transfer functions calculate a layer’s output from its net input.

A = tribas(N,FP) takes N and optional function parameters,

N

S-by-Q matrix of net input (column) vectors

FP

Struct of function parameters (ignored)

and returns A, an S-by-Q matrix of the triangular basis function applied to each element of N.

info = tribas('code') can take the following forms to return specific information:

tribas('name') returns the name of this function.

tribas('output',FP) returns the [min max] output range.

tribas('active',FP) returns the [min max] active input range.

tribas('fullderiv') returns 1 or 0, depending on whether dA_dN is S-by-S-by-Q or S-by-Q.

tribas('fpnames') returns the names of the function parameters.

tribas('fpdefaults') returns the default function parameters.

Examples

Here you create a plot of the tribas transfer function.

n = -5:0.1:5;
a = tribas(n);
plot(n,a)

Assign this transfer function to layer i of a network.

net.layers{i}.transferFcn = 'tribas';

Algorithms

a = tribas(n) = 1 - abs(n), if -1 <= n <= 1
              = 0, otherwise