<commit_before>---
layout: post
title: First post!
image: /img/hello_world.jpeg
tags:
  - random
  - exciting-stuff
published: true
---

## Rolling window with Pytorch

I always make my neural network and deep learning stuffs using numpy from scratch ( this keep my mind always usefull ) and off couse for me, better for debug
After heavly use Tensor Flow and discover Pytorch I just love.
First because 95% off my models ( actually not my but a implementation of many papers ) has been done from scratch ( and make my head explode many times ), see a framework make some things `easy` for you it's just like win your birthday a box of cold beer from your girlfriend ( if you drink offcourse ).

So, when I start, first problem that I have was generate rolling windows just using pytorch and after read the docs I see how this was easy:
`
# import torch
import torch

# make a range sequence sample
x = torch.range(1,20)

# unfold dimension to make our rolling window
# ie. window size of 5, step size of 1
x.unfold(0,5,1)
`
<commit_msg>Updated 2015-01-04-first-post.md<commit_after>---
layout: post
title: First post!
image: /img/hello_world.jpeg
tags:
  - random
  - exciting-stuff
published: true
---

## Rolling window with Pytorch

I always make my neural network and deep learning stuffs using numpy from scratch ( this keep my mind always usefull ) and off couse for me, better for debug
After heavly use Tensor Flow and discover Pytorch I just love.
First because 95% off my models ( actually not my but a implementation of many papers ) has been done from scratch ( and make my head explode many times ), see a framework make some things `easy` for you it's just like win your birthday a box of cold beer from your girlfriend ( if you drink offcourse ).

So, when I start, first problem that I have was generate rolling windows just using pytorch and after read the docs I see how this was easy:

# import torch`
import torch

def rolling_window(x, window_size, step_size=1)
  # make a range sequence sample
  x = torch.range(1,20)

  # unfold dimension to make our rolling window
  # ie. window size of 5, step size of 1
  return x.unfold(0,window_size,step_size)
`

{'fraction_non_alphanumeric': 0.05974264705882353, 'fraction_numerical': 0.012408088235294117, 'mean_word_length': 3.925339366515837, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1983323', 'n_tokens_mistral': 628, 'n_tokens_neox': 598, 'n_words': 336}