Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cawfree/timusoid

Cyclic representations of time.
https://github.com/cawfree/timusoid

cyclic moment network neural node percent time

Last synced: 2 months ago
JSON representation

Cyclic representations of time.

Awesome Lists containing this project

README

        

# 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](https://twitter.com/ItsIanLondon)'s article ["Encoding Cyclical Features in 24 Hour Time"](https://ianlondon.github.io/blog/encoding-cyclical-features-24hour-time/).


code style: prettier

## 🚀 Getting Started

Using [`npm`]():

```bash
npm install --save timusoid
```

Using [`yarn`]():

```bash
yarn add timusoid
```

## ✍️ Usage

```javascript
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](https://opensource.org/licenses/MIT)



Buy @cawfree a coffee!