timusoid

0.0.1 • Public • Published

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:

npm install --save timusoid

Using yarn:

yarn add timusoid

✍️ Usage

import moment from 'moment';
import { timusoid } from 'timusoid';

const { sin, cos, tan, progress } = timusoid(
  moment('2020-01-04T14:19:03.201Z'),
  'yearly', // oneOf(['hourly', 'daily', 'weekly', 'monthly', 'yearly'])
);

sin(); // 0.061703628813687975
cos(); // 0.9980945156603269
tan(); // 0.061821428577699
progress(); // 0.009826679853832305 (%)

✌️ License

MIT

Buy @cawfree a coffee!

Package Sidebar

Install

npm i timusoid

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

8.05 kB

Total Files

12

Last publish

Collaborators

  • cawfree