DeepStorm


NameDeepStorm JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/HassanRady/DeepStorm
SummaryDeep Learning framework from scratch
upload_time2023-08-17 07:29:58
maintainer
docs_urlNone
authorHassan Rady
requires_python==3.9.16
licenseMIT license
keywords tweets
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # DeepStorm: Deep Learning Framework

## Summary:
Deep Learning Framework from scratch, with an API of a combination of pytorch and keras APIs, only uses numpy for tensor operations.

## Pip install:
```sh
pip install DeepStorm
```

## Layers & DL classes in framework:
- Conv2d
- MaxPool2d
- BatchNorm2d
- Flatten
- Dropout
- Linear
- ReLU
- Softmax
- SgdWithMomentum
- Adam
- CrossEntropyLoss
- Xavier
- He

## Model building:
```py
layers = [
    Conv2d(in_channels=1, out_channels=32,
           kernel_size=3, stride=1, padding='same'),
    BatchNorm2d(32),
    Dropout(probability=0.3),
    ReLU(),

    Conv2d(in_channels=32, out_channels=64,
           kernel_size=3, stride=1, padding='same'),
    BatchNorm2d(64),
    ReLU(),
    MaxPool2d(kernel_size=2, stride=2),

    Conv2d(in_channels=64, out_channels=64,
           kernel_size=3, stride=1, padding='same'),
    BatchNorm2d(64),
    ReLU(),
    MaxPool2d(kernel_size=2, stride=2),

    Flatten(),

    Linear(in_features=64*7*7, out_features=128),
    ReLU(),
    Linear(128, 64),
    ReLU(),
    Linear(64, 10),
    SoftMax(),
]

model = Model(layers)
```

Or

```py
model = Model()

model.append_layer(Conv2d(in_channels=1, out_channels=32,
                          kernel_size=3, stride=1, padding='same'))
model.append_layer(BatchNorm2d(32))
model.append_layer(ReLU())
model.append_layer(Conv2d(in_channels=32, out_channels=64,
                          kernel_size=3, stride=1, padding='same'))
model.append_layer(BatchNorm2d(64))
model.append_layer(ReLU())
model.append_layer(MaxPool2d(kernel_size=2, stride=2))

model.append_layer(Conv2d(in_channels=64, out_channels=64,
                          kernel_size=3, stride=1, padding='same'))
model.append_layer(BatchNorm2d(64))
model.append_layer(ReLU())
model.append_layer(MaxPool2d(kernel_size=2, stride=2))
model.append_layer(Flatten())
model.append_layer(Linear(in_features=64*7*7, out_features=128))
model.append_layer(ReLU())
model.append_layer(Linear(in_features=128, out_features=64))
model.append_layer(ReLU())
model.append_layer(Linear(in_features=64, out_features=10))
model.append_layer(SoftMax())
```

## Model compile:


```py
batch_size = 16
model.compile(optimizer=Adam(learning_rate=5e-3, mu=0.98, rho=0.999), loss=CrossEntropyLoss(),
              batch_size=batch_size, metrics=['accuracy'])
```

## Model training:
```py
epochs = 25
history = model.fit(x_train=train_images, y_train=train_labels, x_val=val_images, y_val=val_labels, epochs=epochs)
```

