{"id":13816308,"url":"https://github.com/tobegit3hub/tensorflow_template_application","last_synced_at":"2025-05-15T10:01:53.340Z","repository":{"id":41271452,"uuid":"63595107","full_name":"tobegit3hub/tensorflow_template_application","owner":"tobegit3hub","description":"TensorFlow template application for deep learning","archived":false,"fork":false,"pushed_at":"2023-07-05T20:27:20.000Z","size":46958,"stargazers_count":1878,"open_issues_count":19,"forks_count":714,"subscribers_count":184,"default_branch":"master","last_synced_at":"2025-04-14T16:53:40.004Z","etag":null,"topics":["cnn","csv","deep-learning","inference","libsvm","lstm","machine-learning","mlp","serving","tensorboard","tensorflow","tfrecords","wide-and-deep"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tobegit3hub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-18T10:54:20.000Z","updated_at":"2025-04-09T20:19:37.000Z","dependencies_parsed_at":"2024-06-18T18:35:59.156Z","dependency_job_id":"37bf4e1f-bf13-4a28-a05a-2174192c2818","html_url":"https://github.com/tobegit3hub/tensorflow_template_application","commit_stats":{"total_commits":196,"total_committers":9,"mean_commits":21.77777777777778,"dds":0.05102040816326525,"last_synced_commit":"a2be179bf5e2624cdc3c0ed3cf8b5f7eff87777d"},"previous_names":["tobegit3hub/deep_recommend_system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobegit3hub%2Ftensorflow_template_application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobegit3hub%2Ftensorflow_template_application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobegit3hub%2Ftensorflow_template_application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobegit3hub%2Ftensorflow_template_application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobegit3hub","download_url":"https://codeload.github.com/tobegit3hub/tensorflow_template_application/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319715,"owners_count":22051072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","csv","deep-learning","inference","libsvm","lstm","machine-learning","mlp","serving","tensorboard","tensorflow","tfrecords","wide-and-deep"],"created_at":"2024-08-04T05:00:38.726Z","updated_at":"2025-05-15T10:01:51.765Z","avatar_url":"https://github.com/tobegit3hub.png","language":"Python","readme":"## Introduction\n\nIt is the generic golden program for deep learning with [TensorFlow](https://github.com/tensorflow/tensorflow).\n\n![](./architecture.jpeg)\n\n- [x] Data Formats\n  - [x] [CSV](./data/)\n  - [x] [LIBSVM](./data/)\n  - [x] [TFRecords](./data/)\n- [x] Predict Server\n  - [x] [TensorFlow serving](./cpp_predict_server/)\n  - [x] [Python HTTP server](./http_service/)\n- [x] Predict Client\n  - [x] [Python gPRC client](./python_predict_client/)\n  - [x] [Java gPRC client](./java_predict_client/)\n  - [x] [Scala gPRC client](./java_predict_client/)\n  - [x] [Golang gRPC client](./golang_predict_client/)\n  - [x] [C++ gRPC client](./cpp_predict_client/)\n  - [x] [Spark client](./java_predict_client/)\n  - [x] [Android client](./android_client/)\n  - [x] [iOS client](./ios_client/)\n- [x] Network Models\n  - [x] Logistic regression\n  - [x] Deep neural network\n  - [x] Convolution neural network\n  - [x] Wide and deep model\n  - [x] Regression model\n  - [x] Customized models\n- [x] Other Features\n  - [x] Checkpoint\n  - [x] TensorBoard\n  - [x] Exporter\n  - [x] Dropout\n  - [x] Optimizers\n  - [x] Learning rate decay\n  - [x] Batch normalization\n  - [x] Benchmark mode\n  - [x] [Distributed training](./distributed/)\n\n## Usage\n\n### Generate TFRecords\n\nIf your data is in CSV format, generate TFRecords like this.\n\n```\ncd ./data/cancer/\n\n./generate_csv_tfrecords.py\n```\n\nIf your data is in LIBSVM format, generate TFRecords like this.\n\n```\ncd ./data/a8a/\n\n./generate_libsvm_tfrecord.py\n```\n\nFor large dataset, you can use Spark to do that. Please refer to [data](./data/).\n\n### Run Training\n\nYou can train with the default configuration.\n\n```\n./dense_classifier.py\n\n./sparse_classifier.py\n```\n\nUsing different models or hyperparameters is easy with TensorFlow flags.\n\n```\n./dense_classifier.py --batch_size 1024 --epoch_number 1000 --step_to_validate 10 --optmizier adagrad --model dnn --model_network \"128 32 8\"\n```\n\nIf you use other dataset like [iris](./data/iris/), no need to modify the code. Just run with parameters to specify the TFRecords files.\n\n```\n./dense_classifier.py --train_file ./data/iris/iris_train.csv.tfrecords --validate_file ./data/iris/iris_test.csv.tfrecords --feature_size 4 --label_size 3  --enable_colored_log\n\n./dense_classifier.py --train_file ./data/iris/iris_train.csv --validate_file ./data/iris/iris_test.csv --feature_size 4 --label_size 3 --input_file_format csv --enable_colored_log\n```\n\nIf you want to use CNN model, try this command.\n\n```\n./dense_classifier.py --train_file ./data/lung/fa7a21165ae152b13def786e6afc3edf.dcm.csv.tfrecords --validate_file ./data/lung/fa7a21165ae152b13def786e6afc3edf.dcm.csv.tfrecords --feature_size 262144 --label_size 2 --batch_size 2 --validate_batch_size 2 --epoch_number -1 --model cnn\n```\n\nFor [boston housing](./data/boston_housing/) dataset.\n\n```\n./dense_classifier.py --train_file ./data/boston_housing/train.csv.tfrecords --validate_file ./data/boston_housing/train.csv.tfrecords --feature_size 13 --label_size 1 --scenario regression  --batch_size 1 --validate_batch_size 1\n```\n\n### Export The Model\n\nAfter training, it will export the model automatically. Or you can export manually.\n\n```\n./dense_classifier.py --mode savedmodel\n```\n\n### Validate The Model\n\nIf we want to run inference to validate the model, you can run like this.\n\n```\n./dense_classifier.py --mode inference\n```\n\n### Use TensorBoard\n\nThe program will generate TensorFlow event files automatically.\n\n```\ntensorboard --logdir ./tensorboard/\n```\n\nThen go to `http://127.0.0.1:6006` in the browser.\n\n### Serving and Predicting\n\nThe exported model is compatible with [TensorFlow Serving](https://github.com/tensorflow/serving). You can follow the document and run the `tensorflow_model_server`.\n\n```\n./tensorflow_model_server --port=9000 --model_name=dense --model_base_path=./model/\n```\n\nWe have provided some gRPC clients for dense and sparse models, such as [Python predict client](./python_predict_client/) and [Java predict client](./java_predict_client/).\n\n```\n./predict_client.py --host 127.0.0.1 --port 9000 --model_name dense --model_version 1\n\nmvn compile exec:java -Dexec.mainClass=\"com.tobe.DensePredictClient\" -Dexec.args=\"127.0.0.1 9000 dense 1\"\n```\n\n## Contribution\n\nThis project is widely used for different tasks with dense or sparse data.\n\nIf you want to make contributions, feel free to open an [issue](https://github.com/tobegit3hub/deep_recommend_system/issues) or [pull-request](https://github.com/tobegit3hub/deep_recommend_system/pulls).\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobegit3hub%2Ftensorflow_template_application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobegit3hub%2Ftensorflow_template_application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobegit3hub%2Ftensorflow_template_application/lists"}