summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-31 04:58:54 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-31 04:58:54 +0000
commit20b72cf0a99b05c171002c162d5391669f3cac0b (patch)
tree0adc65d8f1e407ee761504c90ca75152a8b0f4c2
parentb54bb2d34674ba30a1ee88e05960b176a2e21861 (diff)
automatic import of python-record-keeper
-rw-r--r--.gitignore1
-rw-r--r--python-record-keeper.spec209
-rw-r--r--sources1
3 files changed, 211 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..0181847 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/record-keeper-0.9.32.tar.gz
diff --git a/python-record-keeper.spec b/python-record-keeper.spec
new file mode 100644
index 0000000..71bdc28
--- /dev/null
+++ b/python-record-keeper.spec
@@ -0,0 +1,209 @@
+%global _empty_manifest_terminate_build 0
+Name: python-record-keeper
+Version: 0.9.32
+Release: 1
+Summary: Record experiment data easily
+License: MIT License
+URL: https://github.com/KevinMusgrave/record-keeper
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0d/80/638964de3494cf9e7cba7ea96406b27bc5f88ea647897eb82ce45f42dd33/record-keeper-0.9.32.tar.gz
+BuildArch: noarch
+
+Requires: python3-numpy
+Requires: python3-torch
+
+%description
+# record-keeper
+
+## Installation
+```
+pip install record-keeper
+```
+
+## The Problem:
+When running machine-learning experiments, having more logged data is usually better than less. But adding new series of data to log can often require changes to your training code. When you want to log dozens of different series of data, your code starts to look awful.
+
+## The Solution:
+
+Use RecordKeeper, and easily add loggable information when you write a new class. The example below is modified from the [pytorch-metric-learning](https://github.com/KevinMusgrave/pytorch-metric-learning/blob/master/src/pytorch_metric_learning/miners/batch_hard_miner.py) library.
+
+First, create a list that contains the names of the attributes you want to record (```self._record_these``` in the example below).
+```python
+class BatchHardMiner(BaseTupleMiner):
+ def __init__(self, **kwargs):
+ super().__init__(**kwargs)
+ self._record_these = ["hardest_triplet_dist", "hardest_pos_pair_dist", "hardest_neg_pair_dist"]
+```
+
+Then tell RecordKeeper the name of the list to read. RecordKeeper will log and save all the attributes described in the list. It'll search recursively too, if you have nested objects.
+```python
+from torch.utils.tensorboard import SummaryWriter
+import record_keeper as record_keeper_package
+from pytorch_metric_learning import miners
+
+record_writer = record_keeper_package.RecordWriter(your_folder_for_logs)
+tensorboard_writer = SummaryWriter(log_dir=your_tensorboard_folder)
+record_keeper = record_keeper_package.RecordKeeper(tensorboard_writer, record_writer, ["_record_these"])
+
+your_miner_dictionary = {"tuple_miner": miners.BatchHardMiner()}
+
+# Then at each iteration of training:
+record_keeper.update_records(your_miner_dictionary, current_iteration)
+```
+
+Now the attributes described in ```_record_these```, (specifically, ```hardest_triplet_dist```, ```hardest_pos_pair_dist```, and ```hardest_neg_pair_dist```) can be viewed on Tensorboard.
+
+These data series are also saved in sqlite and CSV format. If you only want to use Tensorboard, then pass in only a SummaryWriter, and vice versa.
+
+The dictionary that you pass into ```record_keeper.update_records``` can contain any number of objects, and for each one, RecordKeeper will check if the object has a "_record_these" attribute. As long as you're making your dictionaries programmatically, it's possible to add large amounts of loggable data without clogging up your training code. See [pytorch-metric-learning](https://github.com/KevinMusgrave/pytorch-metric-learning/) and [powerful-benchmarker](https://github.com/KevinMusgrave/powerful-benchmarker/) to see RecordKeeper in action.
+
+
+
+
+%package -n python3-record-keeper
+Summary: Record experiment data easily
+Provides: python-record-keeper
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-record-keeper
+# record-keeper
+
+## Installation
+```
+pip install record-keeper
+```
+
+## The Problem:
+When running machine-learning experiments, having more logged data is usually better than less. But adding new series of data to log can often require changes to your training code. When you want to log dozens of different series of data, your code starts to look awful.
+
+## The Solution:
+
+Use RecordKeeper, and easily add loggable information when you write a new class. The example below is modified from the [pytorch-metric-learning](https://github.com/KevinMusgrave/pytorch-metric-learning/blob/master/src/pytorch_metric_learning/miners/batch_hard_miner.py) library.
+
+First, create a list that contains the names of the attributes you want to record (```self._record_these``` in the example below).
+```python
+class BatchHardMiner(BaseTupleMiner):
+ def __init__(self, **kwargs):
+ super().__init__(**kwargs)
+ self._record_these = ["hardest_triplet_dist", "hardest_pos_pair_dist", "hardest_neg_pair_dist"]
+```
+
+Then tell RecordKeeper the name of the list to read. RecordKeeper will log and save all the attributes described in the list. It'll search recursively too, if you have nested objects.
+```python
+from torch.utils.tensorboard import SummaryWriter
+import record_keeper as record_keeper_package
+from pytorch_metric_learning import miners
+
+record_writer = record_keeper_package.RecordWriter(your_folder_for_logs)
+tensorboard_writer = SummaryWriter(log_dir=your_tensorboard_folder)
+record_keeper = record_keeper_package.RecordKeeper(tensorboard_writer, record_writer, ["_record_these"])
+
+your_miner_dictionary = {"tuple_miner": miners.BatchHardMiner()}
+
+# Then at each iteration of training:
+record_keeper.update_records(your_miner_dictionary, current_iteration)
+```
+
+Now the attributes described in ```_record_these```, (specifically, ```hardest_triplet_dist```, ```hardest_pos_pair_dist```, and ```hardest_neg_pair_dist```) can be viewed on Tensorboard.
+
+These data series are also saved in sqlite and CSV format. If you only want to use Tensorboard, then pass in only a SummaryWriter, and vice versa.
+
+The dictionary that you pass into ```record_keeper.update_records``` can contain any number of objects, and for each one, RecordKeeper will check if the object has a "_record_these" attribute. As long as you're making your dictionaries programmatically, it's possible to add large amounts of loggable data without clogging up your training code. See [pytorch-metric-learning](https://github.com/KevinMusgrave/pytorch-metric-learning/) and [powerful-benchmarker](https://github.com/KevinMusgrave/powerful-benchmarker/) to see RecordKeeper in action.
+
+
+
+
+%package help
+Summary: Development documents and examples for record-keeper
+Provides: python3-record-keeper-doc
+%description help
+# record-keeper
+
+## Installation
+```
+pip install record-keeper
+```
+
+## The Problem:
+When running machine-learning experiments, having more logged data is usually better than less. But adding new series of data to log can often require changes to your training code. When you want to log dozens of different series of data, your code starts to look awful.
+
+## The Solution:
+
+Use RecordKeeper, and easily add loggable information when you write a new class. The example below is modified from the [pytorch-metric-learning](https://github.com/KevinMusgrave/pytorch-metric-learning/blob/master/src/pytorch_metric_learning/miners/batch_hard_miner.py) library.
+
+First, create a list that contains the names of the attributes you want to record (```self._record_these``` in the example below).
+```python
+class BatchHardMiner(BaseTupleMiner):
+ def __init__(self, **kwargs):
+ super().__init__(**kwargs)
+ self._record_these = ["hardest_triplet_dist", "hardest_pos_pair_dist", "hardest_neg_pair_dist"]
+```
+
+Then tell RecordKeeper the name of the list to read. RecordKeeper will log and save all the attributes described in the list. It'll search recursively too, if you have nested objects.
+```python
+from torch.utils.tensorboard import SummaryWriter
+import record_keeper as record_keeper_package
+from pytorch_metric_learning import miners
+
+record_writer = record_keeper_package.RecordWriter(your_folder_for_logs)
+tensorboard_writer = SummaryWriter(log_dir=your_tensorboard_folder)
+record_keeper = record_keeper_package.RecordKeeper(tensorboard_writer, record_writer, ["_record_these"])
+
+your_miner_dictionary = {"tuple_miner": miners.BatchHardMiner()}
+
+# Then at each iteration of training:
+record_keeper.update_records(your_miner_dictionary, current_iteration)
+```
+
+Now the attributes described in ```_record_these```, (specifically, ```hardest_triplet_dist```, ```hardest_pos_pair_dist```, and ```hardest_neg_pair_dist```) can be viewed on Tensorboard.
+
+These data series are also saved in sqlite and CSV format. If you only want to use Tensorboard, then pass in only a SummaryWriter, and vice versa.
+
+The dictionary that you pass into ```record_keeper.update_records``` can contain any number of objects, and for each one, RecordKeeper will check if the object has a "_record_these" attribute. As long as you're making your dictionaries programmatically, it's possible to add large amounts of loggable data without clogging up your training code. See [pytorch-metric-learning](https://github.com/KevinMusgrave/pytorch-metric-learning/) and [powerful-benchmarker](https://github.com/KevinMusgrave/powerful-benchmarker/) to see RecordKeeper in action.
+
+
+
+
+%prep
+%autosetup -n record-keeper-0.9.32
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-record-keeper -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 0.9.32-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..4bb6dfd
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+cdb290d3c7a3eeacabc4d73b3bfc1652 record-keeper-0.9.32.tar.gz