Skip to content

Instantly share code, notes, and snippets.

View alegoritma's full-sized avatar
🎯
Focusing

Volkan Kalın alegoritma

🎯
Focusing
View GitHub Profile
@alegoritma
alegoritma / reducer.ts
Created April 25, 2022 06:14
With this middleware you can measure timings on performance tab in the browser's devTools
const userTiming = () => (next) => (action) => {
if (performance.mark === undefined) return next(action);
performance.mark(`${action.type}_start`);
const result = next(action);
performance.mark(`${action.type}_end`);
performance.measure(
`${action.type}`,
`${action.type}_start`,
`${action.type}_end`,
);
"""
requirements:
scikit-optimize
"""
from skopt import gbrt_minimize, gp_minimize, callbacks, load
from skopt.utils import use_named_args
from skopt.space import Real, Categorical, Integer
from functools import partial
@alegoritma
alegoritma / tf_stretch_histogram.py
Created March 12, 2021 12:41
tf.stretch_histogram
@tf.function
def tf_strech_histogram(image):
rmax = tf.reduce_max(image, axis=[-3,-2])
rmin = tf.reduce_min(image, axis=[-3,-2])
return (image-rmin)/(rmax-rmin)
import React, { createContext, useContext, useState } from 'react';
import {
makeStyles,
Dialog,
DialogContent,
CircularProgress,
Typography,
} from '@material-ui/core';
const PendingContext = createContext();