A_tune_in/.ipynb_checkpoints/picelate-checkpoint.ipynb

295 lines
15 KiB
Plaintext
Raw Normal View History

2022-10-26 20:24:37 +02:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "north-steering",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip -V"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "ranking-bottom",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting tensorflow==1.15.5\n",
" Using cached tensorflow-1.15.5-cp36-cp36m-manylinux2010_x86_64.whl (110.5 MB)\n",
"Collecting gast==0.2.2\n",
" Using cached gast-0.2.2-py3-none-any.whl\n",
"Collecting keras-preprocessing>=1.0.5\n",
" Using cached Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)\n",
"Collecting h5py<=2.10.0\n",
" Using cached h5py-2.10.0-cp36-cp36m-manylinux1_x86_64.whl (2.9 MB)\n",
"Collecting opt-einsum>=2.3.2\n",
" Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB)\n",
"Collecting protobuf>=3.6.1\n",
" Using cached protobuf-3.19.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)\n",
"Collecting tensorboard<1.16.0,>=1.15.0\n",
" Using cached tensorboard-1.15.0-py3-none-any.whl (3.8 MB)\n",
"Collecting tensorflow-estimator==1.15.1\n",
" Using cached tensorflow_estimator-1.15.1-py2.py3-none-any.whl (503 kB)\n",
"Collecting astor>=0.6.0\n",
" Using cached astor-0.8.1-py2.py3-none-any.whl (27 kB)\n",
"Collecting absl-py>=0.7.0\n",
" Using cached absl_py-1.3.0-py3-none-any.whl (124 kB)\n",
"Collecting termcolor>=1.1.0\n",
" Using cached termcolor-1.1.0.tar.gz (3.9 kB)\n",
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hCollecting wheel>=0.26\n",
" Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)\n",
"Requirement already satisfied: six>=1.10.0 in ./pocket/lib/python3.6/site-packages (from tensorflow==1.15.5) (1.16.0)\n",
"Collecting grpcio>=1.8.6\n",
" Using cached grpcio-1.48.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB)\n",
"Collecting keras-applications>=1.0.8\n",
" Using cached Keras_Applications-1.0.8-py3-none-any.whl (50 kB)\n",
"Collecting numpy<1.19.0,>=1.16.0\n",
" Downloading numpy-1.18.5-cp36-cp36m-manylinux1_x86_64.whl (20.1 MB)\n",
" |████████████████████████████████| 20.1 MB 14.0 MB/s \n",
"\u001b[?25hCollecting google-pasta>=0.1.6\n",
" Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB)\n",
"Collecting wrapt>=1.11.1\n",
" Using cached wrapt-1.14.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (74 kB)\n",
"Collecting markdown>=2.6.8\n",
" Using cached Markdown-3.3.7-py3-none-any.whl (97 kB)\n",
"Collecting setuptools>=41.0.0\n",
" Using cached setuptools-59.6.0-py3-none-any.whl (952 kB)\n",
"Collecting werkzeug>=0.11.15\n",
" Downloading Werkzeug-2.0.3-py3-none-any.whl (289 kB)\n",
" |████████████████████████████████| 289 kB 14.3 MB/s \n",
"\u001b[?25hRequirement already satisfied: importlib-metadata>=4.4 in ./pocket/lib/python3.6/site-packages (from markdown>=2.6.8->tensorboard<1.16.0,>=1.15.0->tensorflow==1.15.5) (4.8.3)\n",
"Requirement already satisfied: dataclasses in ./pocket/lib/python3.6/site-packages (from werkzeug>=0.11.15->tensorboard<1.16.0,>=1.15.0->tensorflow==1.15.5) (0.8)\n",
"Requirement already satisfied: typing-extensions>=3.6.4 in ./pocket/lib/python3.6/site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<1.16.0,>=1.15.0->tensorflow==1.15.5) (4.1.1)\n",
"Requirement already satisfied: zipp>=0.5 in ./pocket/lib/python3.6/site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<1.16.0,>=1.15.0->tensorflow==1.15.5) (3.6.0)\n",
"Using legacy 'setup.py install' for termcolor, since package 'wheel' is not installed.\n",
"Installing collected packages: numpy, wheel, werkzeug, setuptools, protobuf, markdown, h5py, grpcio, absl-py, wrapt, termcolor, tensorflow-estimator, tensorboard, opt-einsum, keras-preprocessing, keras-applications, google-pasta, gast, astor, tensorflow\n",
" Attempting uninstall: setuptools\n",
" Found existing installation: setuptools 39.0.1\n",
" Uninstalling setuptools-39.0.1:\n",
" Successfully uninstalled setuptools-39.0.1\n",
" Running setup.py install for termcolor ... \u001b[?25ldone\n",
"\u001b[?25hSuccessfully installed absl-py-1.3.0 astor-0.8.1 gast-0.2.2 google-pasta-0.2.0 grpcio-1.48.2 h5py-2.10.0 keras-applications-1.0.8 keras-preprocessing-1.1.2 markdown-3.3.7 numpy-1.18.5 opt-einsum-3.3.0 protobuf-3.19.6 setuptools-59.6.0 tensorboard-1.15.0 tensorflow-1.15.5 tensorflow-estimator-1.15.1 termcolor-1.1.0 werkzeug-2.0.3 wheel-0.37.1 wrapt-1.14.1\n",
"Collecting keras==2.2.5\n",
" Using cached Keras-2.2.5-py2.py3-none-any.whl (336 kB)\n",
"Requirement already satisfied: six>=1.9.0 in ./pocket/lib/python3.6/site-packages (from keras==2.2.5) (1.16.0)\n",
"Requirement already satisfied: h5py in ./pocket/lib/python3.6/site-packages (from keras==2.2.5) (2.10.0)\n",
"Requirement already satisfied: keras-applications>=1.0.8 in ./pocket/lib/python3.6/site-packages (from keras==2.2.5) (1.0.8)\n",
"Collecting pyyaml\n",
" Downloading PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (603 kB)\n",
" |████████████████████████████████| 603 kB 3.3 MB/s \n",
"\u001b[?25hRequirement already satisfied: keras-preprocessing>=1.1.0 in ./pocket/lib/python3.6/site-packages (from keras==2.2.5) (1.1.2)\n",
"Collecting scipy>=0.14\n",
" Downloading scipy-1.5.4-cp36-cp36m-manylinux1_x86_64.whl (25.9 MB)\n",
" |████████████████████████████████| 25.9 MB 854 kB/s \n",
"\u001b[?25hRequirement already satisfied: numpy>=1.9.1 in ./pocket/lib/python3.6/site-packages (from keras==2.2.5) (1.18.5)\n",
"Installing collected packages: scipy, pyyaml, keras\n",
"Successfully installed keras-2.2.5 pyyaml-6.0 scipy-1.5.4\n",
"Collecting pincelate\n",
" Using cached pincelate-0.0.1-py3-none-any.whl (12.0 MB)\n",
"Collecting pronouncing>=0.2.0\n",
" Using cached pronouncing-0.2.0-py2.py3-none-any.whl\n",
"Requirement already satisfied: Keras>=2.2.0 in ./pocket/lib/python3.6/site-packages (from pincelate) (2.2.5)\n",
"Collecting scikit-learn>=0.20.0\n",
" Using cached scikit_learn-0.24.2-cp36-cp36m-manylinux2010_x86_64.whl (22.2 MB)\n",
"Requirement already satisfied: numpy>=1.9.1 in ./pocket/lib/python3.6/site-packages (from Keras>=2.2.0->pincelate) (1.18.5)\n",
"Requirement already satisfied: pyyaml in ./pocket/lib/python3.6/site-packages (from Keras>=2.2.0->pincelate) (6.0)\n",
"Requirement already satisfied: six>=1.9.0 in ./pocket/lib/python3.6/site-packages (from Keras>=2.2.0->pincelate) (1.16.0)\n",
"Requirement already satisfied: h5py in ./pocket/lib/python3.6/site-packages (from Keras>=2.2.0->pincelate) (2.10.0)\n",
"Requirement already satisfied: keras-preprocessing>=1.1.0 in ./pocket/lib/python3.6/site-packages (from Keras>=2.2.0->pincelate) (1.1.2)\n",
"Requirement already satisfied: keras-applications>=1.0.8 in ./pocket/lib/python3.6/site-packages (from Keras>=2.2.0->pincelate) (1.0.8)\n",
"Requirement already satisfied: scipy>=0.14 in ./pocket/lib/python3.6/site-packages (from Keras>=2.2.0->pincelate) (1.5.4)\n",
"Collecting cmudict>=0.4.0\n",
" Using cached cmudict-1.0.2-py2.py3-none-any.whl (939 kB)\n",
"Collecting joblib>=0.11\n",
" Using cached joblib-1.1.1-py2.py3-none-any.whl (309 kB)\n",
"Collecting threadpoolctl>=2.0.0\n",
" Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB)\n",
"Installing collected packages: threadpoolctl, joblib, cmudict, scikit-learn, pronouncing, pincelate\n",
"Successfully installed cmudict-1.0.2 joblib-1.1.1 pincelate-0.0.1 pronouncing-0.2.0 scikit-learn-0.24.2 threadpoolctl-3.1.0\n"
]
}
],
"source": [
"import sys\n",
"!{sys.executable} -m pip install tensorflow==1.15.5\n",
"!{sys.executable} -m pip install keras==2.2.5\n",
"!{sys.executable} -m pip install pincelate"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "polar-modeling",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Using TensorFlow backend.\n"
]
}
],
"source": [
"from pincelate import Pincelate"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "9d01f6ee",
"metadata": {},
"outputs": [],
"source": [
"import ipywidgets as widgets\n",
"from IPython.display import display,HTML\n",
"from ipywidgets import interact,interactive_output,Layout,HBox,VBox"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "muslim-labor",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:541: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.\n",
"\n",
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:66: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.\n",
"\n",
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:4432: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.\n",
"\n",
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:148: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.\n",
"\n",
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3733: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.\n",
"Instructions for updating:\n",
"Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.\n",
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3239: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.\n",
"Instructions for updating:\n",
"Use tf.where in 2.0, which has the same broadcast rule as np.where\n",
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:190: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.\n",
"\n",
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:197: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.\n",
"\n",
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:203: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.\n",
"\n",
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:207: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.\n",
"\n",
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:216: The name tf.is_variable_initialized is deprecated. Please use tf.compat.v1.is_variable_initialized instead.\n",
"\n",
"WARNING:tensorflow:From /home/angeliki/Documents/Any_One_day_future/A_tune_in/pocket/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:223: The name tf.variables_initializer is deprecated. Please use tf.compat.v1.variables_initializer instead.\n",
"\n"
]
}
],
"source": [
"pin = Pincelate()\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "graphic-appearance",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'espelling'"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pin.manipulate(\"spelling\",temperature=1.5)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "361fe610",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 9,
"id": "b648b5ae",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a85a8a310b3c41f6be00aa3231989b5f",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(Text(value='any one future died', description='s'), FloatSlider(value=1.2500000000000002…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"@interact(s=\"any one future died\",temp=(0.05,2.5,0.05))\n",
"def tempadjust(s,temp):\n",
" return ' '.join([pin.manipulate(w.lower(),temperature=temp) for w in s.split()])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e4717967",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}