Viewing network information
Function Signature
def specs(self) -> str:
Return Value
output
(str): A string representation of the network information, including the model type, optimizer, parameters, loss function, and DeeprAI version.
Description
The specs
function returns a string representation of the network information, including the model type, optimizer, parameters, loss function, and DeeprAI version.
Examples
Here's an example of how to use the specs
function:
from deeprai.models import FeedForward
model = FeedForward()
model.add_dense(784)
model.add_dense(128, activation='relu')
model.add_dense(64, activation='relu')
model.add_dense(10, activation='softmax')
model.config(optimizer='gradient descent', loss='mean square error')
model_specs = model.specs()
print(model_specs)
This code creates a FeedForward
model with a single dense layer of size 784
, followed by two additional dense layers with ReLU activation functions, and a final dense layer with a softmax activation function. The config
function sets the optimizer to gradient descent
and the loss function to mean square error
.
The specs
function returns a string representation of the network information, including the model type, optimizer, parameters, loss function, and DeeprAI version, which can be printed to the console. The output should look something like this:
.---------------.------------------.-----------------.------------------.
| Key | Val | Key | Val |
:---------------+------------------+-----------------+------------------:
| Model | Feed Forward | Optimizer | Gradient Descent |
:---------------+------------------+-----------------+------------------:
| Parameters | 15 | Layer Model | 2x5x1 |
:---------------+------------------+-----------------+------------------:
| Loss Function | Mean Square Error| DeeprAI Version | 0.0.12 BETA |
'---------------'------------------'-----------------'------------------'
No Comments