Guest User

Untitled

a guest
Jun 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": null,
  6. "metadata": {},
  7. "outputs": [],
  8. "source": [
  9. "import tensorflow as tf"
  10. ]
  11. },
  12. {
  13. "cell_type": "code",
  14. "execution_count": null,
  15. "metadata": {},
  16. "outputs": [],
  17. "source": [
  18. "#output random values from a truncated normal distribution\n",
  19. "a = tf.truncated_normal([16,128,128,3])"
  20. ]
  21. },
  22. {
  23. "cell_type": "code",
  24. "execution_count": null,
  25. "metadata": {},
  26. "outputs": [],
  27. "source": [
  28. "sess = tf.Session()\n",
  29. "sess.run(tf.initialize_all_variables())\n",
  30. "sess.run(tf.shape(a)) #create a in session"
  31. ]
  32. },
  33. {
  34. "cell_type": "code",
  35. "execution_count": null,
  36. "metadata": {},
  37. "outputs": [],
  38. "source": [
  39. "b = tf.reshape(a,[16,49152])\n",
  40. "sess.run(tf.shape(b))"
  41. ]
  42. },
  43. {
  44. "cell_type": "code",
  45. "execution_count": null,
  46. "metadata": {},
  47. "outputs": [],
  48. "source": [
  49. "################ starting point ###############\n",
  50. "import cv2\n",
  51. "import numpy as np\n",
  52. "import os\n",
  53. "from random import shuffle\n",
  54. "from tqdm import tqdm"
  55. ]
  56. },
  57. {
  58. "cell_type": "code",
  59. "execution_count": null,
  60. "metadata": {},
  61. "outputs": [],
  62. "source": [
  63. "TRAIN_DIR = 'C:/Users/Awannaphasch2016/Documents/tensorflow cat and dog/train'\n",
  64. "TEST_DIR = 'C:/Users/Awannaphasch2016/Documents/tensorflow cat and dog/test1'"
  65. ]
  66. },
  67. {
  68. "cell_type": "code",
  69. "execution_count": null,
  70. "metadata": {},
  71. "outputs": [],
  72. "source": [
  73. "IMG_SIZE = 50\n",
  74. "LR = 1e-3 # what is this ?? \n",
  75. "#just so we remember which saved model is which, sized must match\n",
  76. "#to call\n",
  77. "MODEL_NAME = 'dogvscats-{}-{}.model'.format(LR, '2conv-basic')"
  78. ]
  79. }
  80. ],
  81. "metadata": {
  82. "kernelspec": {
  83. "display_name": "Python 3",
  84. "language": "python",
  85. "name": "python3"
  86. },
  87. "language_info": {
  88. "codemirror_mode": {
  89. "name": "ipython",
  90. "version": 3
  91. },
  92. "file_extension": ".py",
  93. "mimetype": "text/x-python",
  94. "name": "python",
  95. "nbconvert_exporter": "python",
  96. "pygments_lexer": "ipython3",
  97. "version": "3.6.5"
  98. }
  99. },
  100. "nbformat": 4,
  101. "nbformat_minor": 2
  102. }
Add Comment
Please, Sign In to add comment