tpcav 0.2.2__py3-none-any.whl → 0.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
tpcav/concepts.py CHANGED
@@ -41,6 +41,8 @@ def _construct_motif_concept_dataloader_from_control(
41
41
  motif_mode: str,
42
42
  batch_size: int,
43
43
  num_workers: int,
44
+ start_buffer=0,
45
+ end_buffer=0
44
46
  ) -> DataLoader:
45
47
  """Mirror the motif-based dataloader logic used in the TCAV script."""
46
48
  datasets = []
@@ -51,8 +53,8 @@ def _construct_motif_concept_dataloader_from_control(
51
53
  motif=motif,
52
54
  motif_mode=motif_mode,
53
55
  num_motifs=num_motifs,
54
- start_buffer=0,
55
- end_buffer=0,
56
+ start_buffer=start_buffer,
57
+ end_buffer=end_buffer,
56
58
  print_warning=False,
57
59
  infinite=False,
58
60
  )
@@ -190,7 +192,7 @@ class ConceptBuilder:
190
192
  added.append(concept)
191
193
  return added
192
194
 
193
- def build_motif_concept(self, motifs, concept_name, control_regions=None, motif_mode="pwm"):
195
+ def build_motif_concept(self, motifs, concept_name, control_regions=None, motif_mode="pwm", start_buffer=0, end_buffer=0):
194
196
  if control_regions is None:
195
197
  if not self.control_concepts:
196
198
  raise ValueError("Call build_control or pass control_regions first.")
@@ -207,6 +209,8 @@ class ConceptBuilder:
207
209
  motif_mode=motif_mode,
208
210
  batch_size=self.batch_size,
209
211
  num_workers=self.num_workers,
212
+ start_buffer=start_buffer,
213
+ end_buffer=end_buffer
210
214
  )
211
215
  concept = Concept(
212
216
  id=self._reserve_id(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tpcav
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Testing with PCA projected Concept Activation Vectors
5
5
  Author-email: Jianyu Yang <yztxwd@gmail.com>
6
6
  License-Expression: MIT AND (Apache-2.0 OR BSD-2-Clause)
@@ -1,12 +1,12 @@
1
1
  tpcav/__init__.py,sha256=CpHijSyE1HMy8dlvdSaYrwN9gYMGDEJGDdsneNWnqdA,996
2
2
  tpcav/cavs.py,sha256=m4Uhur5LwxdDfSpcznjoKCeqg4-UFjDEicpNglQ_7ss,19377
3
- tpcav/concepts.py,sha256=_ht4UTu2EVJh52JGnKT3PEgDHk4Q-JCpNuHfFOVmzCw,12884
3
+ tpcav/concepts.py,sha256=rvsSQSybIRTvCPj-AS4Eq7G8Kvh3vlEb6PTWshrXNBs,13044
4
4
  tpcav/helper.py,sha256=CcNFJEFG00pujUrthBoMInpIBz1mWIG3y5fztaiHO-c,9917
5
5
  tpcav/logging_utils.py,sha256=wug7O_5IjxjhOpQr-aq90qKMEUp1EgcPkrv26d8li6Q,281
6
6
  tpcav/tpcav_model.py,sha256=N6YmwqeBR8-QVxkV2uoqhYb3WGGMXo0ND6N8V3dIYug,16573
7
7
  tpcav/utils.py,sha256=s2TfC-YoH_xa73WuMqvtpuqzx6g3ne12hE90Yg9hToY,21502
8
- tpcav-0.2.2.dist-info/licenses/LICENSE,sha256=uC-2s0ObLnQzWFKH5aokHXo6CzxlJgeI0P3bIUCZgfU,1064
9
- tpcav-0.2.2.dist-info/METADATA,sha256=lnI4YDN09v7vOcrc5a1qKfb_t-XNuKjRb31a1yILioY,3502
10
- tpcav-0.2.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
11
- tpcav-0.2.2.dist-info/top_level.txt,sha256=I9veSE_WsuFYrXlcfRevqtatDyWWZNsWA3dV0CeBXVg,6
12
- tpcav-0.2.2.dist-info/RECORD,,
8
+ tpcav-0.2.3.dist-info/licenses/LICENSE,sha256=uC-2s0ObLnQzWFKH5aokHXo6CzxlJgeI0P3bIUCZgfU,1064
9
+ tpcav-0.2.3.dist-info/METADATA,sha256=k99nF8XM2SU-8d_rLVRcR7wN2dsetkjubyYO4DdTm50,3502
10
+ tpcav-0.2.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
11
+ tpcav-0.2.3.dist-info/top_level.txt,sha256=I9veSE_WsuFYrXlcfRevqtatDyWWZNsWA3dV0CeBXVg,6
12
+ tpcav-0.2.3.dist-info/RECORD,,
File without changes