help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
tensorflow-deeplearning
/
tests
RSK World
tensorflow-deeplearning
Deep learning with TensorFlow and Keras
tests
  • __init__.py159 B
  • test_cnns.py1.4 KB
  • test_neural_networks.py1.7 KB
test_cnns.py
tests/test_cnns.py
Raw Download
Find: Go to:
"""
Tests for CNNs Module
Author: RSK World
Website: https://rskworld.in
Email: help@rskworld.in
Phone: +91 93305 39277
"""

import unittest
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))

import numpy as np
from src.cnns import (
    create_simple_cnn,
    create_deep_cnn
)

class TestCNNs(unittest.TestCase):
    """Test cases for CNNs module."""
    
    def test_create_simple_cnn(self):
        """Test simple CNN creation."""
        model = create_simple_cnn(input_shape=(32, 32, 3), num_classes=10)
        self.assertIsNotNone(model)
        self.assertEqual(model.input_shape, (None, 32, 32, 3))
        self.assertEqual(model.output_shape, (None, 10))
    
    def test_create_deep_cnn(self):
        """Test deep CNN creation."""
        model = create_deep_cnn(input_shape=(32, 32, 3), num_classes=10)
        self.assertIsNotNone(model)
        self.assertEqual(model.input_shape, (None, 32, 32, 3))
        self.assertEqual(model.output_shape, (None, 10))
    
    def test_cnn_prediction(self):
        """Test CNN prediction."""
        model = create_simple_cnn(input_shape=(32, 32, 3), num_classes=10)
        test_input = np.random.randn(1, 32, 32, 3).astype('float32')
        prediction = model.predict(test_input, verbose=0)
        self.assertEqual(prediction.shape, (1, 10))

if __name__ == '__main__':
    unittest.main()
46 lines•1.4 KB
python

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer