{"action":"created","comment":{"url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/comments/158191963","pull_request_review_id":84958429,"id":158191963,"diff_hunk":"@@ -115,48 +120,41 @@ def _getIntermediateOutputCol(self):\n         return \"__tmp_\" + self.getOutputCol()\n \n \n-# TODO: give an option to take off multiple layers so it can be used in tuning\n-#       (could be the name of the layer or int for how many to take off).\n-class DeepImageFeaturizer(Transformer, HasInputCol, HasOutputCol):\n+def _getScaleHintList():\n+    featurizer = SparkContext.getOrCreate()._jvm.com.databricks.sparkdl.DeepImageFeaturizer\n+    if isinstance(featurizer, py4j.java_gateway.JavaPackage):\n+        # do not see DeepImageFeaturizer, possibly running without spark\n+        # instead of failing return empty list\n+        return []\n+    return dict(featurizer.scaleHintsJava()).keys()\n+\n+\n+class DeepImageFeaturizer(JavaTransformer, HasInputCol, HasOutputCol):\n     \"\"\"\n     Applies the model specified by its popular name, with its prediction layer(s) chopped off,\n     to the image column in DataFrame. The output is a MLlib Vector so that DeepImageFeaturizer\n     can be used in a MLlib Pipeline.\n-    The input image column should be 3-channel SpImage.\n+    The input image column should be ImageSchema.\n     \"\"\"\n \n     modelName = Param(Params._dummy(), \"modelName\", \"A deep learning model name\",\n                       typeConverter=SparkDLTypeConverters.buildSupportedItemConverter(SUPPORTED_MODELS))\n \n+    scaleHint = Param(Params._dummy(), \"scaleHint\", \"Hint which algorhitm to use for image resizing\",\n+                      typeConverter=SparkDLTypeConverters.buildSupportedItemConverter(_getScaleHintList()))\n+\n     @keyword_only\n-    def __init__(self, inputCol=None, outputCol=None, modelName=None):\n+    def __init__(self, inputCol=None, outputCol=None, modelName=None, scaleHint=None):\n         \"\"\"\n         __init__(self, inputCol=None, outputCol=None, modelName=None)\n         \"\"\"\n         super(DeepImageFeaturizer, self).__init__()\n         kwargs = self._input_kwargs\n-        self.setParams(**kwargs)\n-\n-    @keyword_only\n-    def setParams(self, inputCol=None, outputCol=None, modelName=None):","path":"python/sparkdl/transformers/named_image.py","position":56,"original_position":56,"commit_id":"3816103e8cc4462d8a5cc6c2dccbec3f79b104c7","original_commit_id":"3816103e8cc4462d8a5cc6c2dccbec3f79b104c7","user":{"login":"smurching","id":2358483,"avatar_url":"https://avatars1.githubusercontent.com/u/2358483?v=4","gravatar_id":"","url":"https://api.github.com/users/smurching","html_url":"https://github.com/smurching","followers_url":"https://api.github.com/users/smurching/followers","following_url":"https://api.github.com/users/smurching/following{/other_user}","gists_url":"https://api.github.com/users/smurching/gists{/gist_id}","starred_url":"https://api.github.com/users/smurching/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smurching/subscriptions","organizations_url":"https://api.github.com/users/smurching/orgs","repos_url":"https://api.github.com/users/smurching/repos","events_url":"https://api.github.com/users/smurching/events{/privacy}","received_events_url":"https://api.github.com/users/smurching/received_events","type":"User","site_admin":false},"body":"I think we still need to implement `setParams` along with Python getters/setters for `scaleHint` and `modelName`. You can look at the PySpark's Bucketizer implementation as an example: https://github.com/apache/spark/blob/master/python/pyspark/ml/feature.py#L318","created_at":"2017-12-21T03:47:07Z","updated_at":"2017-12-21T03:59:53Z","html_url":"https://github.com/databricks/spark-deep-learning/pull/88#discussion_r158191963","pull_request_url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/88","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/comments/158191963"},"html":{"href":"https://github.com/databricks/spark-deep-learning/pull/88#discussion_r158191963"},"pull_request":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/88"}}},"pull_request":{"url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/88","id":158719020,"html_url":"https://github.com/databricks/spark-deep-learning/pull/88","diff_url":"https://github.com/databricks/spark-deep-learning/pull/88.diff","patch_url":"https://github.com/databricks/spark-deep-learning/pull/88.patch","issue_url":"https://api.github.com/repos/databricks/spark-deep-learning/issues/88","number":88,"state":"open","locked":false,"title":"[WIP] Make python DeepImageFeaturizer use Scala version.","user":{"login":"tomasatdatabricks","id":33237569,"avatar_url":"https://avatars3.githubusercontent.com/u/33237569?v=4","gravatar_id":"","url":"https://api.github.com/users/tomasatdatabricks","html_url":"https://github.com/tomasatdatabricks","followers_url":"https://api.github.com/users/tomasatdatabricks/followers","following_url":"https://api.github.com/users/tomasatdatabricks/following{/other_user}","gists_url":"https://api.github.com/users/tomasatdatabricks/gists{/gist_id}","starred_url":"https://api.github.com/users/tomasatdatabricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomasatdatabricks/subscriptions","organizations_url":"https://api.github.com/users/tomasatdatabricks/orgs","repos_url":"https://api.github.com/users/tomasatdatabricks/repos","events_url":"https://api.github.com/users/tomasatdatabricks/events{/privacy}","received_events_url":"https://api.github.com/users/tomasatdatabricks/received_events","type":"User","site_admin":false},"body":"- Based of Image schema PR, do not merge until Image schema is merged.\r\n- Otherwise mostly straightforward except results will not match keras in general due to different image libraries\r\n","created_at":"2017-12-16T00:19:39Z","updated_at":"2017-12-21T03:59:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f49cf5e17583e2e5b6071aa859dc27545933662","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/88/commits","review_comments_url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/88/comments","review_comment_url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/comments{/number}","comments_url":"https://api.github.com/repos/databricks/spark-deep-learning/issues/88/comments","statuses_url":"https://api.github.com/repos/databricks/spark-deep-learning/statuses/3816103e8cc4462d8a5cc6c2dccbec3f79b104c7","head":{"label":"tomasatdatabricks:tomas/ML_3150","ref":"tomas/ML_3150","sha":"3816103e8cc4462d8a5cc6c2dccbec3f79b104c7","user":{"login":"tomasatdatabricks","id":33237569,"avatar_url":"https://avatars3.githubusercontent.com/u/33237569?v=4","gravatar_id":"","url":"https://api.github.com/users/tomasatdatabricks","html_url":"https://github.com/tomasatdatabricks","followers_url":"https://api.github.com/users/tomasatdatabricks/followers","following_url":"https://api.github.com/users/tomasatdatabricks/following{/other_user}","gists_url":"https://api.github.com/users/tomasatdatabricks/gists{/gist_id}","starred_url":"https://api.github.com/users/tomasatdatabricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomasatdatabricks/subscriptions","organizations_url":"https://api.github.com/users/tomasatdatabricks/orgs","repos_url":"https://api.github.com/users/tomasatdatabricks/repos","events_url":"https://api.github.com/users/tomasatdatabricks/events{/privacy}","received_events_url":"https://api.github.com/users/tomasatdatabricks/received_events","type":"User","site_admin":false},"repo":{"id":109747040,"name":"spark-deep-learning","full_name":"tomasatdatabricks/spark-deep-learning","owner":{"login":"tomasatdatabricks","id":33237569,"avatar_url":"https://avatars3.githubusercontent.com/u/33237569?v=4","gravatar_id":"","url":"https://api.github.com/users/tomasatdatabricks","html_url":"https://github.com/tomasatdatabricks","followers_url":"https://api.github.com/users/tomasatdatabricks/followers","following_url":"https://api.github.com/users/tomasatdatabricks/following{/other_user}","gists_url":"https://api.github.com/users/tomasatdatabricks/gists{/gist_id}","starred_url":"https://api.github.com/users/tomasatdatabricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomasatdatabricks/subscriptions","organizations_url":"https://api.github.com/users/tomasatdatabricks/orgs","repos_url":"https://api.github.com/users/tomasatdatabricks/repos","events_url":"https://api.github.com/users/tomasatdatabricks/events{/privacy}","received_events_url":"https://api.github.com/users/tomasatdatabricks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomasatdatabricks/spark-deep-learning","description":"Deep Learning Pipelines for Apache Spark","fork":true,"url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning","forks_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/forks","keys_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/teams","hooks_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/hooks","issue_events_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/issues/events{/number}","events_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/events","assignees_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/assignees{/user}","branches_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/branches{/branch}","tags_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/tags","blobs_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/statuses/{sha}","languages_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/languages","stargazers_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/stargazers","contributors_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/contributors","subscribers_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/subscribers","subscription_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/subscription","commits_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/contents/{+path}","compare_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/merges","archive_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/downloads","issues_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/issues{/number}","pulls_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/pulls{/number}","milestones_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/milestones{/number}","notifications_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/labels{/name}","releases_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/releases{/id}","deployments_url":"https://api.github.com/repos/tomasatdatabricks/spark-deep-learning/deployments","created_at":"2017-11-06T20:38:05Z","updated_at":"2017-11-06T20:38:07Z","pushed_at":"2017-12-21T01:07:01Z","git_url":"git://github.com/tomasatdatabricks/spark-deep-learning.git","ssh_url":"git@github.com:tomasatdatabricks/spark-deep-learning.git","clone_url":"https://github.com/tomasatdatabricks/spark-deep-learning.git","svn_url":"https://github.com/tomasatdatabricks/spark-deep-learning","homepage":null,"size":3384,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"databricks:master","ref":"master","sha":"aeff9c9e2c24ed09c093414a7b51ec9bd42f1e86","user":{"login":"databricks","id":4998052,"avatar_url":"https://avatars2.githubusercontent.com/u/4998052?v=4","gravatar_id":"","url":"https://api.github.com/users/databricks","html_url":"https://github.com/databricks","followers_url":"https://api.github.com/users/databricks/followers","following_url":"https://api.github.com/users/databricks/following{/other_user}","gists_url":"https://api.github.com/users/databricks/gists{/gist_id}","starred_url":"https://api.github.com/users/databricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/databricks/subscriptions","organizations_url":"https://api.github.com/users/databricks/orgs","repos_url":"https://api.github.com/users/databricks/repos","events_url":"https://api.github.com/users/databricks/events{/privacy}","received_events_url":"https://api.github.com/users/databricks/received_events","type":"Organization","site_admin":false},"repo":{"id":92971378,"name":"spark-deep-learning","full_name":"databricks/spark-deep-learning","owner":{"login":"databricks","id":4998052,"avatar_url":"https://avatars2.githubusercontent.com/u/4998052?v=4","gravatar_id":"","url":"https://api.github.com/users/databricks","html_url":"https://github.com/databricks","followers_url":"https://api.github.com/users/databricks/followers","following_url":"https://api.github.com/users/databricks/following{/other_user}","gists_url":"https://api.github.com/users/databricks/gists{/gist_id}","starred_url":"https://api.github.com/users/databricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/databricks/subscriptions","organizations_url":"https://api.github.com/users/databricks/orgs","repos_url":"https://api.github.com/users/databricks/repos","events_url":"https://api.github.com/users/databricks/events{/privacy}","received_events_url":"https://api.github.com/users/databricks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/databricks/spark-deep-learning","description":"Deep Learning Pipelines for Apache Spark","fork":false,"url":"https://api.github.com/repos/databricks/spark-deep-learning","forks_url":"https://api.github.com/repos/databricks/spark-deep-learning/forks","keys_url":"https://api.github.com/repos/databricks/spark-deep-learning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/databricks/spark-deep-learning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/databricks/spark-deep-learning/teams","hooks_url":"https://api.github.com/repos/databricks/spark-deep-learning/hooks","issue_events_url":"https://api.github.com/repos/databricks/spark-deep-learning/issues/events{/number}","events_url":"https://api.github.com/repos/databricks/spark-deep-learning/events","assignees_url":"https://api.github.com/repos/databricks/spark-deep-learning/assignees{/user}","branches_url":"https://api.github.com/repos/databricks/spark-deep-learning/branches{/branch}","tags_url":"https://api.github.com/repos/databricks/spark-deep-learning/tags","blobs_url":"https://api.github.com/repos/databricks/spark-deep-learning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/databricks/spark-deep-learning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/databricks/spark-deep-learning/git/refs{/sha}","trees_url":"https://api.github.com/repos/databricks/spark-deep-learning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/databricks/spark-deep-learning/statuses/{sha}","languages_url":"https://api.github.com/repos/databricks/spark-deep-learning/languages","stargazers_url":"https://api.github.com/repos/databricks/spark-deep-learning/stargazers","contributors_url":"https://api.github.com/repos/databricks/spark-deep-learning/contributors","subscribers_url":"https://api.github.com/repos/databricks/spark-deep-learning/subscribers","subscription_url":"https://api.github.com/repos/databricks/spark-deep-learning/subscription","commits_url":"https://api.github.com/repos/databricks/spark-deep-learning/commits{/sha}","git_commits_url":"https://api.github.com/repos/databricks/spark-deep-learning/git/commits{/sha}","comments_url":"https://api.github.com/repos/databricks/spark-deep-learning/comments{/number}","issue_comment_url":"https://api.github.com/repos/databricks/spark-deep-learning/issues/comments{/number}","contents_url":"https://api.github.com/repos/databricks/spark-deep-learning/contents/{+path}","compare_url":"https://api.github.com/repos/databricks/spark-deep-learning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/databricks/spark-deep-learning/merges","archive_url":"https://api.github.com/repos/databricks/spark-deep-learning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/databricks/spark-deep-learning/downloads","issues_url":"https://api.github.com/repos/databricks/spark-deep-learning/issues{/number}","pulls_url":"https://api.github.com/repos/databricks/spark-deep-learning/pulls{/number}","milestones_url":"https://api.github.com/repos/databricks/spark-deep-learning/milestones{/number}","notifications_url":"https://api.github.com/repos/databricks/spark-deep-learning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/databricks/spark-deep-learning/labels{/name}","releases_url":"https://api.github.com/repos/databricks/spark-deep-learning/releases{/id}","deployments_url":"https://api.github.com/repos/databricks/spark-deep-learning/deployments","created_at":"2017-05-31T17:30:28Z","updated_at":"2017-12-20T13:55:26Z","pushed_at":"2017-12-21T01:07:02Z","git_url":"git://github.com/databricks/spark-deep-learning.git","ssh_url":"git@github.com:databricks/spark-deep-learning.git","clone_url":"https://github.com/databricks/spark-deep-learning.git","svn_url":"https://github.com/databricks/spark-deep-learning","homepage":"https://databricks.github.io/spark-deep-learning","size":3774,"stargazers_count":675,"watchers_count":675,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":144,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":144,"open_issues":31,"watchers":675,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/88"},"html":{"href":"https://github.com/databricks/spark-deep-learning/pull/88"},"issue":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/issues/88"},"comments":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/issues/88/comments"},"review_comments":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/88/comments"},"review_comment":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/pulls/88/commits"},"statuses":{"href":"https://api.github.com/repos/databricks/spark-deep-learning/statuses/3816103e8cc4462d8a5cc6c2dccbec3f79b104c7"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"smurching"}}