项目作者: cawfree

项目描述 :
Cyclic representations of time.
高级语言: JavaScript
项目地址: git://github.com/cawfree/timusoid.git
创建时间: 2020-01-03T22:59:13Z
项目社区:https://github.com/cawfree/timusoid

开源协议:MIT License

下载


timusoid

Circular representations of time. These are useful for graphically representing the periodicity of time or representing time-dependent input behaviour in deep neural networks. This was inspired by @ItsIanLondon‘s article “Encoding Cyclical Features in 24 Hour Time”.


code style: prettier

🚀 Getting Started

Using npm:

  1. npm install --save timusoid

Using yarn:

  1. yarn add timusoid

✍️ Usage

  1. import moment from 'moment';
  2. import { timusoid } from 'timusoid';
  3. const { sin, cos, tan, progress } = timusoid(
  4. moment('2020-01-04T14:19:03.201Z'),
  5. 'yearly', // oneOf(['hourly', 'daily', 'weekly', 'monthly', 'yearly'])
  6. );
  7. sin(); // 0.061703628813687975
  8. cos(); // 0.9980945156603269
  9. tan(); // 0.061821428577699
  10. progress(); // 0.009826679853832305 (%)

✌️ License

MIT



Buy @cawfree a coffee!