Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Make simclr installable via pip #208

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from setuptools import setup, find_packages

from version import version


setup_info = dict(
name='simclr',
version=version,
author='google-research',
url='https://github.com/google-research/simclr',
download_url='https://github.com/google-research/simclr/tags',
project_urls={
'Source': 'https://github.com/google-research/simclr',
},
description='A Simple Framework for Contrastive Learning of Visual Representations',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
license='Apache License Version 2.0',

# Package info
packages=['simclr'] + ['simclr.' + pkg for pkg in find_packages('simclr')],

# Add _ prefix to the names of temporary build dirs
options={'build': {'build_base': '_build'}, },
zip_safe=True,
)

setup(**setup_info)
Empty file added simclr/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion data.py → simclr/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import functools
from absl import flags

import data_util as data_util
import simclr.data_util as data_util
import tensorflow.compat.v1 as tf

FLAGS = flags.FLAGS
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions model.py → simclr/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

from absl import flags

import data_util as data_util
import model_util as model_util
import objective as obj_lib
import simclr.data_util as data_util
import simclr.model_util as model_util
import simclr.objective as obj_lib

import tensorflow.compat.v1 as tf
import tensorflow.compat.v2 as tf2
Expand Down
2 changes: 1 addition & 1 deletion model_util.py → simclr/model_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import math
from absl import flags

import resnet
import simclr.resnet
from lars_optimizer import LARSOptimizer

import tensorflow.compat.v1 as tf
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions run.py → simclr/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
from absl import app
from absl import flags

import resnet
import data as data_lib
import model as model_lib
import model_util as model_util
import simclr.resnet as resnet
import simclr.data as data_lib
import simclr.model as model_lib
import simclr.model_util as model_util

import tensorflow.compat.v1 as tf
import tensorflow_datasets as tfds
Expand Down
File renamed without changes.
Empty file added simclr/tf2/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion tf2/data.py → simclr/tf2/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from absl import flags
from absl import logging

import data_util
import simclr.tf2.data_util as data_util
import tensorflow.compat.v2 as tf
import tensorflow_datasets as tfds

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tf2/model.py → simclr/tf2/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import math
from absl import flags

import data_util
import lars_optimizer
import resnet
import simclr.tf2.data_util as data_util
import simclr.tf2.lars_optimizer as lars_optimizer
import simclr.tf2.resnet as resnet
import tensorflow.compat.v2 as tf

FLAGS = flags.FLAGS
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 6 additions & 4 deletions tf2/run.py → simclr/tf2/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
from absl import app
from absl import flags
from absl import logging
import data as data_lib
import metrics
import model as model_lib
import objective as obj_lib

import simclr.tf2.data as data_lib
import simclr.tf2.metrics as metrics
import simclr.tf2.model as model_lib
import simclr.tf2.objective as obj_lib

import tensorflow.compat.v2 as tf
import tensorflow_datasets as tfds

Expand Down
1 change: 1 addition & 0 deletions version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "1.0"