Class Backend
Keras is a model-level library, providing high-level building blocks for developing deep learning models. It does not handle low-level operations such as tensor products, convolutions and so on itself. Instead, it relies on a specialized, well optimized tensor manipulation library to do so, serving as the "backend engine" of Keras. Rather than picking one single tensor library and making the implementation of Keras tied to that library, Keras handles the problem in a modular way, and several different backend engines can be plugged seamlessly into Keras.
Implements
Inherited Members
Namespace: Keras
Assembly: Keras.dll
Syntax
public class Backend : Base, IDisposable
Methods
| Improve this Doc View SourceCastToFloatX(NDarray)
Cast a Numpy array to the default Keras float type.
Declaration
public NDarray CastToFloatX(NDarray x)
Parameters
| Type | Name | Description |
|---|---|---|
| Numpy.NDarray | x | The x, Numpy array.. |
Returns
| Type | Description |
|---|---|
| Numpy.NDarray | The same Numpy array, cast to its new type. |
ClearSession()
Destroys the current TF graph and creates a new one.Useful to avoid clutter from old models / layers.
Declaration
public static void ClearSession()
Epsilon()
Returns the value of the fuzz factor used in numeric expressions.
Declaration
public static float Epsilon()
Returns
| Type | Description |
|---|---|
| System.Single |
FloatX()
Returns the default float type, as a string. (e.g. 'float16', 'float32', 'float64').
Declaration
public string FloatX()
Returns
| Type | Description |
|---|---|
| System.String | String, the current default float type. |
GetBackend()
Publicly accessible method for determining the current backend.
Declaration
public static string GetBackend()
Returns
| Type | Description |
|---|---|
| System.String | String, the name of the backend Keras is currently using. |
GetUid(String)
Get the uid for the default graph.
Declaration
public static string GetUid(string prefix = "")
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | prefix | An optional prefix of the graph. |
Returns
| Type | Description |
|---|---|
| System.String | A unique identifier for the graph. |
ImageDataFormat()
Returns the default image data format convention.
Declaration
public static string ImageDataFormat()
Returns
| Type | Description |
|---|---|
| System.String | A string, either 'channels_first' or 'channels_last' |
IsSparse(NDarray)
Determines whether the specified tensor is sparse.
Declaration
public static bool IsSparse(NDarray tensor)
Parameters
| Type | Name | Description |
|---|---|---|
| Numpy.NDarray | tensor | The tensor. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
ResetUids()
Resets graph identifiers.
Declaration
public static void ResetUids()
SetEpsilon(Single)
Sets the value of the fuzz factor used in numeric expressions.
Declaration
public void SetEpsilon(float e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | e | float. New value of epsilon. |
SetFloatX(String)
Sets the default float type.
Declaration
public void SetFloatX(string floatx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | floatx | String, 'float16', 'float32', or 'float64'. |
SetImageDataFormat(String)
Sets the image data format.
Declaration
public static void SetImageDataFormat(string data_format)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | data_format | data_format: string. 'channels_first' or 'channels_last'. |
ToDense(NDarray)
Converts a sparse tensor into a dense tensor and returns it.
Declaration
public static NDarray ToDense(NDarray tensor)
Parameters
| Type | Name | Description |
|---|---|---|
| Numpy.NDarray | tensor | The tensor potentially sparse. |
Returns
| Type | Description |
|---|---|
| Numpy.NDarray | A dense tensor. |