Package: tensorhub
You have just found TensorHub.The open source library to help you develop and train ML models, easy and fast as never before withTensorFlow 2.0.TensorHubis a global collection ofbuilding blocksandready to serve models.It is a wrapper library of deep learning models and neural lego blocks designed to make deep learning more accessible and accelerate ML research.UseTensorHubif you need a deep learning library that:Reproducibility- Reproduce the results of existing pre-training models (such as Google BERT, XLNet)Model modularity- TensorHub divided into multiple components: ready-to-serve models, layers, neural-blocks etc. Ample modules are implemented in each component. Clear and robust interface allows users to combine modules with as few restrictions as possible.Prototyping- Code less build more. ApplyTensorHubto create fast prototypes with the help of modulear blocks, custom layers, custom activation support.Platform Independent- Supports bothKerasandTensorFlow 2.0. Run your model on CPU, single GPU or using a distributed training strategy.Getting started: 30 seconds to TensorHubHere is theSequentialmodel forImage Classification:fromtensorflow.keras.modelsimportSequentialfromtensorflow.keras.layersimportConv2D,Dense# Use Tensorhub to accelerate your prototypingfromtensorhub.layersimportInceptionV1# Custom Inception Layerfromtensorhub.models.image.classifiersimportCNNClassifier,VGG16# Cooked Modelsfromtensorhub.utilities.activationsimportgelu,softmax# Custom Activations Supported## Initiate a sequential modelmodel=Sequential()## Stacking layers is as easy as `.add()`model.add(Conv2D(32,(3,3),activation=gelu,input_shape=(100,100,3)))model.add(Conv2D(32,(3,3),activation=gelu))model.add(MaxPooling2D(pool_size=(2,2)))model.add(Dropout(0.25))## Add custom layer like any other standard layermodel.add(InceptionV1(32))model.add(Dense(units=64,activation=gelu,input_dim=100))model.add(Dense(units=10,activation=softmax))# Or## Use one of our pre-cooked modelsmodel=VGG16(n_classes=10,num_nodes=64,img_height=100,img_width=100)## Once your model looks good, configure its learning process with `.compile()`model.compile(loss='categorical_crossentropy',optimizer='sgd',metrics=['accuracy'])## Alternatively, if you need to, you can further configure your compile configurationmodel.compile(loss=tensorflow.keras.losses.categorical_crossentropy,optimizer=tensorflow.keras.optimizers.SGD(lr=0.01,momentum=0.9,nesterov=True),metrics=['acc'])## You can now iterate on your training data in batches## x_train and y_train are Numpy arraysmodel.fit(x_train,y_train,epochs=5,batch_size=32)## Alternatively, you can feed batches to your model manuallymodel.train_on_batch(x_batch,y_batch)## Evaluate your performance in one line:loss_and_metrics=model.evaluate(x_test,y_test,batch_size=128)## Or generate predictions on new dataclasses=model.predict(x_test,batch_size=128)Building a question answering system, an image classification model, a Neural Turing Machine, or any other model is just as fast. The ideas behind deep learning are simple, so why should their implementation be painful?For a more in-depth tutorial about Keras, you can check out:Getting started with Text ClassificationGetting started with Custom LayersIn theexamples folderof this repository, you will find much more advanced examples coming your way very soon.What's coming in V1.0Cooked ModelsImage Classification (Supports Transfer Learning with ImageNet Weights)XceptionVGG16VGG19ResNet50InceptionV3InceptionResNetV2MobileNetDenseNetNASNetSqueezeNet (Without Transfer Learning) *Text ClassificationRNN ModelLSTM ModelGRU ModelText-CNNNeural Machine Translation *Encoder-Decoder Sequence Translation ModelTranslation with AttentionText Generation *RNN, LSTM, GRU Based ModelNamed Entity Recogniton *RNN, LSTM, GRU Based ModelCustom Modules/LayersStandard LayersLinearInception V1 LayerInception V1 with Reduction LayerInception V2 Layer *Inception V3 Layer *Attention layersBahdanau AttentionLuong AttentionSelf-Attention *UtilitiesTextCustom Word and Character TokenizerLoad Pre-trained EmbeddingsCreate Vocabulary MatrixImage *Image AugmentationActivationsRELUSELUGELUELUTanhSigmoidHard SigmoidSoftmaxSoftplusSoftsignExponentialLinearTrainer (Generic TF2.0 train and validation pipelines) *Note:*- Support coming soonInstallationBefore installingTensorHub, please install its backend engines: TensorFlow (TensorFlow 2.0 is Recommended).Install TensorFlow and Get Started!Build, deploy, and experiment easily with TensorFlowYou may also consider installing the followingoptional dependencies:cuDNN(Recommended if you plan on running Keras on GPU).HDF5 andh5py(Required if you plan on saving Keras models to disk).Then, you can install TensorHub itself.sudopipinstalltensorhub==1.0.0a3If you are using a virtualenv, you may want to avoid using sudo:pipinstalltensorhub==1.0.0a3Alternatively: Install TensorHub from the GitHub source:First, clone TensorHub usinggit:gitclonehttps://github.com/nityansuman/tensorhub.gitThen,cdto the TensroHub folder and run the install command:cdtensorhub
sudopythonsetup.pyinstallSupportYou can also postbug reports and feature requests(only) inGitHub issues. Make sure to readour guidelinesfirst.We are eager to collaborate with you. Feel free to open an issue on or send along a pull request.
If you like the work, show your appreciation by "FORK", "STAR", or "SHARE".