## Model performance:
```py
plt.plot(history['accuracy'])
plt.plot(history['val_accuracy'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'val'], loc='upper left')
plt.show()
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/HassanRady/DeepStorm",
    "name": "DeepStorm",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "==3.9.16",
    "maintainer_email": "",
    "keywords": "Tweets",
    "author": "Hassan Rady",
    "author_email": "hassan.khaled.rady@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b8/a5/4bc2f186d7355fc18c9c51c432bd90378f6ee8c29c9cce8eb626e6a3d797/DeepStorm-1.1.0.tar.gz",
    "platform": null,
    "description": "# DeepStorm: Deep Learning Framework\n\n## Summary:\nDeep Learning Framework from scratch, with an API of a combination of pytorch and keras APIs, only uses numpy for tensor operations.\n\n## Pip install:\n```sh\npip install DeepStorm\n```\n\n## Layers & DL classes in framework:\n- Conv2d\n- MaxPool2d\n- BatchNorm2d\n- Flatten\n- Dropout\n- Linear\n- ReLU\n- Softmax\n- SgdWithMomentum\n- Adam\n- CrossEntropyLoss\n- Xavier\n- He\n\n## Model building:\n```py\nlayers = [\n    Conv2d(in_channels=1, out_channels=32,\n           kernel_size=3, stride=1, padding='same'),\n    BatchNorm2d(32),\n    Dropout(probability=0.3),\n    ReLU(),\n\n    Conv2d(in_channels=32, out_channels=64,\n           kernel_size=3, stride=1, padding='same'),\n    BatchNorm2d(64),\n    ReLU(),\n    MaxPool2d(kernel_size=2, stride=2),\n\n    Conv2d(in_channels=64, out_channels=64,\n           kernel_size=3, stride=1, padding='same'),\n    BatchNorm2d(64),\n    ReLU(),\n    MaxPool2d(kernel_size=2, stride=2),\n\n    Flatten(),\n\n    Linear(in_features=64*7*7, out_features=128),\n    ReLU(),\n    Linear(128, 64),\n    ReLU(),\n    Linear(64, 10),\n    SoftMax(),\n]\n\nmodel = Model(layers)\n```\n\nOr\n\n```py\nmodel = Model()\n\nmodel.append_layer(Conv2d(in_channels=1, out_channels=32,\n                          kernel_size=3, stride=1, padding='same'))\nmodel.append_layer(BatchNorm2d(32))\nmodel.append_layer(ReLU())\nmodel.append_layer(Conv2d(in_channels=32, out_channels=64,\n                          kernel_size=3, stride=1, padding='same'))\nmodel.append_layer(BatchNorm2d(64))\nmodel.append_layer(ReLU())\nmodel.append_layer(MaxPool2d(kernel_size=2, stride=2))\n\nmodel.append_layer(Conv2d(in_channels=64, out_channels=64,\n                          kernel_size=3, stride=1, padding='same'))\nmodel.append_layer(BatchNorm2d(64))\nmodel.append_layer(ReLU())\nmodel.append_layer(MaxPool2d(kernel_size=2, stride=2))\nmodel.append_layer(Flatten())\nmodel.append_layer(Linear(in_features=64*7*7, out_features=128))\nmodel.append_layer(ReLU())\nmodel.append_layer(Linear(in_features=128, out_features=64))\nmodel.append_layer(ReLU())\nmodel.append_layer(Linear(in_features=64, out_features=10))\nmodel.append_layer(SoftMax())\n```\n\n## Model compile:\n\n\n```py\nbatch_size = 16\nmodel.compile(optimizer=Adam(learning_rate=5e-3, mu=0.98, rho=0.999), loss=CrossEntropyLoss(),\n              batch_size=batch_size, metrics=['accuracy'])\n```\n\n## Model training:\n```py\nepochs = 25\nhistory = model.fit(x_train=train_images, y_train=train_labels, x_val=val_images, y_val=val_labels, epochs=epochs)\n```\n\n## Model performance:\n```py\nplt.plot(history['accuracy'])\nplt.plot(history['val_accuracy'])\nplt.title('model accuracy')\nplt.ylabel('accuracy')\nplt.xlabel('epoch')\nplt.legend(['train', 'val'], loc='upper left')\nplt.show()\n```\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Deep Learning framework from scratch",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/HassanRady/DeepStorm"
    },
    "split_keywords": [
        "tweets"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0398a614ce9c12d16945c0bbeb02fa1b77a297d2cbb4a5b48f6a4f05d0ef81d7",
                "md5": "94be8371332b217007b66f28394ec327",
                "sha256": "8d57c48775e9cac298632ca1c301e8a047f322beaef1855f93d621e6c64bf228"
            },
            "downloads": -1,
            "filename": "DeepStorm-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "94be8371332b217007b66f28394ec327",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "==3.9.16",
            "size": 16352,
            "upload_time": "2023-08-17T07:29:56",
            "upload_time_iso_8601": "2023-08-17T07:29:56.879813Z",
            "url": "https://files.pythonhosted.org/packages/03/98/a614ce9c12d16945c0bbeb02fa1b77a297d2cbb4a5b48f6a4f05d0ef81d7/DeepStorm-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8a54bc2f186d7355fc18c9c51c432bd90378f6ee8c29c9cce8eb626e6a3d797",
                "md5": "a3ac23acd1e2515094c006ab756186f9",
                "sha256": "deef0d645c11e89b6cb14e6c3840d87c91e5ca2c229400322a448d1932455243"
            },
            "downloads": -1,
            "filename": "DeepStorm-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a3ac23acd1e2515094c006ab756186f9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "==3.9.16",
            "size": 26527,
            "upload_time": "2023-08-17T07:29:58",
            "upload_time_iso_8601": "2023-08-17T07:29:58.522053Z",
            "url": "https://files.pythonhosted.org/packages/b8/a5/4bc2f186d7355fc18c9c51c432bd90378f6ee8c29c9cce8eb626e6a3d797/DeepStorm-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-17 07:29:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "HassanRady",
    "github_project": "DeepStorm",
    "github_not_found": true,
    "lcname": "deepstorm"
}
        
Elapsed time: 0.14217